On this page
Multi-Agent Workflow
Coordinate parallel AI coding agents with shared metacognitive custody: scoped task leases, fleet overlap checks, isolated worktrees, and clean handoffs.
Decapod supports concurrent work across multiple engineers and multiple coding agents on the same repository—whether two teammates use Codex and Claude Code in parallel, or several agent workers tackle distinct slices of one codebase.
The Coordination Model: Lease, Isolate, Inspect
Decapod coordinates parallel work through explicit custody and isolated filesystems:
- Scoped Task Claims & Leases: Agents acquire exclusive or shared custody with
decapod todo claim --id <id> --lease-seconds 3600(default exclusive;--mode sharedjoins as secondary owner). Leases expire automatically if abandoned unless renewed viadecapod todo renew --id <id>. - Overlap Inspection (
todo fleet): Before modifying overlapping files or paths, agents rundecapod todo fleetto inspect active leases, expired claims, and path/scope overlaps across the repository (tests/unit/core/fleet_coord_tests.rs). - Worktree & Container Isolation: Each claimed task runs in its own Git worktree via
decapod workspace ensure --branch agent/<agent-id>/<task-id>-<topic>, optionally wrapped in Docker via--containerwhencontainer_workspaces = true(see Workspace Isolation). - Explicit Handoffs & Yields: When passing a task to another engineer's agent or a specialist reviewer, use
decapod todo handoff --id <id> --to <receiver> --summary "..."(which advances the lease generation and re-issues the lease) ordecapod todo yield --id <id>(which releases exclusive lease capacity without archiving the task).
decapod todo fleet --format json
decapod todo claim --id <task-id> --lease-seconds 3600
decapod workspace ensure --branch agent/<agent-id>/<task-id>-<topic>
Shared Context Without Shared Dirty Trees
While each agent edits files in an isolated worktree, durable project context stays shared:
- Tasks, scope & governance: Task state lives in
.decapod/data/decapod.db(backend = "local") or the authorized Decapod Cloud service (backend = "cloud"; see Cloud project routing and Organization Admin for repository enrollment, seat assignments, and teammate access policies), while plans, claims, trajectories, and living specs live in.decapod/governance.jsonand.decapod/managed/specs/*. - Aptitude & federated knowledge: Agents can record and retrieve project conventions and procedural observations via
decapod data aptitudeanddecapod data federation. - Heartbeats & presence: Agents can record liveness via
decapod todo heartbeatand renew active leases viadecapod todo renew.
Concrete journey: two engineers using different agents in parallel
Suppose Engineer A (using Claude Code) works on authentication (src/auth/) and Engineer B (using Codex) works on CLI formatting (src/cli/):
- Both agents run
decapod session acquirewith distinctDECAPOD_AGENT_IDvalues, checkdecapod todo fleet, and claim separate tasks with disjoint scopes. - Each agent calls
decapod workspace ensureto obtain its own worktree and branch. Uncommitted edits, build caches, and test runs never collide on disk. - If Engineer B's task later needs a file Engineer A already claimed,
decapod todo fleetsurfaces the path/scope overlap. Rather than silently overwriting work, the engineers coordinate viadecapod todo handoff, sequential ordering, or separate commits. - When Engineer A merges to
masterfirst, Engineer B's earlier validation becomes stale relative to the moved target. Engineer B reconcilesmasterinto their worktree, resolves any Git conflicts, checkpoints the merge, and runsdecapod validateon the exact merged commit before PR readiness.
What shared governance does NOT guarantee (Negative Cases)
- No conflict-free edits to identical files: If two parallel branches edit the same lines of the same file, Decapod does not magically auto-merge them. Standard Git conflict resolution, human code review, CI, and fresh validation still apply.
- Conflicting claims: An active exclusive lease owned by Agent A blocks Agent B from claiming the same task until Agent A runs
todo handoff,todo yield,todo release, or the lease expires. - Expired custody: Letting a
--lease-secondswindow lapse withoutdecapod todo renewexposes the claim as expired indecapod todo fleetand prevents stale custody from blocking progress forever. - Stale proof across concurrent merges: A passing
decapod validaterun before an upstreammastermove or rebase does not authorize publication; revalidation against the exact current candidate and accepted target is mandatory. - Cloud access boundaries: In
backend = "cloud"mode, parallel engineers on separate machines share live task custody only when the hosted service authorizes each principal for that repository (repository_deniedoraction_requiredhalts without falling back to local SQLite).