CLAUDE LABJP
AGENTS — When you create a Managed Agents session, pass agent_with_overrides to swap the model, system prompt, tools, MCP servers, or skills for that single sessionKEYS — API keys in the Claude Console can now carry an expiration (a preset, a custom duration, or Never), with an email reminder before keys that live 7 days or longer expireMCP — Admins can provision MCP connectors org-wide through their identity provider, starting with Okta, so users get connector access automatically on first loginWORKBENCH — The legacy Workbench at platform.claude.com/workbench retires on August 17, along with the experimental prompt generate, improve, and templatize APIsREVIEW — Claude Code adds a background /code-review so you can keep working while a review runs, with better MCP and Windows path handling alongsideFASTEND — Fast mode for Claude Opus 4.7 is removed today, July 24. Any speed: 'fast' calls need to move over to Opus 4.8AGENTS — When you create a Managed Agents session, pass agent_with_overrides to swap the model, system prompt, tools, MCP servers, or skills for that single sessionKEYS — API keys in the Claude Console can now carry an expiration (a preset, a custom duration, or Never), with an email reminder before keys that live 7 days or longer expireMCP — Admins can provision MCP connectors org-wide through their identity provider, starting with Okta, so users get connector access automatically on first loginWORKBENCH — The legacy Workbench at platform.claude.com/workbench retires on August 17, along with the experimental prompt generate, improve, and templatize APIsREVIEW — Claude Code adds a background /code-review so you can keep working while a review runs, with better MCP and Windows path handling alongsideFASTEND — Fast mode for Claude Opus 4.7 is removed today, July 24. Any speed: 'fast' calls need to move over to Opus 4.8
Articles/Claude Code
Claude Code/2026-04-02Intermediate

Parallel Development with Claude Code Worktrees

A practical look at running parallel tasks with Claude Code and Git worktrees. Learn how to isolate branches into separate directories so context switches stay cheap, with the rough edges I hit while actually running this day to day.

Claude Code201worktree3parallel developmentGit4workflow37

Premium Article

A production bug lands while you are mid-feature. A second change is tempting while the first one waits in review. Running several of my own apps in parallel, I hit these interruptions constantly, and every branch switch threw away build cache and the context in my head. Git worktrees paired with Claude Code remove that friction physically. Here is how I keep multiple development contexts isolated and running side by side, at the implementation level.

Working solo on both an iOS and an Android app at once, I used to make small mistakes constantly before worktrees: fixing one app would quietly break the other app's build environment. Separating the workspaces themselves made that whole class of mix-up far less likely, which is what prompted this write-up.

Why Parallel Development Matters

Traditional Git workflows follow a linear model: create branch → develop → await review → merge. While this works for sequential tasks, real-world project management demands parallel execution:

  • Production hotfixes occur while feature development is in progress
  • Code review processes create natural waiting periods for context switching
  • Multiple team members work on different features simultaneously

The cost of context switching in traditional workflows is substantial. Each branch switch requires:

  • Full working directory reconstruction
  • Build cache invalidation
  • Tool state reinitialization
  • Mental context reload

Git worktrees eliminate these inefficiencies by maintaining multiple independent working trees simultaneously, allowing near-zero-cost context switching.

Understanding Git Worktree Fundamentals

What Is a Worktree?

A Git worktree enables managing multiple branches across separate directory trees while sharing a single Git repository metadata (.git directory).

# Traditional workflow (sequential)
git checkout main
git checkout feature-X
git checkout bugfix-Y
 
# Worktree workflow (parallel)
git worktree add ../main-work main
git worktree add ../feature-X-work feature-X
git worktree add ../bugfix-Y-work bugfix-Y
# All three directories exist simultaneously

Core Benefits

  • Physical isolation - Each worktree maintains its own working directory while sharing repository metadata
  • Zero-cost switching - Change directories instead of checking out branches, preserving editor and build state
  • True parallelism - Multiple Claude Code sessions operate independently
  • Performance - Individual worktrees enable faster git operations on large repositories

Worktree and Branch Constraints

Critical limitation: One branch cannot be checked out in multiple worktrees simultaneously. This preserves Git state consistency.

# Invalid: same branch in two worktrees
git worktree add work1 main
git worktree add work2 main  # Error: branch 'main' already checked out
 
# Valid: create new branch for second worktree
git worktree add work1 main
git worktree add work2 -b feature/new-task

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Step-by-step setup for parallel development using worktrees with practical command reference
How to run multiple Claude Code sessions simultaneously for maximum productivity
Advanced branch isolation techniques and troubleshooting for complex workflows
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude Code2026-03-25
Claude Code Worktree — Maximize Productivity with Parallel Development
Master parallel branch development with Claude Code's --worktree flag. Work on multiple features simultaneously without switching overhead.
Claude Code2026-07-19
A Committed Symlink That Points Outside the Worktree — Auditing Repos Before You Let AI Spin Up Parallel Trees
Claude Code 2.1.212 fixed a bug where a committed symlink under .claude/worktrees could be followed during worktree creation and write outside the repo. The patch closes the following side. Here is an audit script for the committed side, plus a quarantine workflow.
Claude Code2026-06-24
Working Between Claude Design and Claude Code — Splitting Diverge and Converge
Rough design in Claude Design, fine detail in Claude Code. Now that the two live close together in the desktop app, here is how to run them as a divide-of-labor between diverging and converging — bridges like Link Local code and Send to included.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →