Run three Claude Code sessions on one checkout
No worktrees: sessions agree on a split, stage only their own hunks by id, and stop if the hunk count changes.
Prompt for your agent
Goal: Let several agent sessions share one repo safely. Setup: agents used in source: Claude; tools/MCPs stated: git. Steps: 1. Have sessions agree on a split by message and list the files each will touch. 2. For shared files, stage only your own changes hunk by hunk, matched by an id in the changed lines. 3. Use a small command that lists hunks and stages matching ones; if the hunk count changed between listing and staging, stage nothing and stop. Rules: ask me before anything irreversible (sending, posting, paying, deleting); don’t invent data, results or tools I haven’t given you; tell me what you couldn’t verify. Based on: Rulestack — https://dev.to/rulestack/three-claude-code-sessions-share-one-git-checkout-in-our-repo-with-no-worktrees-how-do-you-keep-5dce
Steps are from the source. Includes a “Based on” credit line.
I tried this
Tell the next builder. One anonymous answer each; click again to undo.
Agents, models and tools only what the source states
- Agents
- Claude
- Tools
- git
Sources & credit
- Rulestack @rulestack primaryDEV post · 8 Oct 2026https://dev.to/rulestack/three-claude-code-sessions-share-one-git-checkout-in-our-repo-with-no-worktrees-how-do-you-keep-5dce