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

✍️ OpenClawRadar📅 Published: May 11, 2026🔗 Source
Running Two Claude Code Agents on the Same Repo with Git Worktrees
Ad

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 .

Ad

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

Ad

👀 See Also

Hollow Agent OS: Local AI workers call Claude as senior architect when stuck
Tools

Hollow Agent OS: Local AI workers call Claude as senior architect when stuck

Hollow Agent OS uses local Qwen models that run 24/7, but when they hit logic errors or need major changes, they trigger a Claude call via MCP. Claude reorganizes file structures, reviews code, and acts as a manager for autonomous local workers.

OpenClawRadar
Open Source GTM Plugin for Claude Code with 166 Marketing Skills and Bootstrap Command
Tools

Open Source GTM Plugin for Claude Code with 166 Marketing Skills and Bootstrap Command

A developer has released an open source Go-To-Market plugin for Claude Code that provides 166 specialized marketing skills across SEO, content, outbound, sales, growth, analytics, strategy, ads, social, CRM, and AI search. The plugin includes a /bootstrap command that interviews users about their brand to generate personalized context files.

OpenClawRadar
Jork Agentic Framework Built with Claude Ranks Top 10 in $4M Hackathon
Tools

Jork Agentic Framework Built with Claude Ranks Top 10 in $4M Hackathon

A developer built an agentic framework called Jork using Claude and GLM models that ranked Top 10 among 2000+ applications in a $4 million hackathon. The framework autonomously developed tools including a Solana launchpad radar and a working word search game.

OpenClawRadar
Microsoft VibeVoice: 60-Min ASR and 90-Min TTS Models Open-Sourced
Tools

Microsoft VibeVoice: 60-Min ASR and 90-Min TTS Models Open-Sourced

VibeVoice is a family of open-source voice AI models from Microsoft including ASR (60-min single-pass, speaker diarization, 50+ languages) and TTS (90-min multi-speaker, real-time streaming). Uses 7.5 Hz continuous speech tokenizers and next-token diffusion.

OpenClawRadar