Loading...
Loading...
Manages Git worktrees for isolated parallel development. Creates worktrees in .github/worktrees/ with symlinked .env files.
npx skill4agent add skinnyandbald/fish-skills git-worktree| Command | Description |
|---|---|
| Create worktree with symlinked .env |
| List all worktrees |
| Remove inactive worktrees |
| Switch to a worktree |
git worktree add# CORRECT
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature-name
# WRONG - Never do this directly
git worktree add .github/worktrees/feature-name -b feature-name develop.env.github/worktrees/.gitignore.github/worktrees/cddevelopmain.env.github/worktrees/create <branch-name> [from-branch].github/worktrees/<branch-name>develop# Create from develop (default)
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature/pipeline-steps
# Create from specific branch
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create hotfix/auth main.github/worktrees/.envlistlsbash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh list*switch <name>go <name>bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh switch feature/pipeline-stepscleanupcleanbash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup# 1. Create worktree from develop
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature/auth-system
# Script output:
# ━━━ Launch Claude Code in this worktree ━━━
# cd /path/to/.github/worktrees/feature-auth-system && claude
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 2. CLAUDE STOPS HERE. Tells user to copy-paste the command above into a new terminal.
# DO NOT continue with any work in this session.
# 3. User pastes command → new Claude Code instance starts in the worktree
# User brainstorms, plans, and implements in that fresh session
# 4. When done, cleanup from main repo
cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup# Create worktree from PR branch
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create pr-42-auth-fix origin/pr-branch
# CLAUDE STOPS HERE. Tells user to copy-paste the launch command into a new terminal.
# Cleanup after review
cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanupproject-root/
├── .env # Source of truth
├── .github/
│ └── worktrees/ # All worktrees live here
│ ├── feature-auth/
│ │ ├── .env -> ../../.. # Relative symlink to root .env
│ │ ├── src/
│ │ └── ...
│ └── feature-pipeline/
│ ├── .env -> ../../.. # Relative symlink to root .env
│ └── ...
└── .gitignore # Includes .github/worktreesbash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh switch <name>cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanupcd .github/worktrees/<name>
rm .env
# Compute relative path to project root .env
GIT_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
ln -s "$(python3 -c "import os; print(os.path.relpath('$GIT_ROOT/.env', '$(pwd)'))")" .env
ls -la .env # Verifycdcdclaude