Run multiple Claude Code agents in parallel, and stop copy-pasting between them
Running several Claude Code sessions at once is no longer the hard part. claude -w feature-auth, then the same again with another name, and you have two agents working two branches. The hard part arrives a day later, when the session that fixed the migration has information the session still coding against the old schema does not.
This post is about that second half: the collisions that are visible, the assumptions that are not, and the handoff layer that keeps you out of the middle.
Give every session its own checkout
claude -w feature-auth (or claude --worktree feature-auth) creates an isolated git worktree under .claude/worktrees/feature-auth on a branch named worktree-feature-auth. Running the command again with a different name in another terminal gives you a second isolated session. Add .claude/worktrees/ to .gitignore so the copies stop showing up as untracked files.
The isolation is real but partial. A worktree is a fresh checkout, so gitignored files like .env are absent and dependencies are not installed. List the ignored files you need in a .worktreeinclude at the repo root, using .gitignore syntax, and Claude Code copies them into every worktree it creates.
This removes the first failure mode, two agents writing the same file. It removes nothing else. Your agents now have separate files and separate histories, which means they can disagree without either one raising an error.
Give the review to a different agent
The cleanest place for a second agent is review, because the value is obvious: a reviewer that did not write the code sees things the author stopped noticing. The docs recommend a small custom subagent in .claude/agents/reviewer.md with tools: Read, Grep, Glob, so it can read and search but not edit. That limit is enforced by Claude Code, not requested in a prompt.
Point it at the spec, not at the diff. “Reviewing code you didn’t write, compare the changed files against the spec, report only gaps that affect correctness, skip style” is roughly the shipped example, and the style clause matters: a reviewer asked to find problems will always find some.
That is one agent reviewing another inside one session. If you are trying to decide between subagents, agent teams and something outside the harness, the comparison of those three covers the mechanics. The point here is smaller: review is worth a second context window, and it costs one subagent definition.
Start clean, and name the session
Two habits do more for parallel work than any tool. The first is /clear between unrelated tasks; a focused context answers better and costs less, and /clear <name> lets you leave the old session named so you can come back to it. The second is naming: claude --name api at launch, or /rename inside a session.
Names matter beyond tidiness, because a name is how another session addresses this one. A session called api can be told what happened; a session called nothing has to be found first.
The handoff is still yours
Here is the part worktrees don’t touch. Session A discovers the API now returns a paginated object. Session B is still building against the flat array. There is no git conflict, no error, no test failure in B: just work that has to be thrown away later. File collisions are loud; stale assumptions are silent.
Claude Code now has a built-in answer for some of this. Cross-session messaging lets Claude discover your other sessions with ListAgents and send with SendMessage, with no setup on 2.1.224 or later (2.1.248 on Bedrock and the other cloud providers when feature-flag fetching is off). A message is read between tool calls during a turn, or starts a turn when the session is idle. If every session you run is Claude Code, start there; the three routes compared explains what it does and where it stops.
Where it stops is the harness boundary. It speaks Claude Code to Claude Code. The docs describe no channels or broadcast, and no inbox for you, and an OpenCode or omp session is not on the list.
Names and channels across harnesses
asenq is a local messenger that gives every session a name and moves text between harnesses. Setup is one command and reversible, covered in the routes overview; the part that matters for parallel work is what the names let you do.
Name sessions at launch:
claude --name orch
ASENQ_NAME=worker-oc opencode
ASENQ_NAME=worker-omp omp
Those names survive restarts. When a worker comes back, it keeps its name, its channels and anything queued for it, so you are not re-establishing who is who every morning.
Direct messages are the simple case: asenq send worker-oc "the schema changed, rebase before you continue", or asenq_send from inside an agent. You get asenq inbox for messages addressed to you and asenq tui for a console over sessions, inbox, channels and activity.
Channels are the part that scales past three sessions. A channel is a durable named stream with a roster:
asenq channel create billing
asenq channel add billing orch
asenq channel add billing wrk-api
asenq channel add billing wrk-ui
A post to a channel is stored and read on demand; it becomes a delivery only when it mentions someone. Mentions cover a name (@wrk-api), a role (@wrk, @orch) or @all. An unknown or ambiguous mention fails the whole post rather than half-delivering it, which is the right default when a typo would otherwise page nobody.
Broadcast has a scope worth knowing. Sending to "*" reaches every live session that shares a channel with you, once each. A sender in no channel falls back to machine-wide. Your own broadcasts are machine-wide, and you are never a target.
The human side of this is not an afterthought. Held messages are the part I use most: set a session’s inbound policy to hold and agent-sent direct messages wait for your decision instead of landing in an agent’s turn. asenq held lists them, asenq release <id> delivers one, asenq drop <id> discards it. Messages you send bypass hold, but not refuse.
A setup that works
Four terminals, one channel, one rule about who owns which files.
# terminal 1
claude --name orch
# terminal 2
claude --name wrk-api --worktree api
# terminal 3
ASENQ_NAME=wrk-ui opencode
# terminal 4
asenq setup # only if wiring or skills changed
asenq channel create billing
asenq channel add billing orch
asenq channel add billing wrk-api
asenq channel add billing wrk-ui
Then asenq send wrk-api "..." for a direct handoff, asenq channel send billing "@wrk a paginated response lands on main, rebase" for the group, and asenq held when a worker asks you to approve something.
When parallel is the wrong shape
Parallel sessions pay off when the work is genuinely independent: separate modules, a migration on one branch and a UI change on another. They cost you when the work is sequential, when two tasks touch the same files, or when one decision blocks the next. Anthropic’s guidance for agent teams says the same thing: for sequential tasks, same-file edits or work with many dependencies, a single session or subagents do better. Four sessions on four dependent tasks is four contexts waiting on each other.
What this does not solve
asenq moves messages. It does not spawn sessions, keep a task board, merge worktrees, relay through a cloud or run on Windows. It will not decide who does what or pick up a dropped task; you still own the plan. What it does add is the surface to run one: a role for the lead, a skill for each side, channels, threads and control messages. Orchestration lives in the skill and the workflow, not in a managed engine.
If you want Claude itself to decompose the work and have workers coordinate inside one session, that is what agent teams are for (docs), and it is a different tool for a different job.
One thing no messenger fixes: delivery is not comprehension. A message that arrives proves the text arrived. If the handoff matters, ask for a reply and check that the work changed.
Related
- Can Claude Code sessions talk to each other? Three routes: /blog/claude-code-sessions-talk-to-each-other/
- Agent-to-agent communication in Claude Code: every option, honestly compared: /blog/claude-code-agent-to-agent-communication/
- Subagents vs agent teams vs local messaging: /blog/claude-code-subagents-vs-agent-teams-vs-local-messaging/
- How asenq delivers messages: /blog/how-asenq-delivers-messages/
Sources
- Claude Code best practices, including the reviewer subagent and
/clearcadence: https://code.claude.com/docs/en/best-practices - Claude Code worktrees (
--worktree,.worktreeinclude, cleanup): https://code.claude.com/docs/en/worktrees - Claude Code cross-session messaging (versions,
ListAgents/SendMessage, delivery timing): https://code.claude.com/docs/en/cross-session-messaging - Claude Code agent teams: https://code.claude.com/docs/en/agent-teams
- asenq commands, channels, mentions, broadcast scope and hold/release/drop: https://github.com/parciffal/asenq
- asenq delivery mechanics: https://github.com/parciffal/asenq/blob/main/docs/how-delivery-works.md