Help us improve
Share bugs, ideas, or general feedback.
From second-claude-code
Decomposes large tasks into 2-10 independent parallel units executed in separate worktrees. Use for producing 5+ similar artifacts like newsletter issues or competitor analyses from distinct sources without dependencies.
npx claudepluginhub unclejobs-ai/second-claude-code --plugin second-claude-codeHow this skill is triggered — by the user, by Claude, or both
Slash command
/second-claude-code:batchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Verify task independence before parallel execution.**
Decomposes tasks into independent concerns and launches parallel specialized agent groups. For multi-subtask requests, cross-domain research, or parallelizable file/module work.
Decomposes large changes, migrations, or multi-issue fixes into parallel work packages executed via independent subagents with quality gates to prevent conflicts.
Splits todo lists into shards for parallel execution with periodic quality gates and risk tracking. Use for high-throughput delivery of many independent tasks.
Share bugs, ideas, or general feedback.
Verify task independence before parallel execution.
workflow instead.Decompose large knowledge work tasks into independent parallel units, each executed in its own worktree.
Inspired by Claude Code's /batch command — designed for high-volume, homogeneous content production.
Dispatch an Explore agent to understand the full scope of the request:
write)?Break the task into 2–10 independent units. Each unit specification must include:
unit:
id: <integer, 1-indexed>
label: <short human-readable title>
topic: <specific topic for this unit — no overlap with other units>
skill: <write|research|analyze|review|refine>
output: <file path: .captures/batch-{run_id}/{slug}.md>
shared_context: <reference to shared context block>
Independence requirements (non-negotiable):
Unit count limits:
--units NPresent the full decomposition plan to the user before any execution begins. This gate is mandatory — no exceptions.
Present as a table:
| # | Label | Topic | Skill | Output File |
|---|---|---|---|---|
| 1 | ... | ... | write | .captures/batch-{run_id}/01-slug.md |
| 2 | ... | ... | write | .captures/batch-{run_id}/02-slug.md |
Show: total units, estimated cost (units × avg token cost), parallelism setting.
Wait for explicit approval. On rejection: re-decompose with user's feedback and re-present.
After approval, spawn one agent per unit. Each agent runs in an isolated worktree:
isolation: worktree
worktree_path: worktree-batch-{run_id}-unit-{id}
Concurrency is capped at --parallel (default: 3). Units beyond the cap queue and start as slots open.
Each unit agent receives:
Track status per unit: PENDING | RUNNING | DONE | FAILED.
Print a live status table as units complete. On unit failure:
After all units complete (or time out), produce a Batch Summary Report:
## Batch Summary — {topic} ({YYYY-MM-DD})
Units: {done}/{total} completed
Failed: {failed_ids} (if any)
### Output Files
| # | Label | Status | Path |
|---|-------|--------|------|
...
### Synthesis
{Optional: if --synthesize is set, produce a combined document merging all outputs}
### Failures
{For each failed unit: label, error summary, recommended action}
Save report to .captures/batch-{run_id}/00-summary.md.
| Flag | Values | Default | Effect |
|---|---|---|---|
--units N | integer 2–20 | auto (up to 10) | Override max unit count |
--skill | write|research|analyze|refine | write | Skill each unit runs |
--topic | string | (required) | The overarching topic being decomposed |
--parallel | integer 1–5 | 3 | Max concurrent unit agents |
--synthesize | flag | off | After all units complete, merge outputs into one document |
--lang | ko|en | ko | Output language passed to each unit skill |
--format | write-skill formats | article | Passed to each unit's write skill |
State persisted at .data/state/batch-{run_id}.json. Schema:
{
"run_id": "batch-{timestamp}",
"topic": "...",
"status": "PENDING | RUNNING | DONE | FAILED",
"units": [...],
"parallel": 3,
"created_at": "ISO-8601",
"completed_at": "ISO-8601 | null"
}
explorer: { model: haiku, tools: [Read], constraint: "scope analysis only, no writing" }
decomposer: { model: sonnet, tools: [], constraint: "produce unit specs, verify independence" }
unit_agent: { model: varies, isolation: worktree, constraint: "run assigned skill, write to assigned output path only" }
synthesizer: { model: opus, tools: [Read, Write], constraint: "merge outputs faithfully, no hallucinated content" }
workflow instead.See references/decomposition-guide.md for split strategies, anti-patterns, and merge strategies.