Claude Code Kit

Features · Parallel work

Parallel work

Worktrees and dependency-ordered batch execution. One session can implement multiple epics in parallel without file conflicts — because each agent works in its own directory tree.

Worktrees

One checkout per agent. No collisions.

isolation: worktree in an agent definition tells Claude Code to create a temporary git worktree before invoking the agent. The agent works in that separate directory tree. Its file edits do not touch the main checkout. Two agents editing the same file in parallel do not stomp each other.

The worktree is cleaned up automatically if the agent makes no changes. Otherwise it is kept for review — merge or discard explicitly.

  • .worktreeinclude

    Ships with the kit. Lists gitignored files — .env, .claude/local.json — that should be copied into the new worktree so it can run. Without this file, a worktree agent starts without credentials and fails silently.

  • .gitignore adds .claude/worktrees/

    Worktree state never gets committed. The worktrees directory is the kit's internal scratch space.

  • Auto-remove on no changes

    If the agent made no edits, the worktree is removed without prompting. Only actual changes require explicit merge or discard.

Named antipattern

Shared-checkout parallel agents.

Running two parallel agents in the same checkout is the antipattern the kit names explicitly. Symptoms: silent overwrites on conflicting edits. broken pre-commit hooks because two processes are racing on .claude/state.json. race conditions surface as intermittent test failures rather than explicit errors.

The fix is the worktree flag. Use isolation: worktree. Each agent gets its own directory tree. Edits do not collide.

Parallel batch execution

Dependency-ordered. Merge after the batch.

The planner agent groups epics into batches by dependency order. Each batch contains task files; each task file is a self-contained agent instruction. The build dialog dispatches all tasks in a batch in parallel — each in its own worktree — then merges every worktree and runs the test suite before moving to the next batch.

Plan state stays coherent because the planner is the sole writer to __plan/. Even if three dialogs run simultaneously, plan state has one home. The standard forwarding convention is "pass to the planner: <finding>" — any dialog can hand the planner a blocking discovery; only the planner writes back.

Task file template

The atomic unit of parallel work.

Each task file is self-contained: an agent can pick it up, execute it, and return a result without any other context. The sections are fixed — What, Dependencies, Files (absolute paths), How, Definition of Done, Activation Task, Out of scope.

What
  One sentence describing the deliverable.

Dependencies
  List every symbol, file, or task that must exist first.
  If a dependency doesn't exist yet, flag to planner.

Files
  /absolute/paths/only — no relative refs

How
  Step-by-step numbered list.

Definition of Done
  Checklist. Includes: Activation Task.

Activation Task
  One command + expected output + where it lands on disk.
  status: done requires this task to have produced its output.

Out of scope
  Explicitly list what this task does not do.

The Activation Task is mandatory. Tests passing is code-complete, not done. done requires the activation task to have produced its expected output.

Status vocabulary

Six values. No synonyms, no aliases.

not started

No work begun.

partial

Work begun, not all steps complete.

code-complete

Code written and passing tests. Activation task not yet run.

done

Activation task produced its expected output. code-complete is not done.

blocked

Cannot proceed — dependency unmet, named blocker.

superseded

Task replaced by a later task. Not abandoned — explicitly superseded.