開発者ツール2026注目

TOOLSTORM

Claude Code アーケードプラグイン

github.com
TOOLSTORM – Claude Code アーケードプラグイン screenshot 1 of 1
01

課題

AIエージェントの処理を待つ数分間、エージェントの作業状況と連動した有意義な体験がなかった。

02

アプローチ

Node.js上で動作する依存関係ゼロのTypeScript製Claude Codeプラグインを開発。10個の非同期フックがツール呼び出しをJSON Linesログに記録し、分割ペインのターミナルゲームが毎秒30回ログを読み取って編集を敵に、テスト合格をパワーアップに、失敗をダメージに変換。

03

成果

実際のエージェント活動に連動するアーケードシューティングゲーム(4モード、6ボス、9パワーアップ、30トロフィー、7機体)。3つのOSで67テストスイートが動作し、Claude Codeプラグインディレクトリに公開済み。

システム設計

TOOLSTORM の構成

技術アーキテクチャの説明は英語です。

A Claude Code plugin split across two processes, because hooks have no terminal and Claude Code owns the keyboard in its own pane. Hooks only append events to a per-session log; the game runs in a separate split pane that tails the log, and writes a small state file back for the status-line scoreboard.

Claude Code hooks feeding the game
10
trophies, with 7 unlockable ships
30
tests, on Linux, Windows and macOS
67
runtime dependencies
0

01 · Claude Code

client

Claude Code session

client

Status line

optional scoreboard row

02 · Hooks

worker

Hook process

Node.js

async, one per event

03 · Local files

object store

Event log

sessions/<id>.jsonl, 1 MB cap

object store

State file

score, wave, lives

object store

Profile

XP, trophies, boards

04 · Game pane

service

Event tail

reads new lines 30×/s

service

Game engine

waves, bosses, power-ups

service

Terminal renderer

keyboard and mouse input

clientserviceworkerobject store

8 connections

  • Claude Code session→Hook process10 hook events · async
  • Hook process→Event logappend one line
  • Event log→Event tailtail · async
  • Event tail→Game enginegame events
  • Game engine→Terminal renderer
  • Game engine→State filewrite
  • Game engine→Profileend of run
  • State file→Status lineread every 2 s · optional

Request flow · Claude edits a file

  1. 1PostToolUse fires and Claude Code starts the hook in the background; it never waits on it.
  2. 2The hook appends one JSON line naming the tool and file, never contents or command arguments, to the session log.
  3. 3The game pane picks the line up on its next tail and the engine spawns a bug to shoot.
  4. 4Score, wave and lives are written to the state file, which the status-line row reads to show the run inside Claude’s pane.

Design decisions

Hooks are fire-and-forget
Every hook is async and swallows its own errors, so a crashed or missing game can never slow or break the real session.
A file, not a socket
Hooks append whole lines with O_APPEND; the game tails the file and notices truncation. No server, no port, no daemon to keep alive.
Pause on permission
PermissionRequest and Notification hooks pause the run with a banner, so the game never competes with a decision Claude needs from you.
Privacy by omission
Events carry a tool name, a file name, a program name or a web host. Query strings, search terms, file contents and command arguments are never written.

Trade-offs & known limits

  • Each tool call starts a short Node process, about 100 ms of CPU, off Claude’s critical path.
  • Event order between concurrent hooks is not guaranteed; the game treats the log as a stream of independent events.

同じようなプロジェクトをお考えですか?

フリーランス・業務委託のご依頼を受け付けています。お気軽にご相談ください。