Problem
The git-automated-worktree skill creates worktrees via setup-worktree.sh. After worktree creation, MCP servers (DeepWiki, Perplexity, etc.) are unavailable because .mcp.json is missing from the new worktree.
Root Cause
setup-worktree.sh has phases for submodule sync (4.5), dependency install (5), and test validation (7) — but no phase for copying gitignored workspace config files like .mcp.json. Since .mcp.json is gitignored (contains API keys), git worktree add does not include it in the checkout.
Solution
Add a new phase between Phase 4.5 (submodule) and Phase 5 (environment setup) that copies .mcp.json from the source repo root ($PROJECT_ROOT) to the worktree root ($WORKTREE_PATH), if it exists.
Files
.claude/scripts/setup-worktree.sh — add copy phase after line 107 (after submodule phase)
.claude/skills/git-automated-worktree/SKILL.md — document that .mcp.json is copied
Constraints
- Do NOT commit
.mcp.json to git (contains API keys)
- Copy only if source file exists (not all repos have
.mcp.json)
- Use
cp not symlink — worktrees may diverge in MCP config
- New phase should follow existing naming convention (e.g., "Phase 4.6: Workspace Config")
Success Criteria
Problem
The
git-automated-worktreeskill creates worktrees viasetup-worktree.sh. After worktree creation, MCP servers (DeepWiki, Perplexity, etc.) are unavailable because.mcp.jsonis missing from the new worktree.Root Cause
setup-worktree.shhas phases for submodule sync (4.5), dependency install (5), and test validation (7) — but no phase for copying gitignored workspace config files like.mcp.json. Since.mcp.jsonis gitignored (contains API keys),git worktree adddoes not include it in the checkout.Solution
Add a new phase between Phase 4.5 (submodule) and Phase 5 (environment setup) that copies
.mcp.jsonfrom the source repo root ($PROJECT_ROOT) to the worktree root ($WORKTREE_PATH), if it exists.Files
.claude/scripts/setup-worktree.sh— add copy phase after line 107 (after submodule phase).claude/skills/git-automated-worktree/SKILL.md— document that.mcp.jsonis copiedConstraints
.mcp.jsonto git (contains API keys).mcp.json)cpnot symlink — worktrees may diverge in MCP configSuccess Criteria
setup-worktree.shcompletes,.mcp.jsonexists in the new worktree if it existed in the source repo.mcp.json, no error is thrown and script continues.mcp.jsonremains gitignored