Skip to main content
hook

plan-mode-game — Claude Code hook for games during planning

This hook opens a browser game when Claude Code enters Plan Mode and tracks tool activity. It gives you something to do while a plan takes shape.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --hook automation/plan-mode-game
Open on GitHub

What plan-mode-game does

Entering Plan Mode launches Dino Runner, Snake, or Flappy Bird. A live panel displays Claude’s tool calls; the game pauses when Claude asks you for input, then shows a completion screen with confetti. Scores are stored locally and can be shared through a signed verification URL.

The hook uses shell scripts for startup, activity tracking, plan detection, and input prompts, alongside server.js and index.html. Node.js and curl are required. It opens the browser with open, so it runs on macOS; install it globally to use it across projects.

What it helps with

  • launch a game when Claude Code enters Plan Mode
  • watch tool calls as Claude builds a plan
  • pause the game while Claude waits for a response
  • save a score locally and share its verification link

Example prompts for the agent

  • Plan the changes for this project in Plan Mode.
  • Inspect the project and draft a work plan.
  • Ask me a question if you need more information to plan the changes.

How to install plan-mode-game

1claude-code-templates

npx claude-code-templates@latest --hook automation/plan-mode-game

2Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about plan-mode-game

How do I install plan-mode-game in Claude Code?

Run npx claude-code-templates@latest --hook automation/plan-mode-game, then use .claude/settings.json.

What does plan-mode-game do?

It opens a browser game when Claude Code enters Plan Mode and displays tool activity. The game pauses while Claude waits for your input.

What does plan-mode-game need to run?

It requires Node.js and curl. The hook opens the browser with open, so it runs on macOS.

Source text

plan-mode-game.json · MIT
{
  "description": "Play games while Claude plans. Launches a browser game (Dino Runner, Snake, or Flappy Bird) automatically when Claude enters Plan Mode via EnterPlanMode or /plan. A live activity panel shows Claude's tool calls in real time. The game pauses when Claude needs input (AskUserQuestion) and shows a completion screen with confetti when the plan is done. Scores are saved locally and can be shared via a signed verification URL. Requires Node.js and curl. macOS only (uses 'open' to launch browser). Install globally so it works across all projects.",
  "tags": ["plan-mode", "gaming", "automation", "fun", "productivity", "global", "macos"],
  "supportingFiles": [
    {
      "source": "plan-mode-game/start.sh",
      "destination": "~/.claude/scripts/plan-mode-game/start.sh",
      "executable": true
    },
    {
      "source": "plan-mode-game/activity.sh",
      "destination": "~/.claude/scripts/plan-mode-game/activity.sh",
      "executable": true
    },
    {
      "source": "plan-mode-game/plan-detect.sh",
      "destination": "~/.claude/scripts/plan-mode-game/plan-detect.sh",
      "executable": true
    },
    {
      "source": "plan-mode-game/announce.sh",
      "destination": "~/.claude/scripts/plan-mode-game/announce.sh",
      "executable": true
    },
    {
      "source": "plan-mode-game/needs-input.sh",
      "destination": "~/.claude/scripts/plan-mode-game/needs-input.sh",
      "executable": true
    },
    {
      "source": "plan-mode-game/server.js",
      "destination": "~/.claude/scripts/plan-mode-game/server.js",
      "executable": false
    },
    {
      "source": "plan-mode-game/index.html",
      "destination": "~/.claude/scripts/plan-mode-game/index.html",
      "executable": false
    }
  ],
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "EnterPlanMode",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/scripts/plan-mode-game/start.sh"
          }
        ]
      },
      {
        "matcher": "Read|Glob|Grep|WebFetch|WebSearch|Task|Bash|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/scripts/plan-mode-game/activity.sh"
          }
        ]
      },
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/scripts/plan-mode-game/plan-detect.sh"
          }
        ]
      },
      {
        "matcher": "AskUserQuestion",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/scripts/plan-mode-game/needs-input.sh"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "ExitPlanMode",
        "hooks": [
          {
            "type": "command",
            "command": "bash $HOME/.claude/scripts/plan-mode-game/announce.sh"
          }
        ]
      }
    ]
  }
}

© davila7 · MIT · davila7/claude-code-templates

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor