oMaN-Rod/claude-code-widgets/tree/main/plugins/diff-widget
この mod について
Claude Code Widgets
Claude Code のプロンプトの下に置く小さなカードです。フルスクリーンでは transcript の横にドッキングできます。各 widget は独立した mod で、スラッシュコマンドで切り替えます。
最初は便利なもの(コンテキスト、使用量、ファイルツリー)が少しあるだけでしたが、どんどん増えました。今では 61 個の widget があり、git status やターンタイマーから、ピクセルのカニ、ダンジョンクロール、Tetris まで揃っています。
インストール
マーケットプレイスを追加し、レイアウトプラグインと必要な widget をインストールします。
/plugin marketplace add oMaN-Rod/claude-code-widgets
/plugin install widgets@claude-code-widgets
/plugin install context-widget@claude-code-widgets
すべての widget に必要なのは、カードを配置するレイアウトプラグイン widgets です。
mod(function hook)をサポートする Claude Code のバージョンが必要です。mod API は early access で、リリースごとに変わる可能性があります。
Widget
レイアウト
すべての widget が必要とします。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| widgets | /widgets [side\\|above\\|below\\|close\\|<columns>\\|width <widget> <columns\\|reset>] | プロンプトの下、上、またはフルスクリーン時の transcript の横にカードを配置 |
セッション
Claude が何をしていて、いくらかかっているか。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| context-widget | /context-widget [auto\\|detailed\\|grid\\|top\\|bar\\|line] | /context のカテゴリごとに色を変えた積み上げバーでコンテキストウィンドウを表示 |
| usage-widget | /usage-widget | レート制限ウィンドウごとのバー、リセットまでの時間、セッションコスト |
| timer-widget | /timer-widget [on\\|off\\|clear] | 実行中のターンの経過時間、直近・平均・最長のターン、スパークライン |
| activity-widget | /activity-widget [on\\|off\\|clear] | 最新のツール呼び出し、その所要時間、失敗したかどうか |
| tasks-widget | /tasks-widget [on\\|off\\|clear] | Claude が処理しているタスクリストとプログレスバー |
| checks-widget | /checks-widget [on\\|off\\|clear] | 最新のテスト、lint、ビルド実行:成功/失敗、所要時間、実行からの経過時間 |
| timeline-widget | /timeline-widget [on\\|off] | ターンをチャート化:時間軸上にツール呼び出しごとのバーを置き、並行呼び出しは重ねて表示 |
| board-widget | /board-widget [on\\|off\\|clear] | Claude が pin ツールで自分自身に書かせるステータスボード:目標、発見、未解決の質問 |
| forecast-widget | /forecast-widget [on\\|off\\|clear] | ターンごとのコンテキスト増加をチャート化し、コンパクションまでの残りターン数を表示 |
| guard-widget | /guard-widget [on\\|off\\|clear] | このセッションの権限チェック:許可、確認済み、拒否、繰り返し尋ねられる内容 |
| stream-widget | /stream-widget [on\\|off] | Claude が書いている間のリアルタイム token/秒ゲージとスパークライン(文字数から推定) |
| sessions-widget | /sessions-widget [on\\|off] | このマシンで開いているほかの Claude Code セッション:フォルダー、ブランチ、ビジー/アイドル |
プロジェクトと git
ワークツリーの状態。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| file-tree-widget | /file-tree-widget | プロジェクトディレクトリ。クリックでフォルダーを展開 |
| git-widget | /git-widget | ブランチ、ahead/behind、staged、changed、untracked の数、最後のコミット |
| changes-widget | /changes-widget [on\\|off\\|clear] | このセッションで編集したファイルを新しい順に表示し、各ファイルの編集回数も表示 |
| commits-widget | /commits-widget | セッション開始後に作成されたコミット |
| todos-widget | /todos-widget | 追跡対象ファイルの TODO、FIXME、HACK、XXX コメントを数えて一覧表示 |
| diff-widget | /diff-widget [on\\|off\\|clear] | 最後の編集を構文ハイライト付きの差分で表示 |
| watch-widget | /watch-widget [on\\|off\\|run\\|stop]、/watch <command> | /watch bun test は編集のたびにコマンドを再実行し、成功/失敗と最後のエラー行を表示 |
| map-widget | /map-widget [on\\|off\\|clear] | 追跡対象ファイルのピクセルマップ。Claude が読んだ場所は青、編集した場所は緑に光ります |
時間と集中
セッションに依存しない時計、タイマー、リマインダー。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| pomodoro-widget | /pomodoro-widget [on\\|off\\|start\\|break\\|stop\\|<minutes>] | カウントダウン付きの集中タイマー、プログレスバー、完了したセッション数 |
| countdown-widget | /countdown-widget [on\\|off\\|clear]、/countdown <HH:MM\\|<n>m\\|<n>h> [label] | 設定した期限までの残り時間、プログレスバー、到達時のトースト |
| clocks-widget | /clocks-widget [on\\|off\\|add <zone>\\|remove <zone>\\|clear] | 現地時刻と追加したタイムゾーン。たとえば Asia/Tokyo |
| notes-widget | /notes-widget [on\\|off\\|clear]、/note <text\\|done <n>> | セッションをまたいで保持するピン留めノート。/note <text> で追加し、/note done <n> で削除 |
| coffee-widget | /coffee-widget [on\\|off\\|refill\\|<minutes>] | 90 分で空になるカップと休憩を促す通知 |
シーン
ターン、ツール呼び出し、チェック、コンテキスト使用量に反応するピクセルアート。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| pet-widget | /pet-widget [on\\|off\\|<mood>] | ピクセルのカニ Clawd。ターン中は働き、ツール呼び出しの失敗で目が回り、テスト成功で喜びます。セッションをまたいで XP を獲得してレベルアップし、badges-widget がバッジを付けると帽子をかぶります。2つのセッションを開くと、最後にプロンプトを送った方に残ります |
| aquarium-widget | /aquarium-widget [on\\|off\\|demo] | 実行中のツール呼び出しとエージェントごとに1匹の魚 |
| skyline-widget | /skyline-widget [on\\|off\\|demo\\|clear] | ターンごとに1棟、ツール呼び出しごとに1階 |
| train-widget | /train-widget [on\\|off] | このターンのツール呼び出しごとに1両を引く機関車。色はツール別 |
| garden-widget | /garden-widget [on\\|off\\|reset] | 植物。ツール呼び出しごとに葉が増え、チェック成功で花が咲き、失敗でしおれます |
| campfire-widget | /campfire-widget [on\\|off\\|stoke] | ツール呼び出しが増えるほど高く燃え、アイドル時には残り火になります |
| constellation-widget | /constellation-widget [on\\|off\\|clear] | ターンごとに星を1つ追加し、9個になると名前の付いた星座になります |
| fireworks-widget | /fireworks-widget [on\\|off\\|demo] | チェック成功で花火、失敗で不発を夜空に表示 |
| invaders-widget | /invaders-widget [on\\|off\\|demo\\|clear] | チェック失敗ごとに侵略者が現れ、成功すると撃ち落とします |
| weather-widget | /weather-widget [on\\|off\\|live\\|<percent>] | コンテキストに余裕があれば晴天、コンパクションが近づくと嵐 |
| boss-widget | /boss-widget [on\\|off] | コンテキスト使用量をボスの体力バーで表示。コンパクションで倒して次のレベルへ進みます |
| sky-widget | /sky-widget [on\\|off] | 現地時刻の空。昼は太陽、夜は月、セッションが長いほど星が増えます |
| world-widget | /world-widget [on\\|off\\|clear] | すべてを1つのシーンにまとめます。時計に合わせた空、コンテキストに合わせた天気、ターンごとの塔、ツール呼び出しの列車、歩き回るカニ |
| quest-widget | /quest-widget [on\\|off\\|reset] | セッションをダンジョンクロールにします。ターンごとに部屋、ツール呼び出しごとにモンスター、チェック成功で戦利品。ヒーローはセッションをまたいで保持されます |
| race-widget | /race-widget [on\\|off\\|clear] | 並列サブエージェントをコース上の車として表示し、ツール呼び出しごとに1歩進め、ゴールで表彰台に上げます |
ビジュアライザー
ツールの活動で動く抽象画。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| mosaic-widget | /mosaic-widget [on\\|off\\|clear] | ツール呼び出しごとに1タイル。ツールごとに色分けし、失敗は赤 |
| sorting-widget | /sorting-widget [on\\|off\\|step] | 並べ替え中の棒グラフ。ツール呼び出しごとに1回入れ替え |
| equalizer-widget | /equalizer-widget [on\\|off] | ツール呼び出しで跳ね、休止すると戻るレベルメーター |
| rain-widget | /rain-widget [on\\|off] | 落ちるコードの雨。ターンが忙しいほど速くなります |
| orbit-widget | /orbit-widget [on\\|off] | 小さな太陽系。ツール呼び出しの実行中は惑星が速く動きます |
| life-widget | /life-widget [on\\|off\\|reset] | Conway のライフゲーム。ツール呼び出しごとにグライダーを1機落とします |
| donut-widget | /donut-widget [on\\|off] | 回転する 3D ドーナツ。ツール呼び出し中は回転が速くなります |
| pipes-widget | /pipes-widget [on\\|off] | パイプのスクリーンセーバー。アイドル中に伸び、Claude が作業すると停止 |
| maze-widget | /maze-widget [on\\|off\\|new] | プロジェクトフォルダーを種にした一人称の迷路歩行 |
| marquee-widget | /marquee-widget [on\\|off\\|clear\\|<text>] | セッションイベントを流す LED ティッカー。ほかのテキストは自分の見出しとして投稿 |
ゲーム
Snake、2048、Tetris が、盤面をクリックしてキーを引き継ぐまで自動でプレイします。
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| snake-widget | /snake-widget [on\\|off] | Snake。キーを引き継ぐまで自動でプレイ |
| 2048-widget | /2048-widget [on\\|off] | 2048。キーを引き継ぐまで自動でプレイ |
| tetris-widget | /tetris-widget [on\\|off] | Tetris。キーを引き継ぐまで自動でプレイ |
| minesweeper-widget | /minesweeper-widget [on\\|off] | Minesweeper:クリックで開き、右クリックまたは f で旗を立て、r で再開 |
| breakout-widget | /breakout-widget [on\\|off\\|reset] | 自動で遊ぶブロック崩し。ツール呼び出しごとにブロックが1段増えます |
| typer-widget | /typer-widget [on\\|off] | タイピングゲーム。自分のファイル名の単語が落ち、着地前に入力します |
お楽しみ
| プラグイン | コマンド | 表示するもの |
| --- | --- | --- |
| fortune-widget | /fortune-widget [on\\|off\\|next] | ターンごとに変わる1行の運勢 |
| 8ball-widget | /8ball-widget [on\\|off]、/8ball <question> | /8ball <question> が信頼性の低い回答を返します |
| badges-widget | /badges-widget [on\\|off\\|reset] | セッションをまたいで得た実績と、解除時のトースト |
| sigil-widget | /sigil-widget [on\\|off\\|clear] | セッションの活動からピクセルの紋章を生成し、以前のセッションの紋章ギャラリーと並べて表示 |
| sound-widget | /sound-widget [on\\|off\\|mute\\|test] | ツール呼び出しごとの音、チェック成功時の和音、失敗時のブザー、ピアノロール(音声は macOS のみ) |
配置、オンになっている widget、表示モードは各セッションで保存・復元されます。
メモ
/widgets width pet 60は1枚の widget カードの最大幅を設定します(デフォルトは 40 列)。/widgets width pet resetで戻せます。/widgets sideはフルスクリーンレイアウト(/tui fullscreen)でのみカードを transcript の横に配置します。デフォルトレイアウトではプロンプトの下に戻ります。- ピクセルアートはターミナルのブロック文字で描画され、ターミナルにだけ表示されます。
- sound-widget は macOS でだけ音声を再生し、それ以外では無音のままピアノロールだけを描きます。
- board-widget は Claude が呼び出せる pin ツールを登録するため、ボードをオンにしている間はその説明がコンテキストの一部になります。
- watch-widget は sh -c でコマンドを実行し、失敗すると cmd /c にフォールバックします。
- ゲームの引き継ぎと Minesweeper のプレイには盤面のクリックが必要で、そのクリックはフルスクリーンレイアウトから報告されます。
開発
plugins/ 以下の各プラグインは mod です。マニフェスト、hooks モジュール、テストを含みます。
claude --plugin-dir plugins # load every plugin from this checkout
claude plugin validate plugins/<name> # check a manifest and hooks module
claude plugin test plugins/<name> # run its tests
プラグイン同士は import できないため、widgets はカードのスタックとピクセルレンダラーを $.widgets(plugins/widgets/hooks/kit.tsx)として共有し、すべての widget がこれを呼び出します。
ライセンス
MIT
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add oMaN-Rod/claude-code-widgets claude plugin install diff-widget
原文 / README
Claude Code Widgets
Small cards that sit under the Claude Code prompt, or docked beside the transcript in fullscreen. Each widget is its own mod, toggled with a slash command.
It started with a few useful ones (context, usage, file tree) and then got carried away: there are now 61 widgets, from git status and a turn timer to a pixel crab, a dungeon crawl and Tetris.
Install
Add the marketplace, then install the layout plugin and whichever widgets you want:
/plugin marketplace add oMaN-Rod/claude-code-widgets
/plugin install widgets@claude-code-widgets
/plugin install context-widget@claude-code-widgets
Every widget needs widgets, the layout plugin that places the cards.
Requires a Claude Code version with mod (function hook) support. The mod API is early access and may change between releases.
Widgets
Layout
Required by every widget.
| Plugin | Command | What it shows |
| --- | --- | --- |
| widgets | /widgets [side\|above\|below\|close\|<columns>\|width <widget> <columns\|reset>] | Places the cards: below the prompt, above it, or docked beside the transcript in fullscreen |
Session
What Claude is doing and what it is costing.
| Plugin | Command | What it shows |
| --- | --- | --- |
| context-widget | /context-widget [auto\|detailed\|grid\|top\|bar\|line] | The context window as a stacked bar, one colour per /context category |
| usage-widget | /usage-widget | A bar per rate-limit window, time to reset, session cost |
| timer-widget | /timer-widget [on\|off\|clear] | The running turn's elapsed time, plus last, average and longest turn and a sparkline |
| activity-widget | /activity-widget [on\|off\|clear] | The latest tool calls with their duration and whether they failed |
| tasks-widget | /tasks-widget [on\|off\|clear] | The task list Claude is working through, with a progress bar |
| checks-widget | /checks-widget [on\|off\|clear] | The latest test, lint and build runs: pass or fail, duration and how long ago |
| timeline-widget | /timeline-widget [on\|off] | The turn as a chart: one bar per tool call on a time axis, parallel calls stacked |
| board-widget | /board-widget [on\|off\|clear] | A status board Claude writes itself through a pin tool: goal, findings and open questions |
| forecast-widget | /forecast-widget [on\|off\|clear] | Context growth per turn as a chart, with the turns left before compaction |
| guard-widget | /guard-widget [on\|off\|clear] | Permission checks this session: allowed, asked and denied, with what you keep being asked about |
| stream-widget | /stream-widget [on\|off] | A live tokens-per-second gauge and sparkline while Claude is writing (estimated from text length) |
| sessions-widget | /sessions-widget [on\|off] | The other Claude Code sessions open on this machine: folder, branch, busy or idle |
Project and git
The state of the working tree.
| Plugin | Command | What it shows |
| --- | --- | --- |
| file-tree-widget | /file-tree-widget | The project directory; folders expand on click |
| git-widget | /git-widget | Branch, ahead/behind, staged, changed and untracked counts, and the last commit |
| changes-widget | /changes-widget [on\|off\|clear] | Files edited this session, most recent first, with an edit count each |
| commits-widget | /commits-widget | The commits made since the session started |
| todos-widget | /todos-widget | TODO, FIXME, HACK and XXX comments in tracked files, counted and listed |
| diff-widget | /diff-widget [on\|off\|clear] | The last edit as a syntax-highlighted diff |
| watch-widget | /watch-widget [on\|off\|run\|stop], /watch <command> | /watch bun test reruns the command after every edit: a pass or fail light and the last failing lines |
| map-widget | /map-widget [on\|off\|clear] | A pixel map of the tracked files, lit blue where Claude has read and green where it has edited |
Time and focus
Clocks, timers and reminders that do not depend on the session.
| Plugin | Command | What it shows |
| --- | --- | --- |
| pomodoro-widget | /pomodoro-widget [on\|off\|start\|break\|stop\|<minutes>] | A focus timer with a countdown, a progress bar and a count of finished sessions |
| countdown-widget | /countdown-widget [on\|off\|clear], /countdown <HH:MM\|<n>m\|<n>h> [label] | Time left to a deadline you set, with a progress bar and a toast when it arrives |
| clocks-widget | /clocks-widget [on\|off\|add <zone>\|remove <zone>\|clear] | Your local time beside the time zones you add, such as Asia/Tokyo |
| notes-widget | /notes-widget [on\|off\|clear], /note <text\|done <n>> | Pinned notes kept across sessions; /note <text> adds one, /note done <n> removes it |
| coffee-widget | /coffee-widget [on\|off\|refill\|<minutes>] | A cup that empties over 90 minutes and nudges you to take a break |
Scenes
Pixel art that reacts to turns, tool calls, checks and context usage.
| Plugin | Command | What it shows |
| --- | --- | --- |
| pet-widget | /pet-widget [on\|off\|<mood>] | Clawd, a pixel crab: works during a turn, dizzy when a tool call fails, happy when tests pass. Earns XP and levels up across sessions, wears a hat once badges-widget has awarded a badge, and with two sessions open stays in the one you last prompted |
| aquarium-widget | /aquarium-widget [on\|off\|demo] | A fish for every running tool call and agent |
| skyline-widget | /skyline-widget [on\|off\|demo\|clear] | One building per turn, one floor per tool call |
| train-widget | /train-widget [on\|off] | A locomotive pulling one wagon per tool call this turn, coloured by tool |
| garden-widget | /garden-widget [on\|off\|reset] | A plant: a leaf per tool call, a flower when checks pass, wilting when a call fails |
| campfire-widget | /campfire-widget [on\|off\|stoke] | A campfire that burns higher with tool calls and dies down to embers when idle |
| constellation-widget | /constellation-widget [on\|off\|clear] | A star per turn, joined into a constellation that gets a name after nine |
| fireworks-widget | /fireworks-widget [on\|off\|demo] | A night sky that sets off fireworks when checks pass, and a dud when they fail |
| invaders-widget | /invaders-widget [on\|off\|demo\|clear] | An invader arrives for every failing check; passing checks shoot them down |
| weather-widget | /weather-widget [on\|off\|live\|<percent>] | Clear sky when context has room, a storm near compaction |
| boss-widget | /boss-widget [on\|off] | Context usage as a boss health bar; compaction defeats it and starts the next level |
| sky-widget | /sky-widget [on\|off] | The sky at your local time: sun by day, moon by night, more stars the longer the session runs |
| world-widget | /world-widget [on\|off\|clear] | One scene for everything: sky by the clock, weather by context, a tower per turn, a train of tool calls and a wandering crab |
| quest-widget | /quest-widget [on\|off\|reset] | The session as a dungeon crawl: a room per turn, a monster per tool call, loot when checks pass; the hero is kept across sessions |
| race-widget | /race-widget [on\|off\|clear] | Parallel subagents as cars on a track, one stride per tool call, with a podium as they finish |
Visualizers
Abstract pictures driven by tool activity.
| Plugin | Command | What it shows |
| --- | --- | --- |
| mosaic-widget | /mosaic-widget [on\|off\|clear] | One tile per tool call, coloured by tool; failures are red |
| sorting-widget | /sorting-widget [on\|off\|step] | A bar chart being sorted, one swap per tool call |
| equalizer-widget | /equalizer-widget [on\|off] | Level meters that jump with each tool call and fall back to rest |
| rain-widget | /rain-widget [on\|off] | Falling code rain that speeds up the busier the turn gets |
| orbit-widget | /orbit-widget [on\|off] | A small solar system; the planets speed up while tool calls run |
| life-widget | /life-widget [on\|off\|reset] | Conway's Game of Life; every tool call drops a glider |
| donut-widget | /donut-widget [on\|off] | The spinning 3D donut; it spins faster while tool calls run |
| pipes-widget | /pipes-widget [on\|off] | The pipes screensaver; it grows while the session is idle and pauses while Claude works |
| maze-widget | /maze-widget [on\|off\|new] | A first-person walk through a maze seeded by the project folder |
| marquee-widget | /marquee-widget [on\|off\|clear\|<text>] | An LED ticker scrolling session events; any other text posts your own headline |
Games
Snake, 2048 and Tetris play themselves until you click the board and take the keys.
| Plugin | Command | What it shows |
| --- | --- | --- |
| snake-widget | /snake-widget [on\|off] | Snake; it plays itself until you take the keys |
| 2048-widget | /2048-widget [on\|off] | 2048; it plays itself until you take the keys |
| tetris-widget | /tetris-widget [on\|off] | Tetris; it plays itself until you take the keys |
| minesweeper-widget | /minesweeper-widget [on\|off] | Minesweeper: click to reveal, right-click or f to flag, r to restart |
| breakout-widget | /breakout-widget [on\|off\|reset] | A self-playing brick breaker; every tool call adds a row of bricks |
| typer-widget | /typer-widget [on\|off] | A typing game: words from your own file names fall, and you type them before they land |
Just for fun
| Plugin | Command | What it shows |
| --- | --- | --- |
| fortune-widget | /fortune-widget [on\|off\|next] | A one-line fortune that changes with every turn |
| 8ball-widget | /8ball-widget [on\|off], /8ball <question> | /8ball <question> gives an answer of doubtful reliability |
| badges-widget | /badges-widget [on\|off\|reset] | Achievements earned across sessions, with a toast when one unlocks |
| sigil-widget | /sigil-widget [on\|off\|clear] | A pixel emblem generated from this session's activity, beside a gallery of the ones from earlier sessions |
| sound-widget | /sound-widget [on\|off\|mute\|test] | A note per tool call, a chord when checks pass, a buzz on failure, with a piano roll (audio plays on macOS only) |
Placement, which widgets are on, and view modes are saved and restored in every session.
Notes
/widgets width pet 60sets how wide one widget's card may grow (the default is 40 columns);/widgets width pet resetputs it back./widgets sidedocks the cards beside the transcript only in the fullscreen layout (/tui fullscreen). In the default layout it falls back to below the prompt.- The pixel art is drawn with terminal block characters and shows in the terminal only.
sound-widgetplays audio on macOS only; elsewhere it stays silent and just draws the piano roll.board-widgetregisters apintool that Claude can call, so its description is part of the context while the board is on.watch-widgetruns your command throughsh -c, falling back tocmd /c.- Taking over a game, and playing Minesweeper at all, needs a mouse click on the board, which the fullscreen layout reports.
Develop
Each plugin under plugins/ is a mod: a manifest, a hooks module and its tests.
claude --plugin-dir plugins # load every plugin from this checkout
claude plugin validate plugins/<name> # check a manifest and hooks module
claude plugin test plugins/<name> # run its tests
Plugins cannot import from one another, so widgets shares card stacking and the pixel renderer as $.widgets (plugins/widgets/hooks/kit.tsx), which every widget calls.
License
MIT

