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/christopherlouet/claude-basenpx agentmods add skills/christopherlouet/claude-base/git-worktreesWrote 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/christopherlouet/claude-base/git-worktrees)<a href="https://agentmods.dev/skills/christopherlouet/claude-base/git-worktrees"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/git-worktrees/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/christopherlouet/claude-base/git-worktrees"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/git-worktrees.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.00033 | $0.00514 |
| Opus 5.5 | $0.00013 | $0.00206 |
| Sonnet 5.5 | $0.00007 | $0.00103 |
| Haiku 4.5 | $0.00003 | $0.00051 |
Grade A, and why
git-worktrees 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 29d 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.
What it actually says
Git Worktrees (pointer)
"The single biggest productivity unlock." — Boris Cherny, creator of Claude Code
Generic worktree mechanics (git worktree add/list/remove/prune, branch isolation, hooks sharing) are canonical at git-scm.com/docs/git-worktree. This skill scopes to Claude-Code-specific worktree integration — what isn't in the git docs.
Claude Code worktree settings (CLI 2.1.76+ / 2.1.141+)
Three settings in .claude/settings.json shape how Claude Code uses worktrees:
| Setting | Values | Purpose |
|---|---|---|
worktree.sparsePaths |
array of globs | Limit which files a worktree includes — speeds up monorepo operations and narrows Claude's exploration context |
worktree.bgIsolation |
"auto" (default) / "none" |
Background sessions/agents default to writing into .claude/worktrees/; "none" lets them edit the working copy directly |
worktree.baseRef |
"fresh" / "head" |
"fresh" branches new worktrees from origin/<default>, "head" from local HEAD (inherits in-progress local commits) |
Both bgIsolation and baseRef apply to --worktree, the EnterWorktree tool, and agent-isolation worktrees.
Named-session pairing pattern
The foundation-specific workflow is 1 worktree = 1 branch = 1 named Claude session:
git worktree add ../myapp-feature-auth -b feature/auth
cd ../myapp-feature-auth && claude -n "auth"
The --name/-n flag tags the session for logs and terminal identification. Combined with worktrees this lets you run 5+ Claude Code sessions in parallel without state collision — see the "Parallel Sessions" section in CLAUDE.md.
See also
/work:work-explore— dedicate an analysis worktree to read-only explorationsession-handoffskill — transfer context across worktreesparallel-agents/agent-teamsskills — orchestration on top of multi-worktree setups
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.
- 29d ago Changed · -2 lines d77c1c0a5c9b
- 1mo ago Changed · -4 lines 0164dd99a164
- 1mo ago Changed · -1 lines 665c00a8382b
- 1mo ago First seen · 47 lines · 33 tokens per session scan A b427b014845c
git-worktrees is a skill published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed yesterday), licensed MIT. It adds 33 tokens to every session and 514 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
core-workflow
Detailed development workflow patterns, checklists, and standards. Auto-loads for complex tasks, planning, debugging, or when explicit patterns are needed. Contains session protocols, git conventions, security checklists, review-based validation, and communication standards.
debug-systematic
Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.
auto-claude
Autonomous multi-agent coding with git worktree isolation, QA validation, and memory. Use for complex features requiring autonomous implementation.
changelog-generator
Generate CHANGELOG.md from git history grouped by Conventional Commit types. Triggers on "generate changelog", "write changelog", "release notes".
git-commit-generator
Generate Conventional Commits from staged git diff. Analyzes changes and produces commit messages following the Conventional Commits spec (feat, fix, refactor, etc.). Triggers on "generate commit", "write commit message", "conventional commit".
git-advanced-workflows
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.