Skip to main content

🌴 Claude-Worktree

Run multiple Claude Code instances in parallel without stepping on each other. This CLI creates isolated git worktrees for each Claude session, so you can work on different features simultaneously while keeping your main branch clean.

Inspired by a script from aaazzam.

🚀 Quick Start

Jump right in without installing anything:

uvx claude-wt new "implement user authentication"

That's it. You're now working in a clean branch where Claude can't mess up your pristine codebase.

Installation Options

If you prefer global installation:

uv tool install claude-wt

Or from source:

git clone https://github.com/anthropics/claude-wt.git
cd claude-wt
uv install -e .

🎯 Commands

✨ Start Fresh: new

Spin up a new isolated Claude session:

uvx claude-wt new "implement user authentication"

Behind the scenes: creates a timestamp branch, sets up a worktree in .claude-wt/worktrees/, and launches Claude with your query.

Want a memorable branch name? Use --name:

uvx claude-wt new "fix the parser" --name parser-fix

Need to branch from a specific source? Use --branch:

uvx claude-wt new "hotfix for prod" --branch main --name hotfix-123

🔄 Pick Up Where You Left Off: resume

Claude sessions are like good TV shows—you want to continue watching:

uvx claude-wt resume 20241201-143022

The session ID is shown when you create it.

📋 See What's Running: list

See all your active worktrees:

uvx claude-wt list

Shows each session with its health status.

🧹 Clean Up: clean

Remove a specific session when you're done:

uvx claude-wt clean 20241201-143022

Or clean everything:

uvx claude-wt clean --all  # The Marie Kondo approach

🔧 How It Works

Think of it like having multiple parallel universes for your code:

  1. Branch Creation → Each session gets its own branch (claude-wt-{timestamp} or your custom name)
  2. Worktree Setup → Creates a separate directory in .claude-wt/worktrees/ so files don't conflict
  3. Claude Launch → Starts Claude in the isolated environment with full repo access
  4. Session Management → Resume, list, and clean up sessions effortlessly

🎁 Why You'll Love This

  • Fear-Free Experimentation → Claude can't break your main branch even if it tries
  • Mental Clarity → No more "did I commit that test code?" anxiety
  • Context Switching → Jump between different Claude conversations effortlessly
  • Easy Cleanup → One command to remove all experimental branches
  • Clean History → Your main branch stays pristine for serious work

📋 What You Need

  • Python 3.12+
  • Git with worktree support (any recent version)
  • Claude CLI (installed and authenticated)

🛠️ Development

Uses uv for dependency management:

uv sync
uv run claude-wt --help

Or test changes without installing:

uvx --from . claude-wt --help

Built with the assumption that your Claude sessions shouldn't be a game of git-roulette with your main branch.

Metadata

Release files for claude-wt 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-wt 0.2.0
File Size Uploaded
claude_wt-0.2.0.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-wt 0.2.0
File Interpreter ABI Platform
claude_wt-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / claude_wt-0.2.0.tar.gz

Download URL claude_wt-0.2.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6272818bdffc719e325b134ef4eed192f0f7740e47d2ce5222df421bf7181952
BLAKE2b-256 checksum
How to use checksums
51538519c4471b4b2b536a7034d3ea253eac81a10c4674a7e0c6274c741be86f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.19

Release files / claude_wt-0.2.0-py3-none-any.whl

Download URL claude_wt-0.2.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7f28ba971ad63ab1dfaac3b6cd572acce059b25ca11d5fcc21b305d8365831b
BLAKE2b-256 checksum
How to use checksums
2e5d837364ec3499c8481d44992a400d07c0ccab6101d7a4fcdeda5230451cad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.19

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page