plugins/clade/skills/worktree/SKILL.md
Create and manage git worktrees for parallel Codex sessions
npx skillsauth add shenxingy/claude-code-kit worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This workflow runs directly in Codex. Do not launch the claude CLI or
delegate the workflow to Clade's MCP bridge.
Codex compatibility rules:
AGENTS.md files for repository instructions. If a project
has only CLAUDE.md, treat it as legacy project guidance and read it too..clade/ (or ~/.clade/ for personal
state). Existing legacy Claude state may be read for migration, but do not
create new vendor-specific state./skill-name reference means the corresponding Codex $skill-name skill,
or the same workflow invoked naturally when explicit skill invocation is not
available.<plugin-root>/... are relative to the installed Clade plugin
containing this SKILL.md; resolve that root before invoking a helper.You are the Worktree skill. You manage git worktrees to enable parallel Codex sessions without file conflicts.
The user's input after /worktree determines the action:
/worktree "Fix padding in settings")--list → LIST all active worktrees--merge <branch> → MERGE a specific worktree branch into the current branch--merge --all → MERGE all worktree branches (prefix wt/)--clean → REMOVE all worktrees and delete their branchesWhen the user provides a task prompt (e.g., /worktree "Fix padding in settings pages"):
basename "$(git rev-parse --show-toplevel)" # e.g., "companyOS"
git rev-parse --abbrev-ref HEAD # current branch name
Convert the user's prompt into a short kebab-case slug (3-5 words max):
wt/fix-padding-settingswt/add-rate-limiting-apiwt/# Count existing worktrees with the project name pattern
ls -d ../$(basename $(pwd))-wt-* 2>/dev/null | wc -l
Use the next number (1, 2, 3...).
git worktree add ../<project>-wt-<N> -b <branch-name>
For example:
git worktree add ../companyOS-wt-1 -b wt/fix-padding-settings
If the command fails because the branch already exists, inform the user and suggest a different name.
Write a TASK.md file in the root of the new worktree. This file will be automatically visible to a new Codex session opened in that directory.
The TASK.md should contain:
# Task
<the user's original prompt>
## Context
- Branch: `<branch-name>`
- Created from: `<source-branch>` at commit `<short-hash>`
- Main project: `../<project>/`
## Rules
- Only modify files related to the task above
- Do NOT modify shared config files (e.g., globals.css, layout.tsx, package.json) unless specifically asked
- Commit your changes to this branch when done
- When finished, go back to the main project and run: `/worktree --merge <branch-name>`
## Getting started
Read the relevant files first, understand the existing patterns, then make changes.
Print a clear message:
Worktree created:
Directory: ../<project>-wt-<N>
Branch: <branch-name>
Start a new Codex session:
cd ../<project>-wt-<N> && codex
When done, come back here and run:
/worktree --merge <branch-name>
Run:
git worktree list
Format the output nicely, showing:
git -C <path> status --porcelain for each)--merge <branch>)Check for uncommitted changes in the current worktree:
git status --porcelain
If there are changes, warn the user and ask whether to continue.
Merge the branch:
git merge <branch-name>
If merge succeeds, suggest cleanup:
Merged <branch-name> successfully.
Run `/worktree --clean` to remove the worktree, or keep it for more work.
If there are merge conflicts, show the conflicting files and help resolve them.
--merge --all)wt/ prefix:
git branch --list "wt/*"
List all worktrees (excluding the main one):
git worktree list --porcelain
For each non-main worktree:
git worktree remove <path>
git branch -d <branch-name>
-D)Report what was cleaned up.
.clade/blockers.md3-strike rule: If the same approach fails 3 times, switch to BLOCKED — do not retry indefinitely.
Quickly spin up isolated git worktrees so you can open parallel Codex sessions without conflicts. Each worktree gets its own branch and a TASK.md describing what to work on.
/worktree "Fix all padding issues in settings pages"
Creates a worktree, branch, and TASK.md. Prints the command to start a new Codex session in it.
/worktree --list
/worktree --merge wt/fix-padding-settings
/worktree --merge --all
/worktree --clean
../<project>-wt-<n> with a new branch wt/<slug>development
Orchestrate a fleet of parallel `codex exec` workers with you (Claude Code) as the supervisor — spawn one per isolated git worktree, dispatch headless, verify each INDEPENDENTLY, PR/merge. The manual "codex-ultracode" pattern for fanning out real implementation, research, or review work onto Codex. Bakes in the hard gotchas (stdin blocking, background tracking, don't-trust-self-reports, writer isolation). Triggers on — orchestrate codex, codex workers, codex fleet, spawn codex, delegate to codex in parallel, manual ultracode, 开 codex 小弟, 派 codex worker — NOT for a single cross-vendor opinion (use the `second-opinion-codex` agent), NOT for web-UI worker decomposition (use `/orchestrate`).
development
Verify project behavior anchors — compilation, tests, and interaction checks after autonomous runs. NOT the Codex built-in /verify (which runs the app to observe a single change working) — this one walks the AGENTS.md "Features (Behavior Anchors)" list.
documentation
End-of-session documentation sync — updates TODO.md and PROGRESS.md only (run /commit after to commit everything)
development
Clade coverage-driven project review — walks every VERIFY.md checkpoint, fixes failures in-session, converges when all checkpoints pass. NOT the Codex built-in /review (which reviews a single pull request diff) — if the user wants a PR review, route to /review-pr (Clade's PR reviewer) or the CC built-in.