ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by Yash1927

tool-snake

A Claude Code plugin that opens a Snake pane beside the chat; every tool call Claude makes drops food onto the board, and the game pauses with a spoken score when Claude finishes.

Translated

About this mod

tool-snake is a Claude Code mod implemented as a plugin of function hooks. A game pane docks beside the chat (or above the prompt in other layouts) and appears when a prompt is submitted. Each tool call by the main agent drops a colored chip labeled with the tool's first letter (B Bash, E Edit, R Read, W Write, G Grep/Glob; other tools drop gray). The snake moves only while Claude is working; on turn completion the game pauses, the badge flips from LIVE to DONE, and a toast plus spoken line report how many tool calls were eaten. Session best score is kept. Hooks: prompt.submit (start turn, open pane), tool.call (add food), turn.complete (stop), ui.message (toast and speech). Keys: arrows/WASD to steer, r to restart, Esc to return keys to the prompt; /snake reopens the pane. MIT licensed.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add Yash1927/claude-code-snake
claude plugin install tool-snake
Original text / README

tool-snake

Play snake inside Claude Code while it works. Every tool call Claude makes drops food into the game.

<p align="center"> <a href="media/tool-snake-launch.mp4"><img src="media/tool-snake-demo.gif" width="800" alt="Claude Code with the tool-snake pane docked beside the chat: each tool call in the chat drops a colored chip onto the snake board"></a> </p> <p align="center"><a href="media/tool-snake-launch.mp4">Watch the 30-second launch video (sound on)</a></p>

What it does

  • A game pane opens next to the chat when you send Claude a prompt.
  • Every tool call Claude makes drops food, shown as the tool's first letter in the tool's color: B Bash, E Edit, R Read, W Write, G Grep (and Glob). Other tools drop a gray chip.
  • The snake only moves while Claude is working. When Claude finishes, the game pauses, the badge flips from LIVE to DONE, and it tells you, in a toast and out loud, how many of its tool calls you ate: "Claude is done. You ate 9 of its 14 tool calls."
  • Your best score is kept for the session.

Play

  1. Get the mod and start Claude Code with it:
    git clone https://github.com/Yash1927/claude-code-snake
    claude --plugin-dir claude-code-snake
    
  2. Send Claude a prompt. The game pane opens.
  3. Click the game to give it the keys. Arrows or WASD steer, r restarts after a crash, Esc gives the keys back to the prompt.
  4. /snake opens the pane any time.

The game needs the terminal or the desktop app. In the fullscreen layout the pane docks beside the chat; otherwise it sits above the prompt.

How it works

tool-snake is a Claude Code mod: a plugin of function hooks that runs in the session.

| file | what it does | | --- | --- | | hooks/register.tsx | Hooks prompt.submit (start a turn, open the pane), tool.call (add food for the main agent's calls), turn.complete (stop) and ui.message (toast and speak the final count), and draws the pane. | | hooks/game.tsx | The game: a 22x12 board with 2-character square cells, stepped every 110 ms, edges wrap. Draws the header, board, legend and hint. | | tests/snake.test.tsx | Food from tool calls, eating, pausing when Claude is done, steering, the spoken line, and the pane on the terminal. |

Test

claude plugin validate tool-snake
claude plugin test tool-snake

The launch video

The video in media/ is built entirely in code, with no After Effects. An HTML page draws every frame from a single time value, Playwright renders it at 60 fps, and ffmpeg encodes it. It runs this mod's own game logic, so the board, chips and the final 9 of 14 are what the mod produces for those tool calls. Source and re-render steps are in video/.

License

MIT © Yash Rastogi (@yashx26)

Similar projects