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/Arasz/ai-raccoonnpx agentmods add skills/arasz/ai-raccoon/worktree-agent-isolationWrote 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/arasz/ai-raccoon/worktree-agent-isolation)<a href="https://agentmods.dev/skills/arasz/ai-raccoon/worktree-agent-isolation"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/worktree-agent-isolation/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/arasz/ai-raccoon/worktree-agent-isolation"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/worktree-agent-isolation.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.00082 | $0.04875 |
| Opus 5.5 | $0.00033 | $0.01950 |
| Sonnet 5.5 | $0.00016 | $0.00975 |
| Haiku 4.5 | $0.00008 | $0.00487 |
Grade C, and why
worktree-agent-isolation 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 yesterday.
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.
completely" errors. Workaround is `rm -rf obj/` but it is destructive and racy. How it starts
The opening of the file, as written. The whole thing — 260 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Worktree Agent Isolation
Run N independent coding agents in parallel, each in its own git worktree, with zero file conflicts. Integrate via GitHub PRs — the main checkout is read-only.
Why
Two agents in the same directory cause:
- Build failures: Shared
obj/directories cause MSB3492 or "Building target completely" errors. Workaround isrm -rf obj/but it is destructive and racy. - File modification races: One agent patches stale content.
- Test corruption: Process-global state (env vars, temp dirs) interferes.
When to Use
- User says "worktrees only", "don't touch main", "agent isolation"
- Multiple independent tasks can run in parallel
- Another agent/session is using the main checkout
- User wants to see draft PRs for in-flight work visibility
Setup
# Fetch latest main first — ensures worktrees branch from the true HEAD
git fetch origin main
# Create N worktrees from origin/main (not local main, which may be behind)
git worktree add ../project-task-a -b task/<id>-<slug> origin/main
git worktree add ../project-task-b -b task/<id>-<slug> origin/main
Each worktree gets its own branch, own working directory, own build artifacts.
Always use origin/main as the base, not main. Local main may lag behind
after another agent merges. Fetching first ensures all worktrees share the same
ancestor, reducing rebase conflicts when merging sequentially.
Dispatching Agents
delegate_task(tasks=[
{"goal": "Implement issue #X: ...",
"context": """Project: /abs/path/to/project-task-a
Branch: task/x-slug (already checked out)
Build: dotnet build
Test: dotnet test --filter "..."
DO NOT USE Rider MCP tools. Use terminal, read_file, write_file only.
TDD MANDATORY: ..."""},
{"goal": "Implement issue #Y: ...",
"context": """Project: /abs/path/to/project-task-b
..."""},
])
Key: pass the absolute worktree path as Project. Each agent's working
directory is isolated — they never see each other's files.
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/ab-agent-experiment.md 3.6 KB
- references/autonomous-wave-cycle.md 2.0 KB
- references/comparative-agent-experiments.md 2.0 KB
- references/machine-load.md 12 KB
- references/merge-conflicts-rebase.md 1.9 KB
- references/parallel-waves-shared-artifact.md 1.6 KB
- references/shared-worktree-collisions.md 8.2 KB
- references/user-preferences.md 1.4 KB
- scripts/badger_store.py 117 KB runs code
- scripts/blast_radius_kill_guard.py 13 KB runs code
- scripts/cross_worktree_dirty_warning.py 11 KB runs code
- scripts/run_suite.py 8.2 KB runs code
- scripts/shell_parser.py 21 KB runs code
- scripts/verify_hooks.py 16 KB runs code
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.
- yesterday First seen · 260 lines · 82 tokens per session scan C d9672dd349b9
worktree-agent-isolation is a skill published in the GitHub repository Arasz/ai-raccoon (7 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 4,875 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-12-05.
worktree-agent-isolation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| worktree-agent-isolationArasz/ai-raccoon | Skill | 7 | today | MIT | C | 82 | Claude Code, Codex |
| cartographer-kb-conflict-resolveBeppeTemp/cartographer | Skill | 74 | yesterday | Apache-2.0 | A | 24 | Claude Code, Codex |
| shipariaxhan/kernel-claude | Skill | 16 | yesterday | MIT | A | 46 | Claude Code |
| githubGen-Verse/PAST-Bench | Skill | 40 | 4mo ago | Apache-2.0 | A | 44 | Claude Code, Codex |
| github-proxyvolcengine/OpenViking | Skill | 43k | today | AGPL-3.0 | A | 94 | Claude Code, Codex |
| release-rollbackPrismer-AI/PrismerCloud | Skill | 1.4k | 1mo ago | MIT | A | 96 | Claude Code |
| evolve-lite:publishAgentToolkit/altk-evolve | Skill | 143 | 5d ago | Apache-2.0 | A | 28 | Claude Code, Codex |