ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 victor-falcon

status-bar

一款 Claude Code 外掛,在提示列下方加入彩色狀態列,並保留引擎自己的提示列(`? for shortcuts`、`esc to interrupt`……):

已翻譯

關於這個 mod

一款 Claude Code 外掛,會在提示列下方加入彩色狀態列,並保留引擎自己的提示列(? for shortcuts、esc to interrupt……):

提示列下方的狀態列:分支、差異、拉取要求狀態、CI 檢查和方案用量

| 區段 | 顯示內容 | 顏色 | | --- | --- | --- | | 分支 | 目前分支;如果 HEAD 已分離,則顯示短 SHA | 分支圖示顏色 | | 差異 | 相對於預設分支合併基點新增和刪除的行,包含未提交的工作 | +N 為綠色,-N 為紅色 | | 拉取要求 | 分支的 PR 編號和狀態,格式為 #42 (Open),並連結到該 PR。狀態可以是 Merged、Closed、Draft 或 Open | 紫色、紅色、灰色、綠色 | | CI | 已通過的檢查數和總數,並在全部通過、存在失敗或仍在執行時顯示相應圖示 | 全部通過時通過數為綠色,任一失敗時為紅色 | | 用量 | 方案的 5 小時工作階段用量和每週用量 | 從 65% 開始為橘色,從 75% 開始為紅色(取更接近上限的時間窗口) |

沒有可顯示內容的區段會被省略:在 git 儲存庫外沒有 git 部分,沒有 PR 時沒有 PR 或 CI 部分,不使用 Claude 訂閱時沒有用量部分。

要求

  • 具備 function hooks(mods)的 Claude Code。它們仍處於搶先體驗階段;此外掛已在 2.1.289 上測試。
  • 終端機中使用 Nerd Font,用來顯示圖示。
  • git,以及已登入的 GitHub CLI(gh),用於 PR 和 CI 區段。

安裝

claude plugin marketplace add victor-falcon/claude-status-bar
claude plugin install status-bar@claude-status-bar

啟動新的工作階段,或在正在執行的工作階段中執行 /reload-plugins。

如果設定中有 statusLine 命令,可以移除它:此外掛會取代該命令。

刷新方式

  • 分支和差異:每 5 秒重新整理一次,並在每輪之後重新整理。
  • 拉取要求和 CI:每 60 秒重新整理一次;Claude 執行 gh pr、git push、git checkout 或 git switch 後也會立即重新整理。
  • 用量:每當 Claude Code 再次測量用量時重新整理。

設定

可以在 /config 中關閉每個區段,也可以變更每個圖示;每個選項都是一列。Claude Code 會把它們儲存在 settings.json 的 pluginConfigs 下,其中任何一項變更後,外掛都會立即重新載入。

外掛在 /config 中的選項:每個區段一個開關,每個圖示一個欄位

| 選項 | 預設值 | 作用 | | --- | --- | --- | | showBranch | true | 顯示分支 | | showDiff | true | 顯示新增和刪除的行(關閉後,外掛會跳過 git diff) | | showPullRequest | true | 顯示已連結的拉取要求編號及其狀態 | | showChecks | true | 顯示 CI 檢查(同時關閉拉取要求後,外掛也不會呼叫 gh) | | showUsage | true | 顯示方案用量 | | iconBranch | Nerd Font 分支 | 繪製在分支名稱前 | | iconDiff | 無 | 繪製在新增和刪除的行前 | | iconPullRequest | Nerd Font GitHub | 繪製在拉取要求編號前 | | iconChecksPassed | Nerd Font check | 所有檢查通過時繪製在檢查前 | | iconChecksFailed | Nerd Font cross | 任一檢查失敗時繪製在檢查前 | | iconChecksPending | Nerd Font hourglass | 有些檢查仍在執行時繪製在檢查前 | | iconUsage | 無 | 繪製在方案用量前 |

圖示會依原樣使用,包括空格。留空一個欄位即可使用預設值,寫入 none 則不繪製圖示。Claude Code 在安裝時開啟的對話框會將所有圖示欄位留空,因為它不會把預設值填入文字欄位;保持原樣儲存即可繼續使用預設圖示。

自訂

預設圖示、顏色和臨界值是 hooks/format.ts 頂端的常數(DEFAULT_ICONS、COLOR_*、PULL_REQUEST_COLORS、USAGE_WARNING_PERCENT、USAGE_CRITICAL_PERCENT)。顏色可以是 Claude Code 主題鍵,也可以是原始顏色(green、#ff8700)。

要執行自己的副本,請複製此儲存庫,然後從磁碟載入,而不是安裝它:

claude --plugin-dir /path/to/claude-status-bar

或者,若要套用到每個工作階段,請在 ~/.claude/settings.json 的 env 區塊中將 CLAUDE_CODE_PLUGIN_DIRS 設為該路徑。此資料夾會受到監看,因此儲存檔案後外掛就會重新載入。

開發

claude plugin validate .
claude plugin test .

授權條款

MIT

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add victor-falcon/claude-status-bar
claude plugin install status-bar
原文 / README

status-bar

A Claude Code mod that adds a colored status line under the prompt, with the engine's own hint line (? for shortcuts, esc to interrupt…):

The status line under the prompt: branch, diff, pull request state, CI checks and plan usage

| Segment | What it shows | Color | | --- | --- | --- | | Branch | Current branch, or the short SHA on a detached HEAD | Branch icon colored | | Diff | Lines added and removed against the merge base with the default branch, uncommitted work included | +N green, -N red | | Pull request | The branch's PR number and state, as #42 (Open), linked to the PR. The state is Merged, Closed, Draft or Open | Purple, red, gray, green | | CI | Passed checks out of the total, with an icon for all passed, any failed, or still running | Passed count green when all passed, red when any failed | | Usage | Your plan's 5-hour session usage and weekly usage | Orange from 65%, red from 75% (whichever window is fuller) |

Segments with nothing to show are left out: outside a git repository there is no git part, without a PR there is no PR or CI part, and off a Claude subscription there is no usage part.

Requirements

  • Claude Code with function hooks (mods). They are early access; this mod is tested on 2.1.289.
  • A Nerd Font in your terminal, for the icons.
  • git, and the GitHub CLI (gh) logged in for the PR and CI segments.

Install

claude plugin marketplace add victor-falcon/claude-status-bar
claude plugin install status-bar@claude-status-bar

Start a new session, or run /reload-plugins in a running one.

If you had a statusLine command in your settings, you can remove it: this mod replaces it.

How it refreshes

  • Branch and diff: every 5 seconds and after every turn.
  • Pull request and CI: every 60 seconds, and right after a gh pr, git push, git checkout or git switch run by Claude.
  • Usage: whenever Claude Code measures it again.

Configure

Every section can be switched off and every icon changed from /config, where each option is a row. Claude Code stores them in settings.json under pluginConfigs, and the mod reloads as soon as one changes.

The mod's options in /config: a switch per section and a field per icon

| Option | Default | What it does | | --- | --- | --- | | showBranch | true | Show the branch | | showDiff | true | Show the lines added and removed (off, the mod skips git diff) | | showPullRequest | true | Show the pull request number, linked, and its state | | showChecks | true | Show the CI checks (with the pull request off too, the mod never calls gh) | | showUsage | true | Show the plan usage | | iconBranch | Nerd Font branch | Drawn before the branch name | | iconDiff | none | Drawn before the added and removed lines | | iconPullRequest | Nerd Font GitHub | Drawn before the pull request number | | iconChecksPassed | Nerd Font check | Drawn before the checks when every one passed | | iconChecksFailed | Nerd Font cross | Drawn before the checks when any failed | | iconChecksPending | Nerd Font hourglass | Drawn before the checks while some are still running | | iconUsage | none | Drawn before the plan usage |

Icons are used as written, spaces included. Leave one empty for its default, or write none to draw no icon. The dialog Claude Code opens on install shows every icon field empty, as it never fills a text field with its default: save it as it is to keep the default icons.

Customize

Default icons, colors and thresholds are constants at the top of hooks/format.ts (DEFAULT_ICONS, COLOR_*, PULL_REQUEST_COLORS, USAGE_WARNING_PERCENT, USAGE_CRITICAL_PERCENT). Colors are a Claude Code theme key or a raw color (green, #ff8700).

To run your own copy, clone this repository and load it from disk instead of installing it:

claude --plugin-dir /path/to/claude-status-bar

or, for every session, set CLAUDE_CODE_PLUGIN_DIRS to that path in the env block of ~/.claude/settings.json. The folder is watched, so saving a file reloads the mod.

Development

claude plugin validate .
claude plugin test .

License

MIT

其他同名作品

更多類似作品