Skip to content
Kalvyr
Features Free & Pro Docs
Get Kalvyr

Running multiple Claude Code agents at the same time

Guide · 29 November 2026

The short answer

Yes, you can run several Claude Code agents in parallel. Start one session per task, in separate terminals or in the background. If the tasks touch different parts of the project, give each agent its own git worktree so they can't overwrite each other. Then keep an eye on where each one is editing.

  1. Four ways to run several agents
  2. How to split the work
  3. What goes wrong
  4. How to keep track of every agent
  5. Questions

Four ways to run several agents

Every Claude Code session is its own agent with its own conversation. Running several at once is just starting several sessions. What changes between the options below is whether the agents share one copy of your files.

1. Separate terminals in one folder

The simplest setup: open two or three terminals in your project and run claude in each. Every agent sees the others' changes straight away, which is useful when one writes an API and another writes the page that calls it.

The catch is that they share the same files. Nothing stops two of them from editing the same one, so this works best when each agent has a clearly separate area (see How to split the work).

2. One git worktree per agent

A git worktree is a second working copy of your repository on its own branch. Agents in different worktrees edit different copies, so they can't overwrite each other. Their work comes together when you merge the branches. Recent versions of Claude Code create one for you:

$claude --worktree checkout-form

Add --tmux to open it in its own tmux session. With plain git, create the worktree yourself and start Claude Code inside it:

$git worktree add ../shop-checkout -b checkout-form

Each worktree needs its own dependencies installed, and two dev servers need two ports. When an agent finishes, review its branch and merge it like any other.

3. Background sessions

To start an agent without keeping a terminal open for it, recent versions of Claude Code have background sessions:

$claude --bg "Write tests for the checkout form"

claude agents lists what is running, and claude attach opens a session in your terminal when you want to step in. Run claude --help to see which of these your version has.

4. Codex next to Claude Code

Claude Code and Codex are separate programs, so you can run both on the same project, for example Codex on tests while Claude Code builds a feature. Everything in this guide applies to the mix: separate areas or separate worktrees, and a way to see what each is doing.

Inside a single session, Claude Code can also hand parts of a task to subagents. That is a different thing: the subagents report back to one conversation, so you still follow one agent.

How to split the work so agents don't collide

Parallel agents save time when their tasks don't overlap. A few habits keep it that way:

  • One area per agent. Split by folder or feature: one agent on server/, another on the checkout page. Say it in the prompt: “Only change files in src/checkout/.”
  • Keep shared files with one agent. Lockfiles, package.json, database migrations, route tables and shared types are where agents collide most. Pick one agent to own them.
  • Small, finished tasks. “Add validation to the checkout form” merges cleanly. “Improve the checkout” spreads across the whole project.
  • Commit often, merge one at a time. Merge one agent's branch, run your tests, then the next. A failure then points at one change.
  • Don't run more than you can review. Each agent's work still needs reading. Two to four is plenty for most people.

What goes wrong with several agents

  • Two agents edit the same file. In a shared folder, neither is told. The second write can replace the first, or an agent keeps working from a version that has already changed.
  • You lose track. With four terminals open, it's hard to say which agent is editing what, which one is waiting for your approval and which one has stopped.
  • An agent goes in circles. It rereads the same files without changing anything, often because another agent changed the code under it.
  • Merge conflicts. Worktrees move the collision to merge time. Small tasks and clear areas keep those conflicts few.

How to keep track of every agent

Without extra tools, you can switch between terminals, list background sessions with claude agents, and check git status or git diff to see which files changed. That works for two agents, and gets slow beyond that.

A live map shows it all in one place. Kalvyr is one: it maps your project into components and shows, as it happens, where each Claude Code or Codex session is reading, editing, running checks or waiting for approval. It reads the session logs the agents already write, so nothing changes in how you start them. Its terminal shows only what needs you:

⚠ 14:46  ✻ Claude Code and ◎ Codex are both editing server/api/orders.ts (Application API)
↻ 14:52  ◎ Codex reread src/checkout/form.tsx 3× without editing: it may be going in circles (Checkout)
✓ 14:58  Project checks passed
  • The ⚠ line appears when two agents edit the same file within 10 minutes, including an edit one has started but not finished. It names the file, the agents and the part of the project.
  • The ↻ line appears when an agent reads the same file three times without editing anything.
  • Kalvyr warns you; it doesn't stop either agent. The same-file warning matters most when agents share one folder, since agents in separate worktrees edit separate copies.

It runs on your computer and doesn't upload your code. Try it in your project folder (Node.js 20.11 or later):

$npx kalvyr

See the docs for every option, or what each terminal alert means.

Questions

Can Claude Code run multiple agents at once?

Yes. Each Claude Code session is its own agent, so you can start several in separate terminals, in separate git worktrees or in the background with claude --bg. A single session can also hand parts of a task to subagents.

How many Claude Code agents can I run at the same time?

There is no fixed number in the CLI. The practical limits are your plan's usage limits, which every session draws from, your machine, and how many agents you can review. Most people find two to four useful.

Should each agent get its own git worktree?

When the tasks are independent, yes: each agent edits its own copy, so they can't overwrite each other's files, and you merge the results one at a time. When agents need to see each other's changes as they happen, work in one folder and give each agent its own area.

Can Claude Code and Codex work on the same project at the same time?

Yes. They are separate programs, so you can run both on one repository. The same rules apply: give each its own area or its own worktree, and check where both are editing.

What happens if two agents edit the same file?

Neither agent is told. The second write can replace the first, or an agent can keep working from a version of the file that has already changed. Kalvyr warns you when two agents edit the same file within 10 minutes, on its map and in the terminal.

Kalvyr Watch your software take shape.
DocsMultiple agents guidePrivacyTerms
© 2026 Kalvyr