Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use this whenever you need to create an isolated workspace.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 141% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 68% | 0% |
| case-06 | ✓→✗ | ▼ Worse | 101% | 0% |
<required> CRITICAL Add the following steps to your Todo list using TodoWrite:
ls -d .worktrees 2>/dev/null.worktrees.bash# Check if directory pattern in .gitignore grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
cd $pathbash# Node.js if [ -f package.json ]; then npm install; fi # Rust if [ -f Cargo.toml ]; then cargo build; fi # Python if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f pyproject.toml ]; then poetry install; fi # Go if [ -f go.mod ]; then go mod download; fi
bash# Examples - use project-appropriate command npm test cargo test pytest go test ./...
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
New working directory: <full-path>
Tests passing (<N> tests, 0 failures)
All commands and tools will now refer to: <full-path></required>
CRITICAL: Once you create and enter a worktree, you must stay within it for the entire session.
Rules:
you outside the worktree boundary
within the worktree, not cd .. && npm run lint
<bad-example> cd .. && npm run lint </bad-example> <good-example> npm run lint # (from worktree root) </good-example>
<good-example> cd /home/$USER/code/project/.worktrees/branch-name && npm run lint </good-example>
bashpwd # Should show .worktrees/branch-name in path git branch # Should show * on your feature branch, not main
Red Flags:
| Situation | Action | | --------------------------- | -------------------------- | | .worktrees/ exists | Use it (verify .gitignore) | | .worktree/s does not exist | Check CLAUDE.md → Ask user | | Directory not in .gitignore | Add it immediately | | Tests fail during baseline | Report failures + ask | | No package.json/Cargo.toml | Skip dependency install |
Skipping .gitignore verification
Assuming directory location
Missing project installation
Proceeding with failing tests
Hardcoding setup commands
You: I'm using the Using Git Worktrees skill to set up an isolated workspace.
[Check .worktrees/ - exists]
[Verify .gitignore - contains .worktrees/]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]
Worktree ready at myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth featureNever:
Always:
Other measured skills in the registry, with their headline benchmark lift.