
Dual loop
Runs a per-turn race between two coding agents and keeps the better diff
Dual loop is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 10
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Dual loop
Dual-loop is the iteration phase of the dual-haul workflow. On each goal turn it has two independent implementers, one Claude and one Codex, each work in a separate git worktree branched from the same base commit. The orchestrating agent then runs the goal's stated check in both worktrees, scores the results with an explicit rubric covering goal progress, correctness and diff size, and merges only the winning diff into the main tree. A round can keep nothing if both attempts fail the check.
The skill is mainly a process guide. It asks the user once, before the first round, which model each racer should use, and requires the Claude racer to differ from the orchestrator's model. It also covers the round log in STATE.md, folding in user notes, writing the round brief, and printing a short digest of each round in chat. Cleanup removes the worktrees after every round.
It relies on a companion handoff.sh helper from the dual-haul reference folder to spawn and wait on the racers, and assumes a git repository and the Claude and Codex command-line tools are available. It ships as a single SKILL.md with no bundled scripts.
When your agent uses it
Phase 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.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the dual-haul plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add ccomkhj/skills
/plugin install dual-haul@ccomkhj-skillsOr copy only this skill to ~/.claude/skills/dual-loop:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dual-loop &&
cp -R "$tmp/dual-haul/skills/dual-loop" ~/.claude/skills/dual-loop &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/dual-loop inside it instead.
Copy the skill folder to ~/.agents/skills/dual-loop to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dual-loop &&
cp -R "$tmp/dual-haul/skills/dual-loop" ~/.agents/skills/dual-loop &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/dual-loop inside it instead.
Copy the skill folder to ~/.cursor/skills/dual-loop to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dual-loop &&
cp -R "$tmp/dual-haul/skills/dual-loop" ~/.cursor/skills/dual-loop &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/dual-loop inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/ccomkhj/skills.git --path dual-haul/skills/dual-loopOr copy the folder to ~/.gemini/skills/dual-loop yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/dual-loop:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dual-loop &&
cp -R "$tmp/dual-haul/skills/dual-loop" ~/.copilot/skills/dual-loop &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/dual-loop inside it instead.
Get the folder:
git clone --depth 1 https://github.com/ccomkhj/skills.gitThen copy skills/dual-haul/skills/dual-loop into your agent's skills folder as dual-loop. Agents that support SKILL.md read one folder per skill.
What it does
- Two-racer race
- Runs a Claude implementer and a Codex implementer in isolated worktrees off the same commit each round.
- Model selection gate
- Asks the user which model each racer uses once before round one and blocks a Claude racer matching the orchestrator.
- Rubric-based judging
- Ranks attempts by goal-check progress, correctness, then diff quality before choosing a winner.
- Verified merge
- Merges only the winning commits and re-runs the stated check on the main tree afterwards.
- Round tracking and digest
- Keeps a round log in STATE.md and prints a short chat summary of each race for progress review.
- Stop conditions
- Halts iteration at the round cap, after repeated empty rounds, or when a racer or worktree fails.
Good for
- Race two coding agents on a performance fix and keep the version that passes the benchmark
- Iterate on a failing test suite by comparing a Claude attempt and a Codex attempt each round
- Run an improvement loop that merges only changes verified by a stated check
- Compare two model implementations of a refactor before committing to one
Dual loop FAQ
What does the skill need before Dual loop starts?
It needs an active /goal with a stated check, a dual-haul run, and the handoff.sh helper. Before round one it asks which model each racer should use.
Can the Claude racer use the same model as the orchestrator?
No. The skill requires the Claude racer model to differ from the orchestrator model and refuses a match.
Does the skill modify my main branch on every round?
Only the winning racer's commits are merged, and only when the goal's check passes in its worktree. If neither passes, nothing is merged.
Does Dual loop run without a goal?
No. It is designed for the iteration phase of a dual-haul run under an active /goal.
How do I install Dual loop in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/dual-loop to use it in all your projects, or to .claude/skills/dual-loop in one project. Or install the dual-haul plugin, which includes it: /plugin marketplace add ccomkhj/skills, then /plugin install dual-haul@ccomkhj-skills.
Does Dual loop run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Dual loop?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Dual loop?
The closest alternatives to Dual loop are Dual haul, Dual report, Dueling autoresearch, Haul loop and Long haul.
Where this comes from
- Description: from the skill's own SKILL.md.
More from ccomkhj/skills

Audits AGENTS.md project memory files and proposes targeted, approved updates
- Open source
- 10 GitHub stars
- Developer tools

Builds interactive HTML lessons that teach AI, ML or science concepts through worked cases
- Open source
- 10 GitHub stars
- Education and exam prep

Runs a project and builds an interactive walkthrough from what actually executed
- Open source
- 10 GitHub stars
- Developer tools

Turns a clear improvement target into a measurable Claude Code /goal condition
- Open source
- 10 GitHub stars
- Developer tools

Races Claude against Codex in separate git worktrees until a measurable goal is met
- Open source
- 10 GitHub stars
- Developer tools

Writes a final goal-vs-achieved report for a dual-haul run with verified checks
- Open source
- 10 GitHub stars
- Developer tools


