Running Two Claude Code Agents on the Same Repo with Git Worktrees

Running multiple Claude Code agents on the same repository simultaneously has been achieved using git worktrees. Each agent gets its own branch and dedicated working directory on disk, eliminating file conflicts and allowing reading/writing without interference.
Workflow
- Create a git worktree for each branch.
- Open a separate Claude Code session in each worktree directory.
- Let the agents run in parallel — they are unaware of each other.
- When both finish, merge the branches via normal git merge.
Practical Example
# Create a worktree for a feature branch
git worktree add ../repo-feature feature-branch
# Create a worktree for a bugfix branch
git worktree add ../repo-bugfix bugfix-branch
In each directory, start Claude Code
cd ../repo-feature && claude-code .
cd ../repo-bugfix && claude-code .
Benefits
Speed improvement is real for parallelizable work: one agent fixing a bug while another drafts a new feature, or a refactor alongside test coverage. Not every task splits cleanly, but genuinely independent concerns benefit. User reports having one agent fixing a bug and another drafting a feature simultaneously without conflict.
Considerations
The user asks about reliability for longer-running tasks and whether merge conflicts become a problem at scale. Standard git merge resolution applies when merging worktree branches back.
Who It's For
Developers using Claude Code who want to parallelize independent tasks on the same codebase.
📖 Read the full source: r/ClaudeAI
👀 See Also

Claude Code hooks prevent Chrome tab interference between multiple sessions
A developer created three hooks (session-start, capture-tab-id, enforce-tab-id) that pin each Claude Code session to its own Chrome tab, preventing sessions from accidentally accessing other sessions' tabs during test runs and form fills.

I design with Claude more than Figma now — Jane Street designer workflow
A Jane Street designer describes how Claude Code replaced Figma for prototyping, saving weeks of back-and-forth. Prototype features ship as real code, not mockups.

Hearth: Self-Hosted Multi-User AI Chat App for Households on OpenClaw
Hearth is a self-hosted household AI chat app built on OpenClaw that provides separate accounts and conversations for each family member, with features including PIN/biometric login, private chats, reminders, and model presets.

Apfel: Free CLI Tool to Access Apple's On-Device LLM on macOS
Apfel v0.6.13 is a Swift 6.3 binary that exposes Apple's built-in LLM as a CLI tool, OpenAI-compatible server, and interactive chat. It runs 100% on-device with no API keys or costs, using the 4,096-token model shipped with macOS 26+ on Apple Silicon Macs.