# How do you keep parallel Claude Code sessions from stepping on each other? — retained record

> Retained reddit record from reddit:ClaudeAI.

Canonical: https://highsignal.app/data/records/fdb1e49e637eeae2

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeAI)  published 2026-10-22 21:47 ingested 2026-10-23 02:38

[original source ↗](https://www.reddit.com/r/ClaudeAI/comments/1xcvu46/how_do_you_keep_parallel_claude_code_sessions/)

## retained text



```
I've been running several Claude Code sessions on the same repo at once, and honestly the model is the easy part. The hard part is everything they share: the checkout, the process table, origin, and me.

What I ended up with so far:

1. One git worktree per issue, cut from a fresh origin base branch, with its own branch and its own tmux session. That stops two sessions editing one checkout.
2. A PreToolUse hook that reads a per session list of globs the session owns and denies Edit and Write outside it. It also parses Bash for things like sed -i, tee and redirects, because in bypassPermissions mode the agent happily edits through Bash. If it can't tell what a command writes, it denies.
3. Another hook that blocks pkill and killall and only allows kill with a literal PID. Sessions start servers with `cmd & echo $!` and stop them by that number.
4. Workers never merge. They open a PR, write a short summary (what changed, what was checked, what wasn't) and stop. One session does all the merging, and only when the PR is green and mergeable.

What still feels off to me:

Splitting file ownership upfront takes real thought, and when I get the split wrong, the worker hits the fence and has to stop and report instead of finishing. And files generated by build steps never go through the hook at all.

So I'm curious how other people handle it:

Do you split work by files upfront, or let sessions conflict and sort it out at merge time?

Is anyone running parallel sessions without worktrees? How?

Or is it just not worth it compared to one session and a proper review?
```



document fetched 2026-10-23 00:23 · canonical https://reddit.com/r/ClaudeAI/comments/1xcvu46/how_do_you_keep_parallel_claude_code_sessions
