narze/bad-apple-claude-mod
bad-apple
A Claude Code plugin that plays the Bad Apple!! shadow-art video with synchronized sound in the prompt band or a side pane, rendering frames as quadrant glyphs via function hooks.
이 mod 소개
bad-apple-claude-mod is a Claude Code mod packaged as a plugin of function hooks. It plays the Bad Apple!! shadow-art PV inside Claude Code, either in the band above the prompt or in a side pane, with the song kept in sync. Frames are rendered as quadrant glyph cells (▘▀▌▙█), 192x144 source frames fit into at most 96x36 cells, and repainted roughly 60 times a second with $.ui.blit. An optional grayscale mode approximates two of 32 levels per cell for antialiasing. Commands include /bad-apple, pane, pause, resume, restart, gray, and stop, with on-screen buttons and a time/progress bar in the status line. Audio uses afplay (macOS only). Video and song assets are not included and must be built locally with ffmpeg, python3, and yt-dlp via scripts/download-video.sh and scripts/build-assets.sh, then loaded with claude --plugin-dir. Code is MIT licensed; the media is not covered.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add narze/bad-apple-claude-mod claude plugin install bad-apple
원문 / README
bad-apple-claude-mod
Plays Bad Apple!! inside Claude Code, as a mod (a plugin of function hooks). The video plays in the band above the prompt, or in a side pane, with the song in sync.
- Quadrant cells: each cell is a solid quadrant glyph (
▘▀▌▙█…) over 2x2 quarters, drawn as oneRaster. Black and white by default; with gray on, each cell takes two of 32 gray levels, the best two-tone fit to how much of each quarter is lit, so edges are antialiased - 192x144 frames into at most 96x36 cells; smaller sites average bigger pixel blocks, never upscale
- About 60 repaints a second with
$.ui.blit, frame picked from the wall clock so video stays in sync with the song - Pause and resume, also for the song (the mod cuts the constant-bitrate MP3 at the right byte)
- Time and a progress bar beside the video, and in the status line
Use
| Command | What it does |
| --- | --- |
| /bad-apple | Play in the band above the prompt (default) |
| /bad-apple pane | Play in a pane (Esc closes it) |
| /bad-apple pause / resume | Pause or resume |
| /bad-apple restart | Play again from 0:00, in the same place |
| /bad-apple gray | Turn grayscale antialiasing on or off (off by default; remembered across sessions) |
| /bad-apple stop | Stop |
The band has Pause/Resume (p), Restart (r), Gray (g) and Stop (s) buttons; the pane has all but Stop (Esc closes it).
Sound plays through afplay, so only on macOS. Other systems get the video only.
Install
The video frames and the song are not in this repo. Build them on your machine.
You need ffmpeg, python3, and yt-dlp (or uvx, which runs the latest yt-dlp).
git clone https://github.com/narze/bad-apple-claude-mod
cd bad-apple-claude-mod
./scripts/download-video.sh # yt-dlp: YouTube -> work/bad-apple.webm
./scripts/build-assets.sh # work file -> assets/
claude --plugin-dir "$PWD"
Scripts
| Script | What it does |
| --- | --- |
| scripts/download-video.sh [url] [--force] | Downloads the PV from YouTube with yt-dlp (480p or less) to the working file work/bad-apple.<ext>. Skips the download when the file is there; --force downloads again. Default URL: https://www.youtube.com/watch?v=FtutLA63Cp8 |
| scripts/build-assets.sh [url] [--force] | Runs download-video.sh (same arguments), then makes 192x144 1-bit frames at 30 fps in assets/frames-*.bin and a 96 kbit/s mono MP3 in assets/bad-apple.mp3 |
If YouTube refuses the download (HTTP Error 403), update yt-dlp, or install uv so the script uses uvx yt-dlp@latest.
work/ and assets/ are git-ignored.
Develop
claude plugin validate .
claude plugin test .
npx -p typescript tsc -p . # after Claude Code has loaded the mod once (it writes .claude-plugin/types/)
| File | Role |
| --- | --- |
| hooks/register.tsx | Command, player, band and pane drawing |
| hooks/frames.ts | Pure helpers: grid fit, frame encoding, MP3 offset |
| hooks/bad-apple.test.ts | Tests (claude plugin test) |
| types/index.d.ts | $.state contract (mode, isPaused, isMono) |
| scripts/download-video.sh | Downloads the working video file to work/ |
| scripts/build-assets.sh | Builds assets/ from the working file |
Credits
Bad Apple!! is a song from Touhou Project by ZUN, arranged by Alstroemeria Records, with the shadow-art PV by Anira. This repo has no part of the video or the song.
License
The code is MIT. The MIT license does not cover the video or the song.


