worktree-parallel

worktree-parallel is a skill for Claude Code, Codex from D-Robotics/moss. It costs 22 tokens per session (295 once invoked), scanned A, original, MIT.

A workflow for giving coding sub-agents separate Git worktrees, which are isolated working directories for the same repository, and then merging their patches.

In plain words
What is it for?
Use it to run several writable implementation tasks in parallel, collect their changes, and merge them back into the main branch.
Why use it?
Separate worktrees prevent concurrent agents from overwriting each other's files. It also records patches and reports conflicts instead of forcing an unsafe merge.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to run several writable implementation tasks in parallel, collect their changes, and merge them back into the main branch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/d-robotics/moss/worktree-parallel
Install

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.

Any agent
npx skills add D-Robotics/moss --skill worktree-parallel
Clone the repo
git clone --depth 1 https://github.com/D-Robotics/moss

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for worktree-parallel

README.md
[![agentmods](https://agentmods.dev/badge/skills/d-robotics/moss/worktree-parallel/github.svg)](https://agentmods.dev/skills/d-robotics/moss/worktree-parallel)
Your own site
<a href="https://agentmods.dev/skills/d-robotics/moss/worktree-parallel"><img src="https://agentmods.dev/badge/skills/d-robotics/moss/worktree-parallel/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.

agentmods 80×15 button for worktree-parallel

Your own site · 80×15
<a href="https://agentmods.dev/skills/d-robotics/moss/worktree-parallel"><img src="https://agentmods.dev/badge/skills/d-robotics/moss/worktree-parallel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.00295
Opus 5.5 $0.00009 $0.00118
Sonnet 5.5 $0.00004 $0.00059
Haiku 4.5 $0.00002 $0.00030

Measured 23d ago against content hash defaf7014d08, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

worktree-parallel 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 23d 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.

.moss/skills/worktree-parallel/SKILL.md · 15 lines

What it actually says

Worktree-parallel writable sub-agents

  1. In fan_out_subagents, give each implementation task scope: "full", declared writePaths, and worktree: true (or set MOSS_WORKTREE_SUBAGENTS=1 once and full-scope tasks default to isolated worktrees).
  2. Each child then works in its own git worktree under .moss/worktrees/ — concurrent writers cannot see or stomp each other.
  3. On completion the child's changes are collected as a binary patch under .moss/patches/<leaseId>.patch; its summary ends with [worktree lease=<id> patch=<digest> changed=<n>].
  4. Merge leases back with merge_subagent_patch (leaseId + patchId from the child result). Merging uses git apply --3way, so changes in different regions of a file compose; a same-region collision returns merge_conflict with the conflicting paths — resolve manually, do not force.
  5. Merge order matters when tasks touch the same files: merge one, verify, then the next.
  6. Worktrees are cleaned up automatically after patch collection; the patch files remain for audit.
Changes

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.

  1. 23d ago First seen · 15 lines · 22 tokens per session scan A defaf7014d08

Subscribe to this mod's changes

worktree-parallel is a skill published in the GitHub repository D-Robotics/moss (143 stars, last pushed 5d ago), licensed MIT. It adds 22 tokens to every session and 295 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-10-01.