Worktree Parallel
Workflow
- •Confirm the repo root (use current working directory unless the user specifies another repo).
- •Determine a feature slug and branch name.
- •Default branch pattern:
feat/<slug>. - •If the user already has a branch name, use it.
- •Default branch pattern:
- •Choose a base directory for linked worktrees.
- •Default for this repo:
../<project_name>-wt(create it if missing).
- •Default for this repo:
- •Create the worktree.
- •New branch:
git worktree add -b feat/<slug> <base>/<slug> - •Existing branch:
git worktree add <base>/<slug> <branch>
- •New branch:
- •Open the worktree in the editor.
- •Use
code -n <path>(Cursor supports thecodeCLI). - •If
codeis unavailable, ask for the preferred editor command (e.g.,cursor -n,code, or another).
- •Use
- •Suggest a parallel Codex session in the new worktree.
- •
cd <path> && codex
- •
- •Confirm with
git worktree listif needed.
Safety
- •Do not use
--forceunless the user explicitly asks. - •Do not remove existing worktrees unless the user requests cleanup.
Optional Cleanup (only if asked)
- •
git worktree remove <path> - •
git branch -d <branch>