ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 AltamimiYasser

bar

Claude Code のプラグイン。プロンプトの上にステータスバー(コンテキスト、プラン上限、実行中のターンの時間とトークン)を表示し、各最終回答を枠で囲みます

AltamimiYasser@AltamimiYasser

AltamimiYasser/claude-code-bar/tree/main/plugins/bar

翻訳済み

この mod について

Claude Code の Bar

Claude Code にステータスバーを追加し、プロンプトの上に表示するプラグインです。各ターンのリアルタイムタイマーと、最終回答をそれまでの作業から区切る枠も表示します。Claude デスクトップアプリの Code タブとターミナルで動作します。

表示内容

プロンプトの上にあるバー

2 行のパネルです。1 行目は容量、つまりどれだけ埋まっているか。2 行目は現在の状態で、ターン、ツール、プロンプトキャッシュ、Hand off を示します。各ゲージは同じ描画で、細いトラック、末端に向かって明るくなる塗り、現在位置を示すビーズ(中央が白い点)で構成されます。項目にカーソルを合わせると、完全な詳細がもう一方の行に重ねて表示されます。

1 行目:容量

  • Context ━━━━●───┊──┊── 216k / 1.0M 22%:このチャットのコンテキストウィンドウがどれだけ埋まっているか。太字の数字は会話中のトークン数、/ 400k は上限です(指定していれば自動コンパクトのウィンドウ、なければモデルのウィンドウ、または /bar-limit で指定したもの)。最後に割合が続きます。トラック上の薄い目盛りは次の色が始まる位置を示し、これから先のものだけ描画されます。Context をクリックすると /usage を実行します。
  • 5h と Week ━━●─┃── 30% 07:20:プランの 5 時間ウィンドウと週次上限。太字の割合は使用済みの量、暗い時間または曜日はリセット時刻です。線上の縦線は現在で、ウィンドウのどこまで時間が進んだかを示します。ビーズが線の左なら時計よりゆっくり使っていて問題ありません。右ならペースが先行しており、リセット前に使い切る可能性があります。カーソルを合わせると、正確なリセット日と、このペースでどこに到達するかが表示されます。

2 行目:現在の状態

  • ビート:毎秒 1 回、オレンジ色のビーズをリングが膨らみながら囲むと Claude が作業中です。ビートはタイマーと同期します。中空の灰色リングはアイドル状態で、その行には直前のターンが表示されます。
  • Working 1m 04s(オレンジ)または Last turn 16s:ターンの実行時間、または実行にかかった時間。
  • スパークライン(作業中):直近 24 秒間の 1 秒あたりの出力トークン数で、ビーズが現在を示します。高ければ Claude が速く書いており、平らなら考えているかツールを待っています。
  • 数値:out は Claude が書き出したトークン数(+ はまだストリーミング中の内容があることを示します)、read はプロンプトキャッシュから提供されたトークン数、write は新たにキャッシュへ書き込まれたトークン数です。ターンにカーソルを合わせると、キャッシュ外の入力 in とツール呼び出しを含む 4 項目すべてを確認できます。
  • 3 tools ›:このターンで Claude が呼び出したツール数。クリックするとすべての呼び出しを一覧表示するパネルが開き、各項目から入力と出力を確認できます。
  • Cache 59:27:Claude の直前の応答から、会話がプロンプトキャッシュに残る時間。セッションに応じて 1 時間または 5 分からカウントダウンします。期限が切れると、次のメッセージで会話全体をキャッシュへ書き直す必要があります。カーソルを合わせると、正確な期限と、その時に必要なトークン数が表示されます。
  • Hand off →(または /bar-handoff):/mattpocock-skills:handoff を実行して引き継ぎドキュメントを書き、同じフォルダーでそこから続ける新しい Code セッションを開きます。現在のチャットはそのままで、消去もコンパクトもされません。ボタンはほとんどの時間はアウトライン表示で、キャッシュがなくなりそうなとき(オレンジまたは赤)だけ塗りつぶしになります。押す価値があるタイミングを示します。実行中は Writing…、Opening…、Opened ✓ の順に表示されます(失敗時は Failed となり、カーソルを合わせると理由が分かります)。デスクトップアプリは新しいセッションのフォルダーを信頼するよう求めます。そのセッションで Bar が動いていれば続行プロンプトを自動送信し、そうでなければメッセージボックスで待機します。mattpocock-skills プラグインが必要です。

色

| 色 | メーターまたはカウントダウンでの意味 | | --- | --- | | 緑 | 使用量が半分未満 | | 黄 | 半分から(levels.yellow、50%) | | オレンジ | 4 分の 3 から(levels.orange、75%) | | 赤 | 上限以上(levels.red、100%)。キャッシュの期限切れも含む |

ターン中のオレンジ色(ビート、タイマー、スパークライン)は Claude 固有の色で、作業中であることだけを示します。太字の数字は読む値、暗い文字はラベルまたは単位です。

ターミナルでは同じパネルを文字で描きます。━ は使用済み、─ はトラック、┃ は現在位置、● は作業中、○ はアイドル、│ は項目間の区切りです。Hand off は [ Hand off → ] と表示されます。

アプリはプロンプトの上にリポジトリ、ブランチ、未コミットの変更、実行中のタスクをすでに表示しているため、Bar では省略します。

各ターン

  • 最終回答をオレンジ色の枠で囲みます。枠の下にはターンにかかった時間と、入力、出力、キャッシュ読み取り、キャッシュ書き込みのトークン数が表示されます。

プロンプトのフッターにある Remote Control

メッセージボックスの下、フッター右側に ○ Remote トグルがあります。クリックするか /remote を実行するとプロジェクトフォルダーの Remote Control が始まり、もう一度実行すると停止します。マークは状態を示します。

  • ○ Remote:オフ
  • 🟡 Remote…:起動中
  • 🟢 Remote:接続済み
  • 🔴 Remote:プロセス停止(理由は Remote sessions に表示)

隣の Sessions では、Remote Control を使用したことのあるすべてのフォルダーを一覧できます。実行中のものが先に並び、それぞれにフォルダーと実行時間が表示されます(停止したものには停止時刻と実行時間が表示されます)。実行中の行には Stop、停止後の行には Start と Remove があります。Stop all は実行中のものをすべて終了します。自分で claude remote-control を使って起動した Remote Control プロセスも「started outside Bar」として表示され、停止できます。

別の外插件がフッターに追加したもの(独自のボタンなど)はそのまま残り、Sessions の前に表示されます。

フォルダーごとに Remote Control は 1 つだけで、その中の全セッションが共有します。起動したセッションが終了しても動き続け、後から同じフォルダーで開いたセッションから確認して停止できます。プロセス ID とログは ~/.claude/bar/remote/ に保存されます。

インストール

Claude Code で:

/plugin marketplace add AltamimiYasser/claude-code-bar
/plugin install bar@claude-code-bar

またはシェルから:

claude plugin marketplace add AltamimiYasser/claude-code-bar
claude plugin install bar@claude-code-bar

その後、新しいセッションを開始します。

**要件:**Bar は function hooks で構成された mod(プラグイン)で、function hooks は Early Access です。バーが表示されない場合は、環境で CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 を設定するか、~/.claude/settings.json の env ブロックに設定してください。

コマンド

| コマンド | 動作 | | --- | --- | | /bar-limit 300k | コンテキストメーターが満杯になって赤くなる位置を設定します。300k、1.5m、250000 を受け付け、モデル自身のウィンドウを上限とします。/bar-limit model はモデルの全ウィンドウ、/bar-limit off はデフォルトの自動コンパクトウィンドウに戻し、単独の /bar-limit は現在値を表示します。 | | /remote | フッターのトグルと同じように、このフォルダーの Remote Control をオンまたはオフにします。/remote list は Remote sessions、/remote stop-all は実行中のものをすべて停止します。 | | /bar-handoff | Hand off ボタンと同じように引き継ぎを書き、新しいセッションで続けます。 | | /bar-demo | サンプルのバー(プラン上限なし、軽い使用、満杯に近い状態、上限超過)を順に表示し、ライブバーに戻ります。 |

設定

Bar が表示するものはすべて ~/.claude/bar/settings.jsonc でオフにできます。Bar は初回起動時にファイルを書き、全オプションをデフォルトにして説明コメントを付けます。変更は再起動なしで数秒以内に反映されます。値が不正ならデフォルトに戻り、解析できないファイルの場合は最後に有効だった設定を保持して通知を表示します。

| オプション | デフォルト | 制御内容 | | --- | --- | --- | | bar.enabled | true | プロンプトの上にあるバー全体 | | bar.hover | true | 詳細や下線を含むすべてのホバー効果 | | bar.pillBorders | true | バーのパネルを囲む薄い輪郭(デスクトップ) | | context.enabled | true | Context メーター | | context.limit | "autoCompact" | メーターが満杯になる位置。"autoCompact" は自動コンパクトウィンドウ(Claude Code の設定の autoCompactWindow。未設定ならモデルのウィンドウ)、"model" はモデル自身のウィンドウ、またはトークン数です。古いファイルの null は "autoCompact" として読み取ります。 | | context.click | "usage" | 「Context」をクリックしたときの動作。"usage" は /usage を実行し、"none" は何もしません | | planLimits.fiveHour / weekly | true | 5h と Week のメーター | | planLimits.resetTime | true | 各割合の後に表示するリセット時刻 | | planLimits.hoverDetails | true | 5h または Week にカーソルを合わせたときの正確なリセット日 | | planLimits.pace | true | 5h と Week のメーターにある「現在」マークと、詳細のペース推定 | | turn.enabled | true | 2 行目のターン(キャッシュと Hand off は残ります) | | turn.whileWorking / lastTurn | true | ライブターン(ビート、時間、スパークライン)とターン間に表示する直前のターン | | turn.tokens | true | 2 行目のトークン数 | | turn.toolCalls / toolCallsPanel | true | ツール呼び出し数と、そこから開くパネル | | answer.frame / footer / footerTokens | true | 回答の枠、その下の行、トークン数 | | spinnerTimer | true | アプリの作業インジケーター横の実時間 | | cache.enabled | true | Cache のカウントダウン | | cache.handoff | true | Cache の横の Hand off ボタン(/bar-handoff は設定に関係なく動作) | | remote.enabled | true | Remote Control トグルと /remote | | remote.autoStart | "newProjects" | Remote Control の自動開始。"never"、"newProjects"(プロジェクトの最初のセッション)、"always" | | remote.notifications | true | オン/オフ通知 | | remote.sessionsButton | true | フッターの Remote sessions ボタン | | levels.yellow / orange / red | 0.5 / 0.75 / 1.0 | 色が変わる上限の割合 |

開発

プラグインは plugins/bar にあります。次で確認できます。

claude plugin validate plugins/bar

型チェックでは、plugins/bar で Claude Code を開き、/plugin-types を実行します(API 宣言が .claude/types に書き込まれます)。続けて次を実行します。

npx -p typescript tsc -p plugins/bar

テストを実行します(プラグインテストキットでは function hooks を有効にする必要があります)。

CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude plugin test plugins/bar

インストール済みのものではなく作業コピーを読み込むには:

claude --plugin-dir plugins/bar

ライセンス

MIT

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add AltamimiYasser/claude-code-bar
claude plugin install bar
原文 / README

Bar for Claude Code

A Claude Code mod that adds a status bar above the prompt, a live timer on every turn, and a frame that sets each final answer apart from the work before it. It works in the Claude desktop app's Code tab and in the terminal.

What it shows

The bar, above the prompt

One panel with two rows. Row 1 is capacity: how full things are. Row 2 is right now: the turn, its tools, the prompt cache and Hand off. Every gauge is the same drawing: a thin track, a fill that brightens toward its end, and a bead (a dot with a white centre) marking where you are. Hover any item and its full detail appears laid over the other row.

Row 1: capacity

  • Context ━━━━●───┊──┊── 216k / 1.0M 22%: how full this chat's context window is. The bold number is the tokens in the conversation, / 400k is the limit (your auto-compact window when you've set one, else the model's window, or your own from /bar-limit), then the share. The faint ticks on the track mark where the next colours start; only the ones still ahead are drawn. Click Context to run /usage.
  • 5h and Week ━━●─┃── 30% 07:20: your plan's 5-hour window and weekly limit. The bold percentage is how much you've used; the dim time or day is when it resets. The upright mark on the line is now: how much of the window has passed. Bead left of the mark: you're using it slower than the clock, fine. Bead right of the mark: you're ahead of pace and may run out before it resets. Hover for the exact reset date and where you'll land at this pace.

Row 2: right now

  • The beat: an orange bead with a ring swelling once a second means Claude is working; the beat keeps time with the timer. A hollow grey ring means idle, and the row shows the last turn.
  • Working 1m 04s (orange) or Last turn 16s: how long the turn has run, or took.
  • The sparkline (while working): output tokens per second over the last 24 seconds, the bead being now. High means Claude is writing fast; flat means it's thinking, or waiting on a tool.
  • The figures: out is the tokens Claude wrote (a + means more are still streaming in), read the tokens served from the prompt cache, write the tokens newly written to it. Hover the turn for all four, with in (input outside the cache) and the tool calls.
  • 3 tools ›: how many tools Claude called this turn. Click it for a panel listing every call, each opening to its input and output.
  • Cache 59:27: how long the conversation stays in the prompt cache, counted down from Claude's last response (1 hour or 5 minutes, whichever the session uses). Once it expires, the next message has to write the whole conversation to the cache again. Hover for the exact expiry time and how many tokens that would be.
  • Hand off → (or /bar-handoff): runs /mattpocock-skills:handoff to write a handoff document, then opens a new Code session in the same folder that continues from it. The current chat stays exactly as it is: it is never cleared or compacted. The button is outlined most of the time and turns solid once the cache is running out (orange or red), the moment it's worth pressing. While it works it reads Writing…, Opening…, then Opened ✓ (or Failed, with the reason on hover). The desktop app asks you to trust the folder for the new session. When that session runs Bar, it sends the continue prompt by itself; otherwise the prompt is waiting in its message box. Requires the mattpocock-skills plugin.

The colours

| Colour | On a meter or a countdown | | --- | --- | | Green | under half used | | Yellow | from half (levels.yellow, 50%) | | Orange | from three quarters (levels.orange, 75%) | | Red | at or past the limit (levels.red, 100%); the cache has expired |

Orange in the turn (the beat, the timer, the sparkline) is Claude's own colour: it only means Claude is working. A bold number is the value to read; dim text is a label or a unit.

In the terminal the same panel is drawn in characters: ━ used, ─ the track, ┃ the now mark, ● working, ○ idle, │ between items, and Hand off as [ Hand off → ].

The app already shows the repo, branch, uncommitted changes and running tasks above the prompt, so Bar leaves those out.

Every turn

  • The final answer in an orange frame. Under the frame: how long the turn took, plus its input, output, cache-read and cache-write tokens.

Remote Control, in the prompt footer

A ○ Remote toggle sits at the right of the footer under the message box. Click it, or run /remote, to start Remote Control for the project folder, and again to stop it. Its mark shows the state:

  • ○ Remote: off
  • 🟡 Remote…: starting
  • 🟢 Remote: connected
  • 🔴 Remote: the process stopped (the reason is in Remote sessions)

Beside it, Sessions opens a list of every folder that has had a Remote Control, running ones first, each with its folder and how long it has run (a stopped one shows when it stopped and how long it ran). Each row offers Stop while running, and Start and Remove once stopped. Stop all ends every running one. Remote Control processes you started yourself with claude remote-control show up too, marked "started outside Bar", and can be stopped.

Anything another mod adds to the footer (a button of its own, say) stays there, before Sessions.

There's one Remote Control per folder, shared by every session in it. It keeps running after the session that started it ends, and any session opened in that folder later shows it and can turn it off. Its process ID and log are kept in ~/.claude/bar/remote/.

Install

In Claude Code:

/plugin marketplace add AltamimiYasser/claude-code-bar
/plugin install bar@claude-code-bar

Or from a shell:

claude plugin marketplace add AltamimiYasser/claude-code-bar
claude plugin install bar@claude-code-bar

Start a new session afterwards.

Requirement: Bar is a mod, a plugin made of function hooks, and function hooks are in early access. If the bar doesn't appear, set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 in your environment, or in the env block of ~/.claude/settings.json.

Commands

| Command | What it does | | --- | --- | | /bar-limit 300k | Sets where the context meter is full and turns red. It accepts 300k, 1.5m or 250000, and is capped at the model's own window. /bar-limit model uses the model's whole window; /bar-limit off goes back to the default, your auto-compact window; /bar-limit on its own shows the current value. | | /remote | Turns Remote Control on or off for this folder, like the footer toggle. /remote list opens Remote sessions; /remote stop-all stops every running one. | | /bar-handoff | Writes a handoff and continues in a new session, like the Hand off button. | | /bar-demo | Steps through sample bars (no plan limits, light use, getting full, past the limit), then back to your live bar. |

Settings

Everything Bar shows can be turned off, in ~/.claude/bar/settings.jsonc. Bar writes the file the first time it runs, with every option set to its default and a comment explaining it. Changes apply within a few seconds, with no restart. A wrong value falls back to its default, and a file that doesn't parse keeps the last good settings and shows a notice.

| Option | Default | What it controls | | --- | --- | --- | | bar.enabled | true | The whole bar above the prompt | | bar.hover | true | Every hover effect: the details, the underlines | | bar.pillBorders | true | The faint outline around the bar's panel (desktop) | | context.enabled | true | The Context meter | | context.limit | "autoCompact" | Where the meter is full: "autoCompact" for your auto-compact window (autoCompactWindow in Claude Code's settings; the model's window when none is set), "model" for the model's own window, or a token count. An older file's null reads as "autoCompact" | | context.click | "usage" | Clicking "Context": "usage" runs /usage, "none" does nothing | | planLimits.fiveHour / weekly | true | The 5h and Week meters | | planLimits.resetTime | true | The reset time after each percentage | | planLimits.hoverDetails | true | The exact reset date while hovering 5h or Week | | planLimits.pace | true | The "now" mark on the 5h and Week meters, and the pace estimate in their details | | turn.enabled | true | The turn on row 2 (the cache and Hand off stay) | | turn.whileWorking / lastTurn | true | The live turn (beat, time, sparkline), and the last turn between turns | | turn.tokens | true | The token figures on row 2 | | turn.toolCalls / toolCallsPanel | true | The tool-call count, and the panel it opens | | answer.frame / footer / footerTokens | true | The answer frame, the line under it, and its token figures | | spinnerTimer | true | The live time beside the app's working indicator | | cache.enabled | true | The Cache countdown | | cache.handoff | true | The Hand off button beside it (/bar-handoff works either way) | | remote.enabled | true | The Remote Control toggle and /remote | | remote.autoStart | "newProjects" | Start Remote Control by itself: "never", "newProjects" (a project's first session) or "always" | | remote.notifications | true | The on/off notices | | remote.sessionsButton | true | The Remote sessions button in the footer | | levels.yellow / orange / red | 0.5 / 0.75 / 1.0 | The share of a limit where colors change |

Development

The plugin lives in plugins/bar. Check it with:

claude plugin validate plugins/bar

For type checking, open Claude Code in plugins/bar, run /plugin-types (it writes the API declarations to .claude/types), then run:

npx -p typescript tsc -p plugins/bar

Run the tests (the plugin test kit needs function hooks switched on):

CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude plugin test plugins/bar

To load your working copy instead of the installed one:

claude --plugin-dir plugins/bar

License

MIT

関連作品