BeLazy167/claude-mods-skill/tree/main/examples/branch-band
branch-band
示例 Claude Code 模组,在提示符上方显示当前 git 分支和工作树状态,通过 $.process.run 定时刷新并保存在 $.state 中。
关于这个 mod
branch-band 是 claude-mods-skill 仓库中附带的一个示例 Claude Code 模组。它在提示符上方显示一个条带,包含当前 git 分支和工作树状态,使用 $.process.run 定时刷新并存储在 $.state 中。它从在 Claude Code 内加载的 TypeScript 函数钩子模块中运行 git branch --show-current 和 git status --porcelain(需要 2.1.287 或更高版本;已在 2.1.290 上测试)。该仓库提供通过 /plugin install claude-mods-skill --marketplace BeLazy167/claude-mods-skill 或 claude plugin marketplace add 加 claude plugin install 进行安装,并且可以使用 claude --plugin-dir examples/branch-band 在会话中试用该示例。每个示例都通过 claude plugin validate、claude plugin test 和 tsc,并且 scripts/check.sh 辅助脚本会在 Claude Code 更新后重新验证所有示例。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add BeLazy167/claude-mods-skill claude plugin install branch-band@claude-mods-skill
原文 / README
claude-mods-skill
A Claude Code skill that teaches an agent how to build Claude Mods:
plugins whose behaviour is a TypeScript function-hook module that runs
inside Claude Code. It ships five small example mods that the agent copies.
Each example passes claude plugin validate, claude plugin test and tsc.
Tested with Claude Code 2.1.290. Mods need 2.1.287 or later and are on
by default. The old CLAUDE_CODE_ENABLE_FUNCTION_HOOKS flag is ignored;
remove it from your settings.
Claude Code also has a built-in plugin-authoring skill. That one knows
your exact build. This skill sits on top of it: tested examples, traps seen
on real builds, and how to prove and ship a mod.
Install
At the Claude Code prompt:
/plugin install claude-mods-skill --marketplace BeLazy167/claude-mods-skill
Or from your shell:
claude plugin marketplace add BeLazy167/claude-mods-skill
claude plugin install claude-mods-skill@claude-mods-skill
Then ask Claude to build a mod. The creating-mods skill loads on its own.
What is inside
skills/creating-mods/SKILL.md: the workflow, which example to copy, quick reference, loader rules, sharing.skills/creating-mods/references/gotchas.md: version-tagged traps from real builds.skills/creating-mods/references/examples.md: Anthropic and community mods worth reading.examples/:
| Example | Shows |
|---|---|
| hello-mod | Block a tool call; fail-closed .catch; smoke.sh proves the deny |
| redact-output | Rewrite Bash output before the model reads it |
| branch-band | Git branch above the prompt; $.process.run on a timer; $.state |
| notes-pane | /note and /notes; a pane with a Button; $.store |
| dice-tool | A tool the model can call |
Try one for a session: claude --plugin-dir examples/notes-pane.
Keeping it current
The mods API changes between releases. After a Claude Code update, run:
scripts/check.sh
It validates, tests and type-checks every example against your build.
Links
- Docs: https://code.claude.com/docs/en/plugins/mods/overview
- Built-in mods source: https://github.com/anthropics/claude-code/tree/main/mods
- Design thread: https://github.com/anthropics/claude-code/issues/91870
- Community catalogue: https://github.com/karanb192/awesome-claude-code-mods
其他同名作品
- branch-bandbaselane-sh · ★ 1
