Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/dirtybits/agent-skills/multi-agent-worktree-disciplinenpx skills add dirtybits/agent-skills --skill multi-agent-worktree-disciplinegit clone --depth 1 https://github.com/dirtybits/agent-skillsWrote 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/dirtybits/agent-skills/multi-agent-worktree-discipline)<a href="https://agentmods.dev/skills/dirtybits/agent-skills/multi-agent-worktree-discipline"><img src="https://agentmods.dev/badge/skills/dirtybits/agent-skills/multi-agent-worktree-discipline.svg" alt="Measured on agentmods" 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.00117 | $0.01796 |
| Opus 5 | $0.00059 | $0.00898 |
| Sonnet 5 | $0.00023 | $0.00359 |
| Haiku 4.5 | $0.00012 | $0.00180 |
Grade A, and why
multi-agent-worktree-discipline 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Multi-Agent Worktree Discipline
Why this skill exists
When several agents share one repository through git worktrees, the expensive failures are not merge conflicts — they are silent ones: an agent redoes work that exists uncommitted in another worktree, a lockfile reinstall wipes an uncommitted dependency, a branch switch strands edits, a resumed session pushes with the wrong GitHub account, or a "fixed" build was actually run against the wrong Node version. Each of these costs an hour or more and looks like a mystery until you know the pattern. This skill is the checklist and the recovery protocols.
1. Session bootstrap (run before doing anything else)
- Identify where you are. Run
git worktree listandgit rev-parse --show-toplevel. Confirm which worktree you are in and which branch it has checked out. Never infer location from the path string — on case-insensitive filesystems (macOS default)~/repos/xand~/Repos/xare the same directory, and per-agent worktrees often live under hidden dirs (.codex/,.cursor/,.claude/worktrees/,~/.agents/worktrees/). - Pin the toolchain per command, not per session. Agent shells frequently resolve a different runtime than the repo expects (
.nvmrc,rust-toolchain, etc.) because the sandbox PATH is built before version managers run. If the repo pins a version, export the pinned toolchain's bin dir onto PATH inside every shell invocation (shell state may not persist between calls). Symptom of getting this wrong: test runners dying with module-format errors (ERR_REQUIRE_ESM), not a clear version message. - Install dependencies from the lockfile. Fresh worktrees lack gitignored artifacts:
node_modules,.env.local, build caches. If the repo has a worktree-setup script, run it. Otherwise install with the lockfile-respecting command (npm ci,pnpm install --frozen-lockfile) — plainnpm installcan rebuild optional native bindings incorrectly and mutate the lockfile. - Beware symlinked/shared node_modules. Some worktrees symlink
node_modulesto the primary checkout to save disk. That means: (a) installing in one place affects all of them, and (b) a build failure likeCannot find module 'x'usually means broken worktree resolution or a stale build cache (.next,dist) — fix the link and clear the cache; do not add duplicate dependencies or edit app code to route around it. - Verify your push identity. Run
gh auth status(andgit config user.email). Session resume and multi-account setups can silently switch the active account to one that cannot create PRs (e.g. an enterprise-managed account). Switch back explicitly (gh auth switch --user <name>) before any push or PR.
What ships with it
2 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.
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.
- 5d ago First seen · 72 lines · 117 tokens per session scan A 720be7e4b749
multi-agent-worktree-discipline is a skill published in the GitHub repository dirtybits/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 117 tokens to every session and 1,796 once invoked, about $0.0006 per session on Opus 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-08-31.
Other skills, from other repositories
stream-chain
Stream-JSON chaining for multi-agent pipelines, data transformation, and sequential workflows.
agent-orchestrator
Meta-skill que orquestra todos os agentes do ecossistema. Scan automatico de skills, match por capacidades, coordenacao de workflows multi-skill e registry management.
project-orchestration
Orchestrate multi-agent workflows for feature development using planning agents, context handoff, and stage management.
company-product-context
Compiles comprehensive company product context from PDF documents, web research, and industry knowledge.
deep-researcher
Performs comprehensive, multi-layered research on any topic with structured analysis and synthesis of information from multiple sources.
codebase-context-extractor
This skill provides a comprehensive context extraction system for large codebases. It intelligently analyzes code structure, dependencies, and relationships to extract relevant context for understanding, debugging, or modifying code.