Git Worktree Manager with Integrated Claude Code Orchestration
Transform your multi-branch development workflow with AI-powered context isolation
Please report issues and feedback on GitHub
Why • Features • Install • Quick Start • Demo • Docs
# Switch branches loses AI context
git checkout feature-b
# Claude: "What were we working on?"
# Stash changes, lose mental state
git stash
git checkout main
git stash pop # Conflicts!
# Multiple terminals, multiple confusion
# Tab 1: feature-a
# Tab 2: feature-b
# Tab 3: Which branch am I in?? |
# Each branch has its own directory
~/project/feature-a/
~/project/feature-b/
# Each branch has its own Claude
# with full context awareness!
# Switch instantly, no stashing
cgwt -a 1 # → feature-a + Claude
cgwt -a 2 # → feature-b + Claude
# List and switch with simple commands
cgwt -l # List all projects
cgwt -la # List only active sessions |
Claude GWT gives each git branch its own:
- 📁 Dedicated directory (via git worktrees)
- 🤖 Dedicated Claude instance with persistent memory
- 🖥️ Dedicated tmux session for instant switching, and remote access
- 📝 Dedicated context that never gets lost
"It's like having a team of specialized AI assistants, each an expert in their own feature"
Connect to Claude GWT from anywhere
- 🔐 Use Tailscale to trivially create your mesh VPN
- 🤖 Use JuiceSSH/Termius to connect from Android
- 🍎 Use Termius/Blink Shell/Secure ShellFish to connect from iOS
|
Work on multiple branches |
Each branch gets its own |
Jump between features |
|
Master Claude oversees |
Intuitive interface with |
Sandboxed environments |
- 📊 Visual Layouts - Pre-configured tmux layouts for different workflows
- 🔄 Smart Syncing - Synchronize commands across multiple panes
- 💾 Persistent Sessions - Resume exactly where you left off
- 📈 Token Tracking - Monitor Claude API usage per branch
- 🎯 MCP Integration - Model Context Protocol server included
- 🐳 Docker Ready - Run in containers with full functionality
After starting a cgwt session, use these shortcuts for lightning-fast workflow:
Quick Splits (no prefix needed):
Alt+\- Split verticallyAlt+-- Split horizontally
Standard Tmux (after Ctrl+B):
|- Split vertically-- Split horizontallyh/j/k/l- Navigate panes (vim-style)H/J/K/L- Resize panes (hold to repeat)z- Toggle pane zoomx- Close current pane
# Inside Claude, use ! prefix for commands
!cgwt split main # Split and open main branch
!cgwt -l # List all sessions
!cgwt tips # Show all shortcuts
# Quick session switching
cgwt -a 1 # Jump to session 1
cgwt -a 2.1 # Jump to project 2, branch 1
# Split current pane with another branch
cgwt split # Split with bash and helper text
cgwt split main # Split vertically with main branch
cgwt split main -h # Split horizontally with main branch
cgwt split main -p 30 # Split with 30% size for new pane- Start with your feature:
cgwt -a 1 - Split for reference:
cgwt split main - Compare implementations side-by-side
- Claude in each pane maintains separate context!
Advanced Split Workflows:
# Create a 4-pane comparison layout
cgwt -a 1 # Start in feature branch
cgwt split main # Add main branch (vertical)
cgwt split develop -h # Add develop branch (horizontal)
cgwt split staging -h -p 33 # Add staging branch (33% height)
# Each pane has its own Claude instance with isolated context!- 468+ tests across comprehensive test suite
- Unit tests: Core business logic and utilities
- Integration tests: Full workflow and system integration
- CI Coverage: All Node.js versions (18.x - 24.x) on Ubuntu + macOS
- Zero skipping: All tests run on all environments
- Node.js ≥ 18.0.0 (LTS recommended)
- Git ≥ 2.20.0
- Tmux ≥ 3.0 (for session management)
- Claude Desktop - Get it from claude.ai
📦 npm (Recommended)
npm install -g claude-gwt🧶 yarn
yarn global add claude-gwt🐳 Docker
docker pull nazq/claude-gwt
docker run -it -v $(pwd):/workspace nazq/claude-gwt🔧 From Source
git clone https://github.com/nazq/claude_gwt.git
cd claude_gwt
npm install
npm run build
npm link# Create a new directory and run guided setup
mkdir my-project && cd my-project
cgwt app
# Or use specific commands for power users
cgwt app init --url https://github.com/user/repo.gitThe cgwt app command provides a guided experience that detects your environment:
# Auto-detects your situation and guides you
cgwt app
# Examples of what it detects:
# • Empty directory → Offers to clone a repository
# • Git repository → Offers to convert to worktree setup
# • Existing worktrees → Shows management optionsUse cgwt for instant switching between projects and branches:
# List all projects and branches
cgwt -l
# List only active sessions
cgwt -la
# Switch by index (supports x.y format for multi-project)
cgwt -a 1 # Switch to first session
cgwt -a 2.1 # Switch to project 2, branch 1
# Direct commands for power users
cgwt app new feature-auth # Create new worktree
cgwt app launch main # Launch specific branch
cgwt app setup # Initial repository setupFor complete control, use the cgwt app commands:
# Interactive guided experience
cgwt app
# Specific actions
cgwt app init # Initialize new project
cgwt app new <branch> # Create new worktree
cgwt app launch <branch> # Launch existing branch
cgwt app setup # Setup existing repository
cgwt app logs # View session logs🎥 Demo Video Coming Soon!
Check out the examples below to see claude-gwt in action
# Start with guided experience
$ cgwt app
? Directory detected: Git repository
? What would you like to do? › Convert to worktree setup
✓ Converted to worktree structure
✓ Main branch available at ~/project/main
# Create authentication feature
$ cgwt app new feature-auth
✓ Created worktree at ~/project/feature-auth
✓ Launching Claude...
# Claude (feature-auth): "I see we're implementing authentication.
# Based on the project structure, I'll help you set up JWT..."
# Meanwhile, start API development in parallel
$ cgwt app new feature-api
✓ Created worktree at ~/project/feature-api
✓ Launching Claude...
# Claude (feature-api): "I notice we're building the API layer.
# I can see the auth branch is implementing JWT..."
# Quick switching between features
$ cgwt -l # List all branches
$ cgwt -a 1 # Switch to feature-auth
$ cgwt -a 2 # Switch to feature-api
# Overview of all active work
$ cgwt -la # Show only active sessionsThe main command now handles both quick operations and full application management:
# List projects and branches
cgwt -l [project] # List all or specific project
cgwt -la # List only active sessions
# Switch by index
cgwt -a <index> # Switch to session by index
cgwt -a 1 # Switch to first session
cgwt -a 2.1 # Switch to project 2, branch 1
# Show version
cgwt -V, --version # Show version information# Guided experience (detects your environment)
cgwt app [options]
# Specific actions
cgwt app init [options] # Initialize new project
cgwt app new <branch> # Create new worktree
cgwt app launch <branch> # Launch existing branch
cgwt app setup # Setup existing repository
cgwt app logs # View session logs
# App command options
Options:
-u, --url <url> Git repository URL
-b, --branch <name> Initial branch name
-q, --quiet Non-interactive mode
-v, --verbose Verbose output (-v, -vv, -vvv)
-h, --help Show help# Split current tmux pane with another branch
cgwt split [target] [options] # Split pane and launch another session
cgwt split # Split with bash and helper text
cgwt split main # Split and launch main branch
cgwt split -h # Split horizontally (top/bottom)
cgwt split -p 30 # Split with 30% size
cgwt split feature-api -h -p 25 # Split horizontally, 25% size
# Show tips and keyboard shortcuts
cgwt tips # Display all tips and tmux shortcutsThe original claude-gwt command is still available but deprecated. It now redirects to cgwt app with a deprecation warning.
┌─────────────────────────────────────────┐
│ Claude GWT Orchestrator │
├─────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────┐ │
│ │ Git │ │ Tmux │ │ MCP │ │
│ │ Worktree │ │ Sessions │ │Server│ │
│ │ │ │ │ │(soon)│ │
│ └──────────┘ └──────────┘ └──────┘ │
│ │
└─────────────┬───────────────────────────┘
│
┌─────────┴────────┬────────────┐
│ │ │
┌───▼────┐ ┌────▼───┐ ┌────▼───┐
│ Branch │ │ Branch │ │ Branch │
│ A │ │ B │ │ C │
├────────┤ ├────────┤ ├────────┤
│ Claude │ │ Claude │ │ Claude │
│ #1 │ │ #2 │ │ #3 │
├────────┤ ├────────┤ ├────────┤
│ Work- │ │ Work- │ │ Work- │
│ tree │ │ tree │ │ tree │
└────────┘ └────────┘ └────────┘
Configuration is stored in ~/.config/claude-gwt/:
{
"ui": {
"theme": "ocean",
"showBanner": true,
"defaultAction": "guided"
},
"git": {
"defaultBranch": "main",
"autoFetch": true
},
"tmux": {
"sessionPrefix": "cgwt",
"defaultLayout": "main-vertical"
},
"app": {
"guidedExperience": true,
"autoDetectEnvironment": true
}
}We love contributions! See CONTRIBUTING.md for guidelines.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/claude_gwt.git
# Use Claude GWT for development!
cd claude_gwt
npm install
npm run devGenerate comprehensive code quality reports:
# Generate all reports
npm run reports
# View reports in browser
npm run reports:serveThis creates a beautiful dashboard at reports/index.html with:
- 📊 Test Coverage - Interactive coverage maps
- 🔧 ESLint Analysis - Code quality issues and statistics
- 🧪 Test Results - Execution timing and metrics
- 🕸️ Dependency Graphs - Visual architecture analysis
- 📝 TypeScript Diagnostics - Type checking results
- 🧬 Mutation Testing - Test quality analysis (optional)
Claude GWT prioritizes security:
- ✅ Sandboxed Environments - Each worktree is isolated
- ✅ Input Validation - All inputs sanitized
- ✅ No Arbitrary Execution - Commands are validated
- ✅ Secure Sessions - Tmux sessions are protected
For security issues, please follow responsible disclosure via GitHub Security.
MIT © Claude GWT Contributors