Skip to content

nazq/claude_gwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌳

🌳 Claude GWT 🚀

Git Worktree Manager with Integrated Claude Code Orchestration

Transform your multi-branch development workflow with AI-powered context isolation

⚠️ BETA SOFTWARE - This is experimental software under active development.
Please report issues and feedback on GitHub

Beta Status NPM Version NPM Downloads License Build Status Coverage GitHub Stars

WhyFeaturesInstallQuick StartDemoDocs




🎯 Why Claude GWT?

The Multi-Branch Development Problem

😫 Without Claude GWT

# 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??

🚀 With Claude GWT

# 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

🧠 The Game Changer

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"

🌐 Remote Access

Connect to Claude GWT from anywhere


✨ Features

🎯 Core Capabilities

🌲 Git Worktree Magic

Work on multiple branches
simultaneously without stashing

🤖 AI Context Isolation

Each branch gets its own
Claude with full context

⚡ Instant Switching

Jump between features
without losing state

👥 Supervisor Mode
(coming soon)

Master Claude oversees
and coordinates all branches

🎨 Modern CLI

Intuitive interface with
colors and animations

🔐 Secure by Design

Sandboxed environments

🚀 Advanced Features (WIP)

  • 📊 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

⚡ Keyboard Shortcuts & Productivity Tips

Tmux Pane Management

After starting a cgwt session, use these shortcuts for lightning-fast workflow:

Quick Splits (no prefix needed):

  • Alt+\ - Split vertically
  • Alt+- - Split horizontally

Standard Tmux (after Ctrl+B):

  • | - Split vertically
  • - - Split horizontally
  • h/j/k/l - Navigate panes (vim-style)
  • H/J/K/L - Resize panes (hold to repeat)
  • z - Toggle pane zoom
  • x - Close current pane

Power User Tips

# 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

Multi-Branch Workflow

  1. Start with your feature: cgwt -a 1
  2. Split for reference: cgwt split main
  3. Compare implementations side-by-side
  4. 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!

📊 Code Quality & Test Coverage

Coverage (Master) Coverage (All Branches) Build Status

Comprehensive test coverage across all Node.js versions (18-24) on Ubuntu and macOS

📈 Coverage Visualization

📊 Coverage by Module (Sunburst Chart)
🌳 Coverage Tree Map
📋 Coverage Hierarchy (Icicle Chart)

🧪 Test Structure

  • 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

📦 Installation

Prerequisites

  • Node.js ≥ 18.0.0 (LTS recommended)
  • Git ≥ 2.20.0
  • Tmux ≥ 3.0 (for session management)
  • Claude Desktop - Get it from claude.ai

Install Methods

📦 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

🚀 Quick Start

1️⃣ Initialize a New Project

# 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.git

2️⃣ Guided Experience

The 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 options

3️⃣ Quick Navigation

Use 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 setup

4️⃣ Full Application Management

For 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

🎥 Demo Video Coming Soon!

Check out the examples below to see claude-gwt in action

Real-World Workflow Example

# 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 sessions

📖 Documentation

Command Reference

Unified CLI: cgwt

The main command now handles both quick operations and full application management:

Quick Commands (for instant switching)
# 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
App Commands (for full management)
# 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
Utility Commands
# 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 shortcuts

Legacy Command: claude-gwt (deprecated)

The original claude-gwt command is still available but deprecated. It now redirects to cgwt app with a deprecation warning.

Architecture

┌─────────────────────────────────────────┐
│          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

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
  }
}

🤝 Contributing

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 dev

📊 Code Quality Reports

Generate comprehensive code quality reports:

# Generate all reports
npm run reports

# View reports in browser
npm run reports:serve

This 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)

🛡️ Security

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.


📄 License

MIT © Claude GWT Contributors



Built with ❤️ by developers who were tired of losing context

⭐ Star us on GitHub

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •