| name | worktree-parallel |
| description | Create and manage a git worktree for parallel feature development, then open the new worktree in the editor (code/Cursor) for a second Codex session. Use when the user asks to work on another feature simultaneously, spin up a parallel workspace, or open a new worktree even if they do not mention worktree explicitly. |
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>