/dual-haul:dual-haulfrom dual-haul
Orchestrates a five-phase improvement arc: understands what to improve, forges a /goal condition, races two different-model agents (Claude vs Codex) in separate git worktrees round by round, summarizes results, and opens a PR.
Ships in dual-haul. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The orchestrator: the interactive Claude session the user runs. It drives a five-phase improvement arc, advancing automatically and stopping only at three human gates. The phases are sibling skills; you invoke each in turn:
dual-understand — understand what's wrong now and what "better" means.dual-goal — forge a /goal-ready completion condition. GATE: user approves + runs /goal.dual-loop — each /goal turn, race a Claude (chosen model) vs Codex (chosen model) in separate worktrees; judge + merge the winner. GATE: user picks the two racer models, once.dual-report — once the goal auto-clears, report goal-vs-achieved and the kept diff.dual-ship — commit on a branch and open a PR. GATE: user confirms.You are the orchestrator, not an implementer. During iteration you never edit the target code yourself — you commission two racers and keep the better diff. Implementing it yourself defeats the second-opinion design.
/goal <condition> is a Claude Code built-in (v2.1.139+): it sets a completion
condition, and after every turn a fast model checks the transcript to decide
whether the condition holds. If not, it starts another turn automatically; when
it holds, the goal auto-clears. Two consequences shape this skill:
/goal yourself.
dual-goal produces the exact line; you present it and ask the user to run it.Once /goal is active it keeps re-invoking you turn after turn. Your standing
job each turn is exactly one dual-loop round. When the condition is met
the goal clears and control returns to you — then proceed to dual-report.
digraph pair_goal {
"Init .dualhaul/, record PHASE" [shape=box];
"dual-understand -> UNDERSTANDING.md" [shape=box];
"dual-goal -> GOAL.md" [shape=box];
"GATE: user approves + runs /goal" [shape=diamond];
"GATE: user picks racer models" [shape=diamond];
"dual-loop: 1 race this turn" [shape=box];
"Goal met? (/goal cleared)" [shape=diamond];
"dual-report -> SUMMARY.md" [shape=box];
"GATE: user confirms PR" [shape=diamond];
"dual-ship: branch + PR + teardown" [shape=doublecircle];
"Init .dualhaul/, record PHASE" -> "dual-understand -> UNDERSTANDING.md";
"dual-understand -> UNDERSTANDING.md" -> "dual-goal -> GOAL.md";
"dual-goal -> GOAL.md" -> "GATE: user approves + runs /goal";
"GATE: user approves + runs /goal" -> "GATE: user picks racer models" [label="approved"];
"GATE: user picks racer models" -> "dual-loop: 1 race this turn";
"dual-loop: 1 race this turn" -> "Goal met? (/goal cleared)";
"Goal met? (/goal cleared)" -> "dual-loop: 1 race this turn" [label="no (next /goal turn)"];
"Goal met? (/goal cleared)" -> "dual-report -> SUMMARY.md" [label="yes"];
"dual-report -> SUMMARY.md" -> "GATE: user confirms PR";
"GATE: user confirms PR" -> "dual-ship: branch + PR + teardown" [label="confirmed"];
}
command -v claude codex (both required) and git rev-parse --git-dir (worktrees need git). Missing → tell the user, stop. Confirm /goal is available (Claude Code ≥ v2.1.139); if not, offer to run the loop manually with a round cap instead..dualhaul/STATE.md exists, read PHASE/STATUS and jump to that phase — do not restart. Otherwise create .dualhaul/, append .dualhaul/ to .gitignore, write STATE.md (PHASE: understand, STATUS: ACTIVE: orchestrator, ROUND: 0, ROUNDS: 5, ORCH_MODEL: <your model>), and record the user's one-line ask.PHASE in STATE.md as you cross each boundary so a re-invocation resumes cleanly.| Gate | When | What you do |
|---|---|---|
| approve-goal | after dual-goal | Show GOAL.md's condition and the /goal … line. Wait for the user to edit/approve and to actually run /goal. Do not start iterating until the goal is active. |
| pick-models | before round 1 of dual-loop | Ask which model the Claude racer uses (must differ from ORCH_MODEL) and which Codex model. Write RACER_CLAUDE / RACER_CODEX. dual-loop owns the exact prompt. |
| confirm-pr | after dual-report | Show the branch name + PR body. Only push/open after the user confirms. |
Set STATUS: WAITING-USER: <gate> while waiting so a resume knows it's parked on a human.
Each phase's mechanics live in its own skill — invoke it, don't reimplement it:
dual-understand writes UNDERSTANDING.md.dual-goal writes GOAL.md (+ the /goal line) from UNDERSTANDING.md.dual-loop runs one race per turn against GOAL.md, writes R<N>.md, merges the winner. It uses reference/handoff.sh (goal_race/goal_wait_race/goal_teardown).dual-report writes SUMMARY.md once the goal clears.dual-ship commits, opens the PR, and tears down worktrees + .dualhaul/.STATUS: DONE.ROUND reaches ROUNDS) without the goal met: stop iterating, tell the user the goal was not met, go to dual-report anyway (report partial), and ask whether to clear /goal, raise ROUNDS, or stop./goal unavailable: STATUS: BLOCKED: <reason>, surface, stop.goal_teardown worktrees before exiting on any path./dual-haul with an existing .dualhaul/: read STATUS.
WAITING-USER: <gate> → re-present that gate.RACING: R<n> → a race may be mid-flight; goal_status / tail logs, judge if both done, else wait. Don't launch a duplicate race.BLOCKED → report what's blocked.DONE → show SUMMARY.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agent-racing, goal-driven, git-worktree, code-review, automation
6 skills in this plugin
/dual-goalPhase 2 of dual-haul. Turns .dualhaul/UNDERSTANDING.md into a /goal-ready completion condition — one measurable end state, a stated transcript-demonstrable check, the constraints that must hold, and a turn cap — written to .dualhaul/GOAL.md plus the literal /goal line for the user to run. Use after dual-understand, or standalone to craft a good /goal condition from a clear improvement target./dual-loopPhase 3 of dual-haul — the per-turn race. Under an active /goal, each turn the orchestrator commissions two independent implementers (a Claude on a chosen model + Codex on a chosen model), each in its own git worktree off the current base commit, then judges both against the goal's stated check and merges the winning diff into the main tree. Use as the iteration phase of a dual-haul run; before round 1 it asks the user which model each racer uses./dual-npx claudepluginhub ccomkhj/skills --plugin dual-haulOther plugins' skills for the same job