Built by Kyle Redelinghuys
A friendly CLI tool for managing multiple git worktrees, perfect for juggling different features, experiments, or Claude Code sessions without the context-switching headaches.
ccswitch helps you create and manage git worktrees with a clean, intuitive interface. Each worktree gets its own directory, letting you work on multiple features simultaneously without stashing changes or switching branches in place.
- π Quick Session Creation - Describe what you're working on, get a branch and worktree instantly
- π Interactive Session List - See all your active work sessions with a clean TUI
- π§Ή Smart Cleanup - Remove worktrees and optionally delete branches when done
- ποΈ Bulk Cleanup - Remove ALL worktrees at once with
cleanup --all(perfect for spring cleaning!) - π Shell Integration - Automatically
cdinto new worktrees (no copy-pasting paths!) - π¨ Pretty Output - Color-coded messages and clean formatting
# Clone the repo
git clone https://github.com/ksred/ccswitch.git
cd ccswitch
# Build and install
make install
# Add shell integration to your .bashrc or .zshrc
cat bash.txt >> ~/.bashrc # or ~/.zshrc
source ~/.bashrc # or ~/.zshrc# Build the binary
go build -o ccswitch .
# Move to your PATH
sudo mv ccswitch /usr/local/bin/
# Add the shell wrapper
source bash.txtccswitch
# π What are you working on? Fix authentication bug
# β Created session: feature/fix-authentication-bug
# Branch: feature/fix-authentication-bug
# Path: /home/user/project/../fix-authentication-bug
#
# Automatically switches to the new directory!ccswitch list
# Shows an interactive list of all your worktrees
# Use arrow keys to navigate, Enter to select, q to quitccswitch switch
# Interactive selection of session to switch to
ccswitch switch fix-auth-bug
# Direct switch to a specific session
# Automatically changes to the session directory!ccswitch cleanup
# Select a session interactively, or:
ccswitch cleanup fix-authentication-bug
# Delete branch feature/fix-authentication-bug? (y/N): y
# β Removed session and branch: fix-authentication-bug
# Bulk cleanup - remove ALL worktrees at once!
ccswitch cleanup --all
# β οΈ You are about to remove the following worktrees:
# β’ feature-1 (feature/feature-1)
# β’ feature-2 (feature/feature-2)
# β’ bugfix-1 (feature/bugfix-1)
# Press Enter to continue or Ctrl+C to cancel...
# Delete associated branches as well? (y/N): y
# β Successfully removed: feature-1
# β Successfully removed: feature-2
# β Successfully removed: bugfix-1
# β
All 3 worktrees removed successfully!
# β Switched to main branch# Run directly
make run
# Run tests
make test
# See all commands
make help# Unit tests only (fast, no git required)
make test-unit
# All tests including integration
make test
# Run tests in Docker (clean environment)
make test-docker
# Generate coverage report
make coverageccswitch/
βββ main.go # Main application code
βββ bash.txt # Shell integration wrapper
βββ Makefile # Build automation
βββ *_test.go # Test files
βββ Dockerfile.test # Docker test environment
βββ README.md # You are here! π
- Session Creation: Converts your description into a branch name (e.g., "Fix login bug" β
feature/fix-login-bug) - Centralized Storage: Creates worktrees in
~/.ccswitch/worktrees/repo-name/session-name- your projects stay clean! - Automatic Navigation: The bash wrapper captures the output and
cds you into the new directory - Session Tracking: Lists all worktrees except the main one as active sessions
~/.ccswitch/ # All ccswitch data in your home directory
βββ worktrees/ # Centralized worktree storage
βββ my-project/ # Organized by repository name
β βββ fix-login-bug/ # Individual sessions
β βββ add-new-feature/
β βββ refactor-ui/
βββ another-project/
βββ update-deps/
βββ new-feature/
# Your project directories remain completely clean!
/Users/you/projects/
βββ my-project/ # Just your main repository
βββ another-project/ # No clutter!
- Go 1.21 or higher (for building)
- Git 2.20 or higher (for worktree support)
- Bash or Zsh (for shell integration)
- Use descriptive session names - they become your branch names!
- Regular cleanup keeps your workspace tidy
- Each worktree is independent - perfect for testing different approaches
- The tool respects your current branch when creating new sessions
"Failed to create worktree"
- Check if the branch already exists:
git branch -a - Ensure you're in a git repository
- Verify you have write permissions in the parent directory
Shell integration not working
- Make sure you've sourced the bash wrapper
- Check that
ccswitchis in your PATH - Try using the full path:
/usr/local/bin/ccswitch
MIT License - feel free to use this in your projects!
Found a bug? Have an idea? Feel free to open an issue or submit a PR!
Made with β€οΈ for developers who juggle multiple features at once