# Haul loop

> Haul loop is an open-source agent skill for developer tools. Runs an iterative explore-or-exploit loop that keeps only measured improvements. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ccomkhj/skills/tree/main/long-haul/skills/haul-loop
- **Repository:** https://github.com/ccomkhj/skills
- **GitHub stars:** 10
- **License:** MIT
- **Skill name:** haul-loop
- **Collection:** https://github.com/ccomkhj/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

Haul Loop is the iteration phase of the long-haul workflow for AI coding agents. On each turn of an active goal, the agent picks either to explore a fresh approach from the base commit or to refine the current best attempt, then implements the change in an isolated git worktree. The attempt is kept only if it strictly beats the recorded incumbent score on the goal's check, so the best result never regresses.

Each round records its mode and reasoning in a round file, runs the goal's check, and reprints the check output in chat so progress is visible. A stall counter forces exploration after repeated rounds without improvement, and a log of tried approaches prevents retrying dead ends. Worktrees are torn down after every round.

The skill can also run detached in the background through a shell driver that runs one headless round at a time, writes progress to a log file, and survives closing the terminal. It expects a git repository, a goal file with a runnable check, and the long-haul companion files for state tracking. The background mode bypasses tool approval prompts, so it is best suited to code-only goals.

## When your agent uses it

> Phase 3 of long-haul — the per-turn loop. Under an active /goal, each turn run exactly one round: decide explore (a fresh approach off the base commit) vs exploit (refine the incumbent), implement the attempt in a git worktree following the /implement contract, run the goal's stated check, and keep the attempt only if it beats the incumbent — a ratchet that never regresses. Writes R<N>.md, surfaces the check output in chat. Pass --background to detach the whole haul into a nohup'd driver that survives terminal/session close (for overnight/remote runs), logging a structured block per loop to PROGRESS.log. Use as the iteration phase of a long-haul run.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ccomkhj/skills/tree/HEAD/long-haul/skills/haul-loop)
- [License: MIT](https://github.com/ccomkhj/skills/tree/HEAD/long-haul/skills/haul-loop)

## Features

- **Explore or exploit decision:** Each round chooses between refining the incumbent and trying a different approach, with the reason recorded.
- **Strict improvement ratchet:** An attempt replaces the incumbent only when it measures better on the goal's check.
- **Isolated git worktrees:** Each attempt is implemented in a throwaway worktree so failed attempts leave the main branch untouched.
- **Stall-triggered exploration:** After a set number of rounds without improvement, the next round is forced to try a fresh approach.
- **Chat-visible check output:** The goal's check output is reprinted after each round so progress can be verified in the transcript.
- **Detached background driver:** An optional shell driver runs rounds headlessly and logs progress to a file, surviving terminal closure.

## Good for

- Iteratively optimize a function until a benchmark hits a target latency
- Keep refining code over a long unattended run while checking a measurable goal each round
- Try a different algorithm when incremental tweaks stop improving a score
- Run an overnight optimization loop on a remote machine and review a progress log in the morning

## Install

### Claude Code

This skill ships in the `long-haul` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ccomkhj/skills
/plugin install long-haul@ccomkhj-skills
```

Or copy only this skill to `~/.claude/skills/haul-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/haul-loop &&
cp -R "$tmp/long-haul/skills/haul-loop" ~/.claude/skills/haul-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/haul-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/haul-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/haul-loop &&
cp -R "$tmp/long-haul/skills/haul-loop" ~/.agents/skills/haul-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/haul-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/haul-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/haul-loop &&
cp -R "$tmp/long-haul/skills/haul-loop" ~/.cursor/skills/haul-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/haul-loop` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ccomkhj/skills.git --path long-haul/skills/haul-loop
```

Or copy the folder to `~/.gemini/skills/haul-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/haul-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/haul-loop &&
cp -R "$tmp/long-haul/skills/haul-loop" ~/.copilot/skills/haul-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/haul-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ccomkhj/skills.git
```

Then copy `skills/long-haul/skills/haul-loop` into your agent's skills folder as `haul-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs a goal with a stated runnable check, a git repository, and the long-haul state files. Background mode also needs a check script in .longhaul/.

### Does Haul loop change my main branch?

Only a measured win is merged into the incumbent branch. Failed attempts are discarded with their worktree.

### How does exploration get triggered?

When the incumbent has not improved for a configured number of consecutive rounds, the next round must explore a different approach.

### Is Haul loop safe to run unattended in the background?

The background driver runs with tool approvals bypassed, so the skill notes it is best for code-only goals. Acceptance gates that touch production or paid infrastructure must stay in a foreground step.

### How do I install Haul loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/haul-loop to use it in all your projects, or to .claude/skills/haul-loop in one project. Or install the long-haul plugin, which includes it: /plugin marketplace add ccomkhj/skills, then /plugin install long-haul@ccomkhj-skills.

### Does Haul 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 Haul 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 Haul loop?

The closest alternatives to Haul loop are Long haul, Dual haul, Haul ship, Haul goal and Dual loop.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Long haul](https://ai-powered.com/skills/long-haul): Long haul is an open-source agent skill for developer tools.
- [Dual haul](https://ai-powered.com/skills/dual-haul): Dual haul is an open-source agent skill for developer tools.
- [Haul ship](https://ai-powered.com/skills/haul-ship): Haul ship is an open-source agent skill for developer tools.
- [Haul goal](https://ai-powered.com/skills/haul-goal): Haul goal is an open-source agent skill for developer tools.
- [Dual loop](https://ai-powered.com/skills/dual-loop): Dual loop is an open-source agent skill for developer tools.
- [Autoresearch](https://ai-powered.com/skills/autoresearch): Autoresearch is an open-source agent skill for developer tools.
- [Harness loop](https://ai-powered.com/skills/harness-loop-chachamaru127-2): Harness loop is an open-source agent skill for developer tools.
- [Optimize loop](https://ai-powered.com/skills/optimize-loop): Optimize loop is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/haul-loop
