Worktree
Create a git worktree for $ARGUMENTS (branch name or
phase description).
Steps
- •
Determine branch name from arguments (e.g.
feat/sass-lint-6-dollar-variable-pattern) - •
Create worktree:
bashgit worktree add .worktrees/<name> -b <branch> <parent>
- •
In the worktree directory:
bashcd .worktrees/<name> pnpm install
- •
Register the branch with Graphite:
bashgt track
- •
Verify:
bashpnpm check
- •
Report the worktree path for the subagent
Stacking branches
Every branch gets its own worktree. To stack branch B on top of branch A, pass the parent branch as the start point:
bash
git worktree add .worktrees/sass-lint-N-<title> \ -b feat/sass-lint-N-<title> \ feat/sass-lint-M-<parent-title>
Then inside the new worktree: pnpm install && gt track.
Graphite will recognize the stack automatically.