AsyrafHussin/claude-code-statusline/tree/main/mod/statusline-band
statusline-band
レート制限と消化ペース、コンテキスト、コストとトークン、Git の状態とスイッチ、アクション、Clawd と Beatbot 付きの Spotify カードを表示するプロンプト上部のパネル
この mod について
statusline-band
Claude Code のプロンプト上部に表示されるパネルです。Claude Code のマスコット Clawd が横に立ち、その下には Spotify のマスコット Beatbot 付きの Spotify カードがあります。
- 上段: リポジトリ名、ブランチ、effort 付きのモデル、Claude のプラン(Max 5x、Pro...)。右側にはセッションのコストとトークン、続いて今日と直近 30 日の値を表示します。
- 中央: 5 時間と 7 日のレート制限を、埋まっていくリングで表示します。リセットまでのカウントダウンとローカルのリセット時刻も表示します。現在のペースだとリセット前に制限を使い切る場合は
▲ out ~7hが現れます。その下にコンテキスト使用量のバーがあります。 - 下段: 実行中のサブエージェント、未コミットのファイルと行数、未プッシュのコミットとその行数、遅れているコミット、stash、最後のコミットからの経過時間。右側には直前の返信の入力トークン(キャッシュの割合付き)と出力トークン、セッションの長さと時刻を表示します。
- Clawd: Claude が作業中は走ります。それ以外は、レート制限が 95% 以上になると汗をかき、静かな状態が 10 分続くと眠り、コミットのプッシュが終わると喜びます。
- アクション: カードの下の行から、入力したかのようにプロンプトを送れます:
push(コミットしてプッシュ)、find bugs、run tests、summarize。quick commitは差分から Haiku にコミットメッセージを書かせ、コミット、コミットしてプッシュ、または自分で入力する選択肢を表示します。その後、メインモデルのターンを使わずに自動でコミットします。ボタンをクリックするか、ctrl+x tab でバンドにフォーカスを移し、ボタンへ移動して Enter を押します。 - Git スイッチ: リポジトリごとに
commit auto · push askを保持します。askでは Claude のgit add、commit、pushが確認を待ちます。autoでは Claude が自分で行い、変更が終わるたびにコミットして直後にプッシュします。プロンプトなしで実行されるのは-Cでリポジトリを指定する単純な形だけです:git -C '/abs/path' add <files>、git -C '/abs/path' commit -m '…'、git -C '/abs/path' push [remote] [branch]を&&でつなぎます。それ以外はスイッチの設定どおり確認します。-Cなしのステップ(Bash ツールは呼び出し間で自分のフォルダーを保持します)、force push、heredoc、$(…)、cd、パイプ、envやxargsのようなラッパー、コミットやプッシュを行うエイリアスなどが該当します。plan mode では何も許可されません。読み取りだけのステップ(status、log、diff、showと、出力の形だけを変えるフラグ)は同時に実行できます。確認が必要な場合は、ダイアログの下に何を伴うかを表示します。システムプロンプトは単純な形と各スイッチの状態を Claude に伝えます。commitまたはpushをクリックすると切り替わります。 - Spotify(macOS): Git スイッチの横にある
spotifyをクリックするまでオフです(spotify off、次にon。セッションをまたいで保持)。オフの間は Spotify に何も問い合わせません。オンで Spotify が動作していると、バンドの下に Spotify green で縁取られたカードが表示され、状態とトラック、◀◀ ❚❚ ▶▶、時刻付きの進行、シャッフル、リピート、音量 − +、直前に聴いたトラック(セッションをまたいで保持)を表示します。lyrics on(spotifyの横、初期状態でオン)にすると、曲に合わせて歌っている行を明るく、次の行を暗く表示します。歌詞は LRCLIB(lrclib.net)から取得し、同期歌詞のないトラックは何も表示しません。search(または/spotify-search)では Spotify を検索して選んだトラックを再生するペインを開き、spotifyClientIdとクライアントシークレットが設定されていればターミナルを前面に保ちます。ピクセルで描かれた小さな Spotify マスコット Beatbot は再生中 Clawd の下で踊り、曲を 10 分間一時停止すると Z を付けて眠ります。AppleScript 経由で 5 秒ごとに Spotify に問い合わせますが、Spotify を起動することはありません。再生中のプレイリストは表示されません。Spotify はログインが必要な Web API でしかプレイリストを提供しないためです。 - 最小化: どちらかのカードの下端にある
minimizeは、バンドの左端から 1 行に縮めます。メインカードにはリポジトリとブランチ、モデル、パーセント表示の制限とコンテキスト、最初の Git 情報、セッションコストを残します。Spotify カードにはコントロール、トラック、時刻を残します。expandで元に戻ります。各カードは選択をセッション間で記憶します。 - その他: レート制限にカーソルを合わせるとペースを確認できます。
30dをクリックするか/usage-historyを実行すると、日ごとのコストとトークンを表示するペインが開きます。制限が 80% と 95% を超えたとき、また現在のペースでリセット前に使い切るときにトーストが表示されます。
Claude Code v2.1.287 以降が必要です。
インストール
/plugin marketplace add AsyrafHussin/claude-code-statusline
/plugin install statusline-band@claude-code-statusline
設定
各項目は /config の行として表示されます。または /plugin configure statusline-band@claude-code-statusline を実行します。
| 設定 | デフォルト | 内容 |
|---------|---------|--------------|
| initials | empty | Clawd のシャツに表示する最大 2 文字 |
| cardColor | #0a0a0a | バンドの背景。空("")なら設定せず、ターミナル自身の背景を使います |
| padRows | 1 | 統計の上下に置く空行。0 から 2 |
| historyDays | 30 | ローリングコストと履歴ペインが対象にする日数。7 から 62 |
| noAttribution | false | コミットとプルリクエストから Co-Authored-By、Claude-Session、Claude Code のフッターを除外 |
| gitStrict | true | オン:Git スイッチが auto のとき、-C でリポジトリを指定する単純なコマンドだけを確認なしで実行。オフ:リポジトリのスイッチが auto のとき、すべての Git コマンドを確認なしで実行 |
| spotify | true | Spotify の実行中に、Beatbot のダンス、進行バー、コントロールとともに再生内容をバンドの下に表示(macOS) |
| plan | empty | 表示されている Claude のプラン(例:Max 20x)。空なら Claude Code 自身の ~/.claude.json から読み込みます(Claude Code の起動時またはサインイン時に更新) |
| spotifyClientId | empty | Spotify の検索に使う、developer.spotify.com/dashboard にある自分のアプリの Client ID |
| spotifyClientSecret | empty | そのアプリの Client secret。/config では secret の設定を表示しないため、macOS Keychain に保存します:security add-generic-password -U -s statusline-band-spotify -a client-secret -w(secret は非表示で入力します) |
実行・読み取り・保持・送信する内容
実行するプログラム
これらのプログラムを shell 経由では使わずに実行します。引数はフォルダー以外(各 git コマンドはリポジトリのフォルダー、つまり git -C <folder> で実行)、承認した quick commit のメッセージ、検索したトラックの Spotify URI(spotify:track: で始まり、英数字だけであることを確認済み)については固定です。
-
ブランチと変更を表示する読み取り専用の
git(各リポジトリのフォルダーでgit -C <folder>)。実行内容:rev-parse --show-toplevelでリポジトリのルートを取得。フォルダーごとに 1 回status --porcelain=v2 --branch --show-stashでブランチ、upstream、ahead/behind のコミット、未コミットのファイル、stash を取得diff --shortstat HEADとdiff --shortstat @{upstream}...HEADで未コミットと未プッシュの行数を取得log -1 --format=%ctで最後のコミット時刻を取得
これは 30 秒ごとと、各ツール呼び出しの後に実行されます。
-
Claude の Git ステップが確認を求めたときの
git: 同じ読み取り専用コマンドと、Git エイリアスが何を意味するか調べるconfig --get alias.<name>を、ダイアログの下に表示します。 -
quick commit を押したときの
git:status --porcelain、diff HEAD、log -5 --format=%sでメッセージを書きます。承認後にadd -A、commit -q -m <message>、選択した場合はpushを実行します。これらが内容を変更する唯一の Git コマンドです。 -
Spotify 用の
osascript:spotifyスイッチがオンで Spotify が動いている間だけ 5 秒ごとにトラックを読み取り、操作ボタンを押したときは再生、停止、スキップ、シャッフル、リピート、音量を処理し、検索したトラックを選ぶと再生して元のアプリを前面に戻します。 -
検索用の
security find-generic-password -s statusline-band-spotify -w: 検索を開くか使い、設定が空の場合に macOS Keychain から Spotify のクライアントシークレットを読み取ります。見つかった値は mod が再読み込みされるまで保持します。 -
ローカル日時を読む
date(+%Y-%m-%dと+%Y-%m-%d|%I:%M %p|%H|%M|%S)。タイムゾーンでレート制限のリセット時刻も整形します(date -r <epoch>)。
読み取る内容
- セッションから: Claude Code が報告する使用量(コスト、コンテキスト、レート制限とリセット時刻)、モデル名、セッション ID、作業フォルダー、実行中のサブエージェント、各ターン終了時のトークン数。
- Claude Code 自身の
~/.claude.jsonから: アカウントのプラン種別とレート制限の階層だけをロードごとに読み取り、プランの表示に使います。 - 実行中の Spotify から: 再生中のトラック名、アーティスト、アルバム、長さ、位置、ID、シャッフル、リピート、音量の設定。
- macOS Keychain から: 検索時だけ
statusline-band-spotifyという項目と Spotify のクライアントシークレットを読み取ります。 - 決して読み取らないもの: プロンプトのテキストや Claude の返信。ツール呼び出しからは、スイッチの対象になる Git ステップを見つけるために Bash コマンドだけを読み取ります。
保持する内容
すべてはプラグイン独自のマシン上のストアに保存され、それ以外には保存されません:
- リポジトリのルートごとの Git スイッチ
- 最後に聴いた Spotify トラック 3 件
spotifyとlyricsスイッチのオン・オフ- 各カードを最小化したかどうか
- 直近 62 日分の日ごとのコストとトークン
- 直近 100 セッションの各セッションの最後の読み取り
- 最近のペースに使う、直近 3 時間のレート制限の読み取り値
- すでに表示したトースト
送信する内容
- アクションを押したときだけ Claude に送るプロンプト。 それぞれは Actions に記載した固定テキストで、入力したかのようにこのセッションへ送られます。プッシュも自分の権限ルールを通ります。
- quick commit を押したときだけ Haiku に送る差分。 最大 24k 文字の差分、新規ファイル名、直近 5 件のコミット題名を、Claude Code 自身のモデル呼び出しで小さいモデルへ送り、Claude Code 自身がモデルと話すのと同じ方法でメッセージを書かせます。
- quick commit で「Commit and push」を選んだときだけ行うプッシュ。 既存の Git 認証情報で、ブランチの upstream に
git push自体を実行します。 - 検索したときだけ行う Spotify 検索。 自分のアプリの Client ID と secret を使い、accounts.spotify.com にアプリトークンを、api.spotify.com に入力に一致する最大 10 件のトラックを要求します。選んだトラックは AppleScript 経由で Spotify アプリで再生します。
spotifyとlyricsがオンの間に LRCLIB へ送る再生トラック。 新しいトラックごとに 1 回、名前、アーティスト、アルバム、長さを lrclib.net に送り、同期歌詞を取得します。アカウントやキーは不要です。lyricsをオフにすると何も送られません。- それ以外は何も送信しません。 Git から fetch せず、他のネットワーク呼び出しも行わず、テレメトリーもなく、他のサービスへも送りません。遅れているコミットは、最後に自分で fetch または pull した時点のリモートを基準に数えます。
フック
tool.call: 呼び出し後に時刻だけ記録してパネルを更新します。すべての呼び出しを変更せずに通し、ブロックも書き換えもしません。prompt.submit: Clawd の走るアニメーションを開始します。プロンプトはそのまま通過します。turn.complete: アニメーションを止め、ターンのトークン数を合計に加えます。session.start: パネルのタイマーを開始し、/usage-historyを登録します。spotifyがオンなら/spotify-searchも登録します。command.run: 自分の/usage-historyと/spotify-searchだけに答え、対応するペインを開きます。attribution.text:noAttributionがオンなら、空のコミットトレーラーと PR フッターを返します。prompt.compose: Git の単純な形、各スイッチの状態、noAttributionがオンならクレジット行を付けないことをシステムプロンプトに 1 セクション追加します。- アクションボタン: 押すと固定プロンプトで
$.prompt.submitを呼びます。押さない限り何も送信しません。quick commitは代わりに差分(最大 24k 文字)と直近 5 件のコミット題名を Claude Code 自身のモデル呼び出しで Haiku に送り、その後git add -A、git commit -m、選んだ場合はgit pushを自分で実行します。 classic.UserPromptSubmit、classic.PostToolUse: 権限モードと effort を読み取るだけで、何も変更しません。- **
classic.PreToolUse
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add AsyrafHussin/claude-code-statusline claude plugin install statusline-band
原文 / README
statusline-band
A panel above the Claude Code prompt, with Clawd, the Claude Code mascot, standing beside it, and a Spotify card under it with Beatbot, a Spotify mascot.
- Top edge: the repo name, branch, and the model with its effort and your Claude plan (Max 5x, Pro...). On the right: the session's cost and tokens, then today's and the last 30 days'.
- Middle: the 5-hour and 7-day rate limits as filling rings, with the reset countdown and the local reset time.
▲ out ~7happears when the pace would use a limit up before it resets. Then context usage as a bar. - Bottom edge: running subagents, uncommitted files and lines, unpushed commits and their lines, commits behind, stashes and the time since the last commit. On the right: the last reply's input (with its cached share) and output tokens, the session length and the time.
- Clawd: runs while Claude works. Otherwise it sweats while a rate limit is at 95% or more, falls asleep after 10 quiet minutes, and cheers when your commits are pushed.
- Actions: a row under the card sends a prompt as if you typed it:
push(commit and push),find bugs,run testsandsummarize.quick commithas Haiku write a message from the diff and shows it: commit, commit and push, or type your own; it then commits itself, without a turn of the main model. Click one, or focus the band with ctrl+x tab, move to it and press Enter. - Git switches:
commit auto · push ask, kept per repo. Onask, Claude'sgit addorcommit, orpush, waits for your OK. OnautoClaude also does it on its own: it commits each finished change, and pushes right after. It runs without a prompt, but only in its plain form, naming its repo with-C:git -C '/abs/path' add <files>,git -C '/abs/path' commit -m '…'andgit -C '/abs/path' push [remote] [branch], joined by&&. Any other shape asks whatever the switch says: a step without-C(the Bash tool keeps its own folder between calls), a force push, a heredoc,$(…), acd, a pipe, a wrapper such asenvorxargs, or an alias that commits or pushes. Nothing is allowed in plan mode. Steps that only read (status,log,diff,show, with flags that only shape their output) may ride along. When a step asks, a line under the dialog says what it takes with it. The system prompt tells Claude the plain form and where each switch stands. Clickcommitorpushto flip it. - Spotify (macOS): off until you click
spotifybeside the git switches (spotify off, thenon, kept across sessions). While it is off, nothing asks Spotify anything. When it is on and Spotify runs, a card framed in Spotify green under the band shows the state and the track, ◀◀ ❚❚ ▶▶, progress with the time, shuffle, repeat and volume − +, and the track heard before it (kept across sessions). Withlyrics on(besidespotify, on by default), the card also shows the line being sung, bright, and the next one dim, in time with the song; they come from LRCLIB (lrclib.net), and a track it has no synced lyrics for shows none.search(or/spotify-search) opens a pane that searches Spotify and plays the track you pick, keeping the terminal in front, oncespotifyClientIdand the client secret are set. Beatbot, a little Spotify mascot drawn in pixels, dances under Clawd while a track plays, and falls asleep with Z's once a track has been paused 10 minutes. It asks Spotify through AppleScript every 5 seconds and never launches it. The playing playlist is not shown: Spotify gives it only through its Web API, which needs a sign-in. - Minimize:
minimizeon the bottom edge of either card shrinks it to one line from the band's left edge. The main card keeps the repo and branch, model, limits and context as percents, the first git fact and the session cost; the Spotify card keeps the controls, the track and the time.expandbrings it back. Each card remembers its choice across sessions. - Extras: hover a rate limit for its pace. Click
30d, or run/usage-history, for a pane with each day's cost and tokens. Toasts fire when a limit passes 80% and 95%, and when its pace would run it out before the reset.
Needs Claude Code v2.1.287 or later.
Install
/plugin marketplace add AsyrafHussin/claude-code-statusline
/plugin install statusline-band@claude-code-statusline
Settings
Each is a row in /config, or run /plugin configure statusline-band@claude-code-statusline.
| Setting | Default | What it does |
|---------|---------|--------------|
| initials | empty | Up to two letters on Clawd's shirt |
| cardColor | #0a0a0a | Background of the band; empty ("") for none, so it takes the terminal's own |
| padRows | 1 | Empty rows above and below the stats, 0 to 2 |
| historyDays | 30 | Days the rolling cost and the history pane cover, 7 to 62 |
| noAttribution | false | Leave Co-Authored-By, Claude-Session and the Claude Code footer out of commits and pull requests |
| gitStrict | true | On: with a git switch on auto, only plain commands naming their repo with -C run without a prompt. Off: any git command runs without a prompt while the repo's switch is on auto |
| spotify | true | While Spotify runs, show what it plays under the band, with Beatbot dancing, a progress bar and controls (macOS) |
| plan | empty | Your Claude plan as shown, such as Max 20x; empty reads it from Claude Code's own ~/.claude.json (updated when Claude Code starts or signs in) |
| spotifyClientId | empty | Client ID of your own app at developer.spotify.com/dashboard, for searching Spotify |
| spotifyClientSecret | empty | Client secret of that app. /config leaves secret settings out, so keep it in the macOS Keychain instead: security add-generic-password -U -s statusline-band-spotify -a client-secret -w (it asks for the secret, hidden) |
What it runs, reads, keeps and sends
Programs it runs
It runs these programs, never through a shell. The arguments are fixed except the folder (each git command runs in the repo's folder, git -C <folder>), for quick commit the commit message you approved, and for a searched track its Spotify URI (checked to be spotify:track: and letters and digits only).
-
git, read-only, to show the branch and its changes (each in the repo's folder,git -C <folder>). It runs:rev-parse --show-toplevelfor the repo's root, once per folderstatus --porcelain=v2 --branch --show-stashfor the branch, its upstream, commits ahead and behind, uncommitted files and stashesdiff --shortstat HEADanddiff --shortstat @{upstream}...HEADfor the lines uncommitted and unpushedlog -1 --format=%ctfor the time of the last commit
These run every 30 seconds and after each tool call.
-
git, when a git step of Claude's asks, to say under the dialog what it takes with it: the same read-only commands, andconfig --get alias.<name>to see what a git alias in the command stands for. -
git, when you press quick commit:status --porcelain,diff HEADandlog -5 --format=%sto write the message; then, once you approve it,add -A,commit -q -m <message>and, if you chose it,push. These are the only git commands it runs that change anything. -
osascript, for Spotify: every 5 seconds, only while thespotifyswitch is on and Spotify runs, to read the track; on a press of a control (play, pause, skip, shuffle, repeat, volume); and when you pick a searched track, to play it and bring the app you were in back to the front. -
security find-generic-password -s statusline-band-spotify -w, for search: when you open or use the search and the setting is empty, to read the Spotify client secret from your macOS Keychain; once it is found, it is kept until the mod reloads. -
date, to read the local date and time (+%Y-%m-%d, and+%Y-%m-%d|%I:%M %p|%H|%M|%S). It also formats a rate limit's reset moment in your timezone (date -r <epoch>).
What it reads
- From the session: the usage Claude Code reports (cost, context, rate limits and when they reset), the model's name, the session id and working folder, the subagents that are running, and the token counts at the end of each turn.
- From Claude Code's own
~/.claude.json: only your account's plan type and rate-limit tier, once per load, to show the plan. - From Spotify, while it runs: the playing track's name, artist, album, length, position and id, and the shuffle, repeat and volume settings.
- From your macOS Keychain: only the item
statusline-band-spotify, the Spotify client secret, when you search. - What it never reads: the text of your prompts or Claude's replies. Of tool calls it reads only Bash commands, to find the git steps the switches cover.
What it keeps
All of it stays in the plugin's own store on your machine, nothing else:
- each repo's git switches, by the repo's root
- the last three Spotify tracks heard
- the
spotifyandlyricsswitches, on or off - whether each card is minimized
- each day's cost and tokens, for the last 62 days
- each session's last reading, for the last 100 sessions
- rate-limit readings from the last 3 hours, used for the recent pace
- which toasts it has already shown
What it sends
- Prompts to Claude, only when you press an action. Each is the fixed text listed under Actions, sent to this session as if you typed it. A push still goes through your own permission rules.
- The diff to Haiku, only when you press quick commit. Up to 24k characters of the diff, the names of new files and the last five commit subjects go to Claude's small model through Claude Code's own model call, the same way Claude Code itself talks to the model, to write the message.
- A push, only when you choose "Commit and push" in quick commit. It runs
git pushitself, to the branch's upstream, with the git credentials you already have. - A Spotify search, only when you search. With your own app's client ID and secret, the mod asks accounts.spotify.com for an app token and api.spotify.com for up to 10 tracks matching what you typed; picking one plays it in the Spotify app through AppleScript.
- The playing track to LRCLIB, while
spotifyandlyricsare on. Once per new track, its name, artist, album and length go to lrclib.net, a free open lyrics service, to get its synced lyrics. No account or key is involved. Turnlyricsoff and nothing is sent. - Nothing else. It never fetches from git, makes no other network calls, has no telemetry, and sends nothing to any other service. Commits behind are counted against the remote as of your own last fetch or pull.
Hooks
tool.call: only notes the time and refreshes the panel after the call. It lets every call run unchanged and never blocks or rewrites one.prompt.submit: starts Clawd's running animation. The prompt passes through unchanged.turn.complete: stops the animation and adds the turn's token counts to the totals.session.start: starts the panel's timers and registers/usage-historyand, withspotifyon,/spotify-search.command.run: answers only its own/usage-historyand/spotify-searchcommands, by opening their panes.attribution.text: withnoAttributionon, answers an empty commit trailer and PR footer.prompt.compose: adds one section to the system prompt: the git plain form, where each switch stands, and (withnoAttribution) no credit lines.- Action buttons: pressing one calls
$.prompt.submitwith its fixed prompt; nothing is sent without a press.quick commitinstead sends the diff (up to 24k characters) and the last five commit subjects to Haiku through Claude Code's own model call, then runsgit add -A,git commit -mand, if you choose it,git pushitself. classic.UserPromptSubmit,classic.PostToolUse: read the permission mode and effort; they change nothing.classic.PreToolUse(Bash only): runs the hooks beneath it first (your own settings hooks among them; their ask or deny stands), then reads the command as it will run forgit add,commitandpush, and answers ask or allow by the repo's switches. Any other command passes on to your usual permissions untouched.ui.render: draws the panel above the prompt (AbovePrompt), and the history and Spotify search panes (Pane).
同名の他の作品
- statusline-bandzakattack9 · ★ 1

