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

git-status

一個 Claude Code 外掛,在頁尾顯示目前儲存庫的分支、未提交檔案和未推送提交。

已翻譯

關於這個 mod

git-status 是一個小型 Claude Code 外掛(屬於 my-mods 市集),會在頁尾的模式標籤旁顯示工作階段工作資料夾的 git 狀態。它顯示目前分支(如果 HEAD 分離則顯示短提交雜湊)、未提交項目的數量(已修改、已暫存、已重新命名、有衝突和未追蹤)作為 ?,以及未推送提交的數量作為 ?。只有數值非零時才顯示指標,位於 git 儲存庫之外時不會顯示任何內容。狀態會在工作階段開始、每次提示詞之後、Bash/Edit/Write 工具呼叫之後,以及資料夾變更時重新整理;它也會自行追蹤 Bash 指令中的 cd。它執行 git status --porcelain=v2 --branch,停用可選鎖定,並設定 5 s 逾時,因此絕不會阻塞儲存庫;需要 PATH 中有 git。安裝方式是先執行 /plugin marketplace add choas/claude-mods,再執行 /plugin install git-status@my-mods,然後執行 /reload-plugins。授權條款為 MIT。

安裝

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

claude plugin marketplace add choas/claude-mods
claude plugin install git-status
原文 / README

my-mods

Small Claude Code mods that add live info to the footer, next to the mode labels.

| Mod | Shows | Example | | --- | --- | --- | | cwd-status | The folder Claude is working in, including where a Bash command cds to | 📁 ~/prj/app | | git-status | Branch, uncommitted files and unpushed commits of that folder's repo | ⎇ main ●3 ↑2 |

Together they read like 📁 ~/prj/app ⎇ main ●3 ↑2.

Install

In Claude Code, add this marketplace once:

/plugin marketplace add choas/claude-mods

Then install one or both mods:

/plugin install cwd-status@my-mods
/plugin install git-status@my-mods

Run /reload-plugins (or restart Claude Code) and the labels show up in the footer.

You can also browse and install them interactively with /plugin → Marketplaces → my-mods.

Update

/plugin marketplace update my-mods

Uninstall

/plugin uninstall cwd-status@my-mods
/plugin uninstall git-status@my-mods

cwd-status

Shows 📁 <folder> with your home folder shortened to ~.

  • Follows the session's working folder.
  • When a Bash command cds or pushdes somewhere (cd ../other && make), it shows that folder until the next tool runs.

git-status

Shows the git state of the current folder:

| Part | Meaning | | --- | --- | | ⎇ main | Current branch (short commit hash on a detached HEAD) | | ●3 | Uncommitted entries: modified, staged, renamed, conflicted and untracked | | ↑2 | Commits not pushed yet: ahead of the upstream, or, without an upstream, commits on no remote |

  • ● and ↑ only appear when non-zero; outside a git repo nothing is shown.
  • Refreshes when the session starts, on every prompt (so commits made in another terminal show up), after Bash/Edit/Write tool calls, and when the folder changes.
  • Follows cd inside Bash commands on its own, so it works without cwd-status.
  • Uses git status --porcelain=v2 --branch with optional locks off and a 5 s timeout, so it never blocks your repo.

Requires git on your PATH.

Development

Each mod is a plugin folder with a hooks module (hooks/register.ts), a state contract (types/index.d.ts) and tests:

claude plugin validate git-status
claude plugin test git-status

To try local changes, point Claude Code at the folder: claude --plugin-dir ./git-status.

License

MIT

更多類似作品