Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/qinye6/pi-ccgnpx agentmods add commands/qinye6/pi-ccg/worktreeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/qinye6/pi-ccg/worktree)<a href="https://agentmods.dev/commands/qinye6/pi-ccg/worktree"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/worktree/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/qinye6/pi-ccg/worktree"><img src="https://agentmods.dev/badge/commands/qinye6/pi-ccg/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00026 | $0.00861 |
| Opus 5.5 | $0.00010 | $0.00344 |
| Sonnet 5.5 | $0.00005 | $0.00172 |
| Haiku 4.5 | $0.00003 | $0.00086 |
Grade A, and why
worktree scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to worktree — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
What it actually says
Worktree - Git Worktree 管理
在结构化目录管理 Git worktree,支持智能默认和 IDE 集成。
使用方法
/worktree <add|list|remove|prune|migrate> [options]
子命令
| 命令 | 说明 |
|---|---|
add <path> |
创建新 worktree |
list |
列出所有 worktree |
remove <path> |
删除指定 worktree |
prune |
清理无效引用 |
migrate <target> |
迁移内容到目标 worktree |
选项
| 选项 | 说明 |
|---|---|
-b <branch> |
创建新分支 |
-o, --open |
创建后用 IDE 打开 |
--from <source> |
迁移源路径 |
--stash |
迁移 stash 内容 |
--track |
跟踪远程分支 |
--detach |
分离 HEAD |
--lock |
锁定 worktree |
目录结构
parent-directory/
├── your-project/ # 主项目
│ ├── .git/
│ └── src/
└── .ccg/ # worktree 管理目录
└── your-project/
├── feature-ui/ # 功能分支
├── hotfix/ # 修复分支
└── debug/ # 调试 worktree
执行工作流
Add - 创建 Worktree
[模式:创建]
- 验证 Git 仓库
- 计算路径:
../.ccg/项目名/<path> - 创建 worktree
- 自动复制环境文件(
.env等) - 可选:用 IDE 打开
Migrate - 迁移内容
[模式:迁移]
- 验证源有未提交内容
- 确保目标干净
- 显示即将迁移的改动
- 安全迁移
- 确认结果
示例
# 基本创建
/worktree add feature-ui
# 创建并用 IDE 打开
/worktree add feature-ui -o
# 创建指定分支
/worktree add hotfix -b fix/login -o
# 迁移未提交内容
/worktree migrate feature-ui --from main
# 迁移 stash 内容
/worktree migrate feature-ui --stash
# 管理操作
/worktree list
/worktree remove feature-ui
/worktree prune
输出示例
✅ Worktree created at ../.ccg/项目名/feature-ui
✅ 已复制 .env
✅ 已复制 .env.local
📋 已从 .gitignore 复制 2 个环境文件
🖥️ 是否在 IDE 中打开?[y/n]: y
🚀 正在用 VS Code 打开...
智能特性
- 智能默认 – 未指定分支时使用路径名
- IDE 集成 – 自动检测 VS Code / Cursor / WebStorm
- 环境文件 – 自动复制
.gitignore中的.env文件 - 路径安全 – 始终使用绝对路径防止嵌套问题
- 分支保护 – 验证分支未被其他地方使用
注意事项
- Worktree 共享
.git目录,节省磁盘空间 - 迁移仅限未提交改动,已提交内容用
git cherry-pick - 支持 Windows、macOS、Linux
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 129 lines · 26 tokens per session scan A 8a7ac115bb5b
worktree is a command published in the GitHub repository qinye6/pi-ccg (4 stars, last pushed 1mo ago), licensed MIT. It adds 26 tokens to every session and 861 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to worktree, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
merge-conflict-analysis
You are analyzing merge conflicts for PR #${{ pr-number }}.
commit
A command that examines staged Git changes and proposes a commit message using the Conventional Commits format, such as feat, fix, or docs. Git is a tool for tracking changes to code.
release-notes
Generate consistent, well-structured release notes from git history. Triggered on release tags following semver patterns (v..) to produce categorized changelog with breaking changes, features, fixes, and contributor attribution.
repo-audit
Audit a codebase (local or remote GitHub/GitLab) against architecture principles and requirements, surfacing drift, risk, and missing decisions.
pr
Handle the full workflow from current branch state to an open, CI-monitored pull request.
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…