What you get
What you get
| Safeguard | Default & cap | What it prevents |
|---|---|---|
| Builder Git worktrees | One linked worktree per code builder under <project>/.worktree/<agent>-<task> | Two builders overwriting each other’s edits in the same working tree |
| Heavy-job queue | 2 slots default (1–4 configurable, machine-wide) | Four parallel cargo test or Playwright suites saturating CPU and RAM |
| Managed dev servers | Free port assigned; 3 per agent, 12 per computer | Port collisions, leaked background servers, and unguarded home-folder access |
| Shared dev stack | 1 workspace-owned stack in .cmdbrief/project.yaml (opt-in) | Every crew member booting its own Docker Compose or database copy |
Running several coding agents in one repository fails in predictable ways: colliding edits, four test suites pegging every core, duplicate dev servers fighting over port 3000, and leads getting interrupted every ten seconds by individual status pings. CmdBrief pairs per-builder Git worktrees, a machine-wide heavy-job queue, guarded dev servers, file claims, and batched crew digests so parallel crews stay fast and predictable.
Isolate code builders in Git worktrees
You do thisProject panel or .cmdbrief/project.yaml
When a project uses Git worktree mode (git: worktree, toggleable in the project panel), each code builder a lead starts with cmdbrief_agent_start receives its own linked worktree at <project>/.worktree/<agent>-<task> on a dedicated branch. CmdBrief writes /.worktree/ to .git/info/exclude (never dirtying your tracked .gitignore), stores agent transcripts in the main checkout so history outlives the worktree, and shares pnpm package stores across worktrees.
- Scope of automatic worktrees: CmdBrief creates worktrees for the code builders a lead agent starts. For standalone sessions you launch yourself, use separate checkouts or
claude --worktree(see Run multiple Claude Code sessions). - Branch handback: When a builder’s commits land on the integration branch (
origin/HEAD,main, ormaster), CmdBrief notifies the lead automatically with the branch name, commit count, and latest commit subject. - Automatic cleanup with branch preservation: Once the lead parks the builder (
cmdbrief_agent_park) or closes its pane, CmdBrief sweeps merged, clean worktrees off disk while keeping their Git branches (restarting that member later recreates a worktree from its branch). Dirty or unmerged worktrees are kept and reported. - Worktree upkeep: Background checks scan every 6 hours, and leads can inspect or clean landed worktrees and build outputs with
cmdbrief_worktree_upkeep. - Cargo worktree note (0.5.100+): CmdBrief never copies compiled Rust artifacts between checkouts, so a worktree’s first Rust build compiles its dependencies cleanly with
CARGO_INCREMENTAL=0set automatically to keep build folders compact.
Check it worked
- Project checkout
git worktree listEach active code builder appears under<project>/.worktree/<agent>-<task>on its own branch.
Tune the machine-wide heavy-job queue (1–4 slots)
You do thisSettings › Coordination › Heavy jobs, or sidebar shared-machine strip › Adjust limits…
Every workspace on your computer shares one heavy-job queue. By default, 2 heavy jobs run at once; adjust Heavy jobs at once between 1 and 4 in Settings › Coordination › Heavy jobs (or via Adjust limits… in the sidebar’s shared-machine panel).
- Automatic shims on `PATH`: With workspace coordination on, CmdBrief places lightweight shims for
cargo,npm,npx,pnpm, andplaywright(plusxcodebuildandxcrunvia Device Hub) first onPATHinside agent shells. - What takes a slot: Full suites and builds—
cargo test,cargo nextest run,npm test,pnpm test,test:unit,e2e,playwright test,vitest run,jest,cypress run, andxcodebuild build|test|build-for-testing|test-without-building|archive. - What passes straight through: Focused single-file or filtered tests (
cargo test <filter>,-p <crate> <filter>,*.spec.*,*.test.*,-t/--grep), watch modes,--help,npm ci,pnpm install,cargo check,cargo clippy,pnpm lint, andpnpm typecheck. - Explicit MCP tools: For unshimmed heavy commands—or sandboxed Codex runs whose shell cannot open CmdBrief’s socket—agents call
cmdbrief_heavy_acquire(kind:build,test,e2e,simulator_build,install),cmdbrief_heavy_release, andcmdbrief_heavy_list. - Timeouts & bypass: Shims wait up to 5 minutes in queue (exiting 75 and naming slot holders if still full); any slot auto-releases after 30 minutes or when its shim exits. Set
CMDBRIEF_HEAVY_SHIM=offfor a one-off bypass, orCMDBRIEF_NPM_REUSE=offto disable safenpm cinode_modulesreuse.
Check it worked
- Sidebar shared-machine stripClick the strip while two agents run full test suitesActive holders show their tool, subcommand, and elapsed time; extra full runs queue first-come until a slot frees.
Coordinate edits with file claims and crew digest reports
An agent can do thisWorkspace coordination room & Workspace settings
All panes in the same repository—including every linked worktree—share one local coordination room behind runtime/control.sock.
- File claims (shared checkout): Agents declare edit intentions with
cmdbrief_files_claim(up to 128 paths; directories include descendants). Claims are advisory: overlapping claims warn both agents and clear automatically on commit or turn end (or viacmdbrief_files_release). - Branch claims (worktrees): In linked worktrees, CmdBrief derives claims automatically from
git diff --name-only <default>...HEADrather than manual intent calls, warning both agents if two branches touch the same file. - Shared contracts: Listing shared interfaces under
contracts:in.cmdbrief/project.yamlsends every active agent anfyi(without waking idle turns) whenever a commit modifies those paths. - Crew digest reports: Instead of interrupting the lead for every individual report, CmdBrief bundles crew
report/fyimessages and 5-minute idle notices into one compact digest. By default (Auto), a report waits 5 minutes after its sender stops (2 minutes under 5-minute prompt cache), 1 minute after the whole crew finishes working, or at most 15 minutes if the sender keeps working—and steers immediately into a lead that is already in a turn. Adjust per workspace in Workspace settings › Crew reports reach the lead or Stage Options › Crew reports: Auto, Right away, 1 min, or 15 min. Direct requests (kind: request) andinterruptmessages always bypass the hold.
If it fails
A shim exits with code 75 naming heavy-job slot holders
The queue waited 5 minutes without a free slot. Run a focused filtered test (which bypasses the queue), wait for the active full run, raise Heavy jobs at once (up to 4), or offload builds to a Linux build machine.
A sandboxed Codex command prints a “no heavy-job slot” note
Codex’s sandbox blocks the shim from opening CmdBrief’s socket. The note instructs the agent to take a slot explicitly via
cmdbrief_heavy_acquireand release it withcmdbrief_heavy_release.dev_stackdoes not start when the crew startsYou do this
Check that
.cmdbrief/project.yamlhas all three required keys (start,url,health) and that you clicked Allow on the confirmation prompt (or answeredhost:dev-stack:in Needs you).A worktree was not removed after the builder parked
CmdBrief only sweeps worktrees that are clean and merged onto the integration branch. Commit or merge remaining changes (or check
git statusinside.worktree/<name>) before removing it.The lead waits too long for crew progress reports
Switch Options › Crew reports on Stage from Auto to 1 min or Right away (or let the lead call
cmdbrief_wait_foron a specific peer’s report, which delivers immediately).
Questions
Does CmdBrief create Git worktrees for sessions I open manually?
No. CmdBrief creates linked worktrees under .worktree/ for the code builders a lead starts in git: worktree mode. For manual sessions you open yourself, use separate checkouts or claude --worktree.
Do focused unit tests wait in the heavy-job queue?
No. Single-file and filtered runs (such as cargo test <filter>, -p <crate> <filter>, *.spec.*, *.test.*, or -t/--grep), as well as cargo check, cargo clippy, pnpm lint, and pnpm typecheck, pass straight through without taking a slot.
Can a shared dev_stack run commands automatically when I open a repo?
Never. CmdBrief never starts a dev_stack at launch or without approval. On first crew start it displays the exact start, stop, and reset commands for your explicit Allow, and re-prompts whenever any of those commands change.
Are file claims hard locks that block edits?
No. File claims (and worktree branch claims) are advisory—they warn overlapping agents immediately so they coordinate or stay in their lane without stalling tool execution.
Still unsure? Write to [email protected] or use the contact form. Contact CmdBrief →
Primary sources
Provider terms and product behavior can change. Confirm plan, pricing, model, and permission details in the current official documentation.