Stackmark › Prompts

Run agents on parallel worktrees, not branches

git worktree gives each agent its own checkout — no stash/switch dance, no clobbered uncommitted work.

  • Type: Prompt
  • Tags: Coding Agent Hacks, Intermediate, Claude Code, Codex, Cursor
  • Updated: 2026-10-01

Prompt

git worktree gives each agent its own checkout — no stash/switch dance, no clobbered uncommitted work. If you run two agents in one repo on different tasks, one will trash the other's working tree. `git worktree add ../repo-feat-x feat/x` gives you a parallel directory pointing at the same git history. Open one editor per worktree, run one agent per editor. Implementation example: git worktree add ../myapp-auth feat/auth git worktree add ../myapp-billing feat/billing # Each is a real checkout — open in its own editor + agent cd ../myapp-auth && claude cd ../myapp-billing && claude git worktree list # see them all git worktree remove ../myapp-auth # when shipped

More prompts

Privacy · Terms · llms.txt