🍴 fork-yeah
A Claude Code plugin for branching conversation paths
Fork-yeah enables you to create parallel branches of your Claude Code conversations, allowing you to explore different approaches while "saving your spot." Think of it as git branches for your AI conversations.
Features
- Parallel Conversation Paths: Create N parallel branches from any point in your conversation
- Git Worktrees: Each fork gets its own isolated git worktree
- State Checkpointing: Saves complete conversation state at fork points
- Terminal Multiplexing: Seamless integration with tmux for managing multiple forks
- Nested Forks: Support for creating forks within fork branches
- Visual Fork Tree: See your fork hierarchy at a glance
- Cross-Platform: Works on Linux, macOS, and Windows (WSL)
Part of the mcfearsome marketplace - Quality plugins for Claude Code
See MARKETPLACE.md for more plugins and marketplace information.
Quick Start
Installation
# Clone the repository
git clone https://github.com/mcfearsome/fork-yeah
cd fork-yeah
# Run setup
./setup.sh
The setup script will:
- Check for required dependencies (git, python3, jq)
- Optionally install tmux for the best experience
- Create necessary directories
- Link the plugin to Claude Code
Basic Usage
Inside Claude Code:
# Create 3 parallel branches from current conversation
/fork create 3
# List all your forks
/fork list
# View fork hierarchy
/fork tree
# Switch to a specific fork
/fork switch fork-1234567890-abc123-2
# Check current fork status
/fork status
# Merge changes from another fork
/fork merge fork-1234567890-abc123-1
# Delete a fork
/fork delete fork-1234567890-abc123-3
How It Works
The Fork Workflow
- Checkpoint: When you create a fork, fork-yeah saves the current conversation state and git commit
- Branch: Creates N git branches from that commit point
- Worktree: Sets up isolated git worktrees for each fork
- Launch: Spawns terminal sessions (tmux panes/windows) for each fork
- Work: Each fork can evolve independently
- Merge: Optionally merge successful approaches back together
Example Scenario
# You're working on a feature and want to try two approaches
# Save your current work
git add . && git commit -m "baseline before fork"
# Create two parallel branches
/fork create 2
# This creates:
# - fork-xxx-1: Try approach A
# - fork-xxx-2: Try approach B
# Work on each approach independently
# Then merge the better one back to main
Commands Reference
/fork create <number> [--target <branch_name>]
Create N parallel fork branches.
Arguments:
number: Number of branches (1-10)
--target <branch_name> (optional): Target branch all forks will merge to
Examples:
# Create 3 parallel branches from current point
/fork create 3
# Create 3 branches targeting feature-auth branch
/fork create 3 --target feature-auth
# All forks will be created from and merge back to feature-auth
What it does:
- Captures current conversation state
- Creates or checks out target branch (if --target specified)
- Creates git branches from current commit
- Sets up worktrees for each fork
- Launches terminal sessions (if tmux available)
- Stores target branch info for future merges
Target Branch Benefits:
- All forks start from the same named branch
- Makes it clear where work should merge back to
- Useful for feature development with multiple approaches
- Target branch is shown in fork metadata
/fork list
List all active fork branches.
Output:
- Fork ID
- Creation time
- Status
- Worktree path
- Branch number
/fork switch <fork_id>
Switch to a different fork branch.
Arguments:
fork_id: ID of fork to switch to
Example:
/fork switch fork-1730678901-a1b2c3d4-2
What it does:
- Changes to fork's worktree directory
- Attaches to tmux session (if using tmux)
- Updates shell environment
/fork tree
Visualize fork hierarchy as a tree structure.
Output:
- ASCII tree showing fork relationships
- Parent-child connections
- Fork metadata
/fork status
Show status of current fork and conversation state.
Output:
- Current fork (if in one)
- Fork details
- Git status
- Worktree information
/fork merge <fork_id>
Merge changes from another fork branch.
Arguments:
fork_id: Source fork to merge from
Example:
/fork merge fork-1730678901-a1b2c3d4-1
/fork delete <fork_id>
Delete a fork and its worktree.
Arguments:
Example:
/fork delete fork-1730678901-a1b2c3d4-3
What it does:
- Kills associated tmux session
- Removes git worktree
- Deletes git branch
- Cleans up fork data
Terminal Modes
Fork-yeah adapts to your environment:
tmux Mode (Recommended)