choas/claude-mods/tree/main/git-status
关于这个 mod
git-status 是一个小型 Claude Code 插件(属于 my-mods 市场),会在页脚的模式标签旁显示会话工作文件夹的 git 状态。它显示当前分支(如果 HEAD 分离则显示短提交哈希)、未提交条目的数量(已修改、已暂存、已重命名、有冲突和未跟踪)作为 ?,以及未推送提交的数量作为 ?。只有数值非零时才显示指标,位于 git 仓库之外时不会显示任何内容。状态会在会话开始、每次提示词之后、Bash/Edit/Write 工具调用之后,以及文件夹变更时刷新;它也会自行跟踪 Bash 命令中的 cd。它运行 git status --porcelain=v2 --branch,禁用可选锁,并设置 5 s 超时,因此绝不会阻塞仓库;要求 git 位于 PATH 中。安装方式是先执行 /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 orpushdes 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
cdinside Bash commands on its own, so it works without cwd-status. - Uses
git status --porcelain=v2 --branchwith 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
