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/CarbeneAI/Forgenpx agentmods add skills/carbeneai/forge/gitworktreesWrote 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/skills/carbeneai/forge/gitworktrees)<a href="https://agentmods.dev/skills/carbeneai/forge/gitworktrees"><img src="https://agentmods.dev/badge/skills/carbeneai/forge/gitworktrees/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/skills/carbeneai/forge/gitworktrees"><img src="https://agentmods.dev/badge/skills/carbeneai/forge/gitworktrees.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.00068 | $0.03244 |
| Opus 5.5 | $0.00027 | $0.01298 |
| Sonnet 5.5 | $0.00014 | $0.00649 |
| Haiku 4.5 | $0.00007 | $0.00324 |
Grade C, and why
git-worktrees scanned grade C with 1 finding 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 3mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf .worktrees/user-auth/ How it starts
The opening of the file, as written. The whole thing — 598 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Worktrees
Creates isolated git worktree directories for feature development with automatic safety verification and project setup.
🎯 Load Full CORE Context
read ${PAI_DIR}/skills/CORE/SKILL.md
When to Activate This Skill
- "create worktree for feature X" → Isolated feature development
- "set up feature branch" → Before implementation
- "isolate this work" → Separate from main codebase
- Before executing implementation plans → Clean environment
- Before starting complex feature → Risk isolation
Core Philosophy
Isolation Prevents Accidents
Git worktrees create completely separate working directories that:
- Share git history (efficient)
- Have independent branches
- Can't accidentally commit to main
- Enable parallel development
- Simplify cleanup (delete directory = gone)
Safety First: Verify Gitignore
Project-local directories (node_modules/, .venv/, dist/, target/) MUST be gitignored before creating worktrees.
If not ignored, these directories would be tracked by git and shared across worktrees, causing:
- Dependency conflicts
- Build artifacts corruption
- Lock file collisions
- Massive git repository size
CRITICAL: Always verify and fix .gitignore before creating worktree.
Clean Baseline: Setup and Test
New worktree should start with:
- Project dependencies installed
- Project built/compiled if needed
- Tests passing (clean baseline)
If tests fail in new worktree, something's wrong with setup. Fix before implementation.
The Process
Step 1: Directory Selection
Priority order for worktree location:
- Project has
.worktrees/directory → Use it - Project has
worktrees/directory → Use it - CLAUDE.md specifies preference → Follow it
- Ask user where to create
Example:
## Worktree Location
Checking for standard worktree directories...
- `.worktrees/`: Not found
- `worktrees/`: Not found
- CLAUDE.md preference: Not specified
Where should I create the worktree?
Options:
1. `.worktrees/feature-name` (recommended - gitignored by default)
2. `../feature-name` (sibling directory)
3. Specify custom path
What's your preference?
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.
- 3mo ago First seen · 598 lines · 68 tokens per session scan C 13a72a6eaf0a
git-worktrees is a skill published in the GitHub repository CarbeneAI/Forge (9 stars, last pushed 1mo ago), licensed MIT. It adds 68 tokens to every session and 3,244 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
git-worktrees compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-worktreesCarbeneAI/Forge | Skill | 9 | 1mo ago | MIT | C | 68 | Claude Code |
| public-release-prepS24DeFi/global-lib-skills | Skill | 1 | 21d ago | MIT | A | 151 | Claude Code |
| git-security-historytr4m0ryp/shor | Skill | 14 | 1mo ago | none | A | 86 | Claude Code, Codex |
| openspec-archive-changeMingyiSecLab/Mingyi-Atlas | Skill | 14 | 5mo ago | Apache-2.0 | A | 31 | Codex |
| releasesonichi/sutando | Skill | 413 | today | MIT | A | 68 | Codex |
| changelog-composerMathews-Tom/armory | Skill | 345 | 6d ago | MIT | A | 67 | Claude Code |
| panguardpanguard-ai/panguard-ai | Skill | 69 | 5d ago | MIT | A | 30 | Claude Code, Codex |