by raghavpillai
Branchlet: A simple CLI Git worktree manager
# Add to your Claude Code skills
git clone https://github.com/raghavpillai/branchletA interactive CLI tool for creating and managing Git worktrees with an easy to use interface.

npm install -g branchlet
Run Branchlet in any Git repository:
branchlet
This opens an interactive menu where you can:
branchlet
Opens the main menu with all available options.
branchlet create # Go directly to worktree creation
branchlet list # List all worktrees
branchlet delete # Go directly to worktree deletion
branchlet settings # Open settings menu
branchlet --help # Show help information
branchlet --version # Show version number
branchlet -m create # Set initial mode
No comments yet. Be the first to share your thoughts!
Pass flags to skip the interactive prompts entirely. The three core concepts map directly to flags:
| Flag | Description |
|------|-------------|
| -n, --name <name> | Worktree directory name |
| -s, --source <branch> | Source branch to create from |
| -b, --branch <branch> | New branch name (defaults to -n when omitted) |
# Create a worktree — new branch defaults to the worktree name
branchlet create -n my-feature -s main
# Create a worktree with an explicit branch name different from the directory
branchlet create -n ticket-3121-backend -s main -b feature/ticket-3121
# Create multiple sibling worktrees from the same source branch
# (each gets its own branch, so there's no checkout conflict)
branchlet create -n digit3121-backend -s main -b feat/digit3121-backend
branchlet create -n digit3121-frontend -s main -b feat/digit3121-frontend
# List worktrees as JSON
branchlet list --json
# Delete a worktree by name
branchlet delete -n my-feature
# Force-delete a worktree by path
branchlet delete -p /path/to/worktree -f
Successful create output:
/path/to/worktree
source: main
branch: my-feature
Branchlet looks for configuration files in this order:
.branchlet.json in your repo's root (project-specific)~/.branchlet/settings.json (global configuration)Create a .branchlet.json file in your project root or configure global settings:
{
"$schema": "https://raw.githubusercontent.com/raghavpillai/branchlet/main/schema.json",
"worktreeCopyPatterns": [".env*", ".vscode/**"],
"worktreeCopyIgnores": ["**/node_modules/**", "**/dist/**", "**/.git/**"],
"worktreePathTemplate": "$BASE_PATH.worktree",
"postCreateCmd": ["npm install", "npm run db:generate"],
"terminalCommand": "code .",
"deleteBranchWithWorktree": true
}
worktreeCopyPatterns: Files/directories to copy to new worktrees (supports glob patterns)
[".env*", ".vscode/**"]["*.json", "config/**", ".env.local"]worktreeCopyIgnores: Files/directories to exclude when copying (supports glob patterns)
["**/node_modules/**", "**/dist/**", "**/.git/**", "**/Thumbs.db", "**/.DS_Store"]worktreePathTemplate: Template for worktree directory names
"$BASE_PATH.worktree"$BASE_PATH, $WORKTREE_PATH, $BRANCH_NAME, $SOURCE_BRANCH"worktrees/$BRANCH_NAME", "$BASE_PATH-branches/$BRANCH_NAME"postCreateCmd: Commands to run after creating a worktree. Runs in the new worktree directory.
[]["npm install"], ["pnpm install", "pnpm build"]$BASE_PATH, $WORKTREE_PATH, $BRANCH_NAME, $SOURCE_BRANCHterminalCommand: Command to open terminal/editor in the new worktree. Runs in the new worktree directory.
"""code .", "cursor .", "zed ."deleteBranchWithWorktree: Whether to also delete the associated git branch when deleting a worktree
falseAvailable in worktreePathTemplate, postCreateCmd, and terminalCommand:
$BASE_PATH: Base name of your repository$WORKTREE_PATH: Full path to the new worktree$BRANCH_NAME: Name of the new branch$SOURCE_BRANCH: Name of the source branchNavigate to your Git repository
cd my-project
Start Branchlet
branchlet
Create a worktree
feature-auth)main)feature/authentication)Create .branchlet.json in your project:
{
"$schema": "https://raw.githubusercontent.com/raghavpillai/branchlet/main/schema.json",
"worktreeCopyPatterns": [
".env.local",
".vscode/**",
"package.json",
"tsconfig.json"
],
"worktreePathTemplate": "worktrees/$BRANCH_NAME",
"postCreateCmd": [
"npm install",
"npm run db:populate"
],
"terminalCommand": "code .",
"deleteBranchWithWorktree": true
}
MIT