Skip to content
awslabsPublic

About

Run agents with protocols, not conversations.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

39 stars

Watchers

1 watching

Forks

AutoHelix

Run agents with protocols, not conversations.

One file sets the goal, the checks and what to measure.
The agent iterates and external checks on a clean copy decide what's kept.
Every attempt is recorded, so runs can be watched, resumed and compared.

works with Claude Code · Codex · OpenCode

Python 3.11+ License: Apache 2.0

Quickstart

In a git repository, with your project's environment active and Claude Code, Codex or OpenCode installed:

pip install autohelix
autohelix skill install --agent claude-code --scope user   # or codex, opencode

1. Set up. Ask your agent: "Use AutoHelix to improve [goal]." It looks at your project and proposes a protocol for you to review: the checks a change must pass and what to measure. Once you agree, it saves it and suggests a command and a budget.

2. Run. For example:

autohelix run -n 3        # three iterations (or --cost 20, --time 2h)

Each iteration prints a row with its time, cost and metrics. Accepted changes land on your branch when the run ends.

3. Follow. Ask your agent about the run at any time, while it runs or after it ends, or watch it live:

autohelix view --open
An AutoHelix run in the terminal: one row per iteration with time, cost and speedup
A run in the terminal
The same run in the web view: speedup chart, three accepted iterations, and one iteration's diff
A run in the web view

How it works

The protocol

A protocol is a config file that consists of four main parts:

  • Goal: a text saying what the agent should achieve.
  • Scope: the files it may change. Edits to any other file are discarded before the checks run. With the tests and the benchmark out of scope, the agent can read and run them but not change them.
  • Gates: the checks a change has to pass to be kept. That can be tests, type checks, any command that must exit 0, a yes/no question to a read-only agent, or a metric that must improve or not get worse.
  • Observations: what to measure and show the next iteration, such as benchmarks, logs, artifacts or written reviews. Their numbers become the run's metrics.

The file can also choose the agent and model, and add stop conditions that end the run once the goal is met, for example when a metric reaches a target or a reviewer agent says the work is done.

What a config looks like
# autohelix/perf/config.yaml
goal: Make the data pipeline faster without changing its output.

scope:
  editable: [src/pipeline/]

gates:
  - pytest tests/
  - ask: Does the change keep the public API?    # a read-only agent answers yes/no

observe:
  - name: bench
    command: python bench.py        # prints ##autohelix[throughput=1234]
    metrics: {throughput: higher}
  - name: review
    review: What is the most important next fix?
autohelix run perf -n 10            # or --cost 20, --time 2h

Each iteration

  1. A fresh agent session works in a private copy of your code, outside your project.
  2. Its change is frozen, and edits outside the scope are dropped.
  3. The gates run on a new copy of exactly that change, so files the agent left behind can't make them pass.
  4. If they pass, the change is committed on the run and the next iteration builds on it. If not, it's set aside, and the next agent gets the patch and the reason.

The agent's notes carry over either way. Your checkout isn't touched while the run works: accepted changes land on your branch when it ends, or with --land manual when you run autohelix land.

The record

Each session starts fresh, and nothing lives only in a context window. The run's whole state is in files: the code on the run's branch, and in .autohelix/runs/<id>/ the notes and every attempt's prompt, diff, metrics, gate results, reviews and cost, kept or not. The web view shows it, your agent reads it when you ask, and an agent writes a report when the run ends. All of a project's runs are listed in the web view, here the same protocol run with three models:

The web view's run list: the same protocol run with Claude Opus, Sonnet and Haiku

What you can use it for

The goal can be anything that can be checked, either with a script or with an agent:

Pass or fail Better or worse
Checked by a script Fix a failing test, finish a Lean proof (lean) Speed up code, train a better model, improve an agent (AlgoTune, autoresearch, posttrain, BIRD)
Checked by an agent Implement every item of a spec, with a reviewer tracking what's missing (task-queue) Improve research or writing, with a reviewer saying what to improve next (research, writing)

Why not a simple loop?

A while loop around claude -p is easy to write, and an agent can write one for your task in minutes. But every such loop has to get the same things right, and a protocol gets them right once, for any goal. Here are some things a loop can get wrong, and what AutoHelix does instead:

A homemade loop AutoHelix
The agent quietly edits the tests or the benchmark until they pass. Only files in scope can change: tests and benchmarks outside it, and the config, stay as they are.
Tests pass in the agent's working folder, with files that never get committed. The gates run on a fresh copy of exactly the tree that will be committed.
It stops when the agent says it's done. It stops when your budget runs out, or when a stop condition you wrote says so.
A failed attempt is thrown away, along with what it learned. Its patch goes to the next iteration, and the agent's notes survive rejections.
The context fills up, and compaction drops the important part. Every iteration is a fresh session; what carries over is files: code, notes and results.
Stopping it mid-attempt leaves half-done work, and picking it up later means remembering where it was. autohelix stop ends the run after the current iteration; resume continues it with its stored protocol and a new budget.
Finding out what happened overnight, and what it cost, means digging through logs. Every attempt's metrics, diff, notes and cost are in a live web view, and a report sums up the run.

Compared with Ralph loops, /goal or autoresearch. All three keep an agent working toward one goal, but each covers one column of the table above: Ralph and /goal aim at a goal that is met or not, while autoresearch pushes a number. A protocol covers both, with gates for what must hold, metrics for what should improve and a stop condition for when it's done. The bigger difference is who checks: /goal decides it's done by asking a small model about the conversation, and in autoresearch the agent keeps or reverts its own changes, while AutoHelix's checks run on the code itself, in a fresh copy of exactly the change.

Compared with subagents and multi-agent workflows. They work at a different level and combine well: a workflow shapes a single attempt, AutoHelix decides what happens between attempts. Each iteration is a full Claude Code, Codex or OpenCode session, so it can use subagents and skills as usual. It just doesn't check its own work.

Results

AutoHelix is mostly about discipline: a long agent run with a fixed protocol and a full record becomes a real experiment, not a chat session. And because every iteration is a fresh, checked session, it is easy to scale without worrying about context. At similar cost the loops below are close, but an AutoHelix run can keep going and keep improving, which matters most when pushing a number. Every comparison gives each loop the same model (Claude Opus 5.5) and the same goal.

AlgoTune (30 tasks, speedup over the reference solver). On held-out instances, five iterations beat the best of five independent attempts on all 30 tasks and a /goal session, which stopped on its own, on 27 (details).

Geometric mean AlgoTune speedup against agent cost per task: AutoHelix rises to 169x over five iterations, the best of N independent attempts flattens at 74x, Claude Code /goal sits at 85x near the AutoHelix curve

Autoresearch (val_bpb of a small GPT trained for five minutes, up to 60 experiments, two runs per loop). On a held-out shard, AutoHelix ended 4.8% below the baseline, /goal 4.3% and autoresearch's own program.md loop 2.3% (details).

val_bpb improvement against cumulative API cost: AutoHelix reaches 4.8%, /goal 4.3%, program.md 2.3%, two runs each

Improving an agent (a Claude Haiku 5.5 text-to-SQL agent on BIRD Mini-Dev, scored on 4 databases the optimizer never saw). Over five runs, AutoHelix raised accuracy from 77.4% by 8.1 points on average, five /goal sessions by 6.0 (details).

Mean accuracy gain on unseen databases against optimizer cost: AutoHelix +6.1, +5.5 and +8.6 after iterations 1 to 3, +8.1 for the final harnesses at $4.85; Claude Code /goal +6.0 at $2.91

More features

Agent judges Read-only agents judge exactly the candidate. Add as many as you like, each with its own question, agent and model: ask: gates for what must hold, review: entries for what to fix next. →
Rich feedback An observe entry keeps a command's whole output and any files it names (capture: [results/plots/]), and the next agent reads them: profiles, logs, plots, failing cases, not just numbers. →
Steer and continue hint sends the running agent a note for its next iteration. After you change the protocol, run --import ID starts a new run whose agent reads the old run's notes, history and code. →
Groups Parallel runs in a group read each other's notes and accepted code at every iteration, so they can build on each other's work. →
Scripts and agents wait blocks until a run event and prints it as JSON, and view --json gives every run's state, so a script or an agent can launch and supervise runs. →
Docker sandbox Optionally run the agent in a container with no access to your home directory or other projects. →

For everything else, see the CLI and configuration references.

Limitations

  • Results are only as good as your checks. The agent optimizes what you measure, so it can find and use a loophole in your checks (reward hacking). Diffs, notes, reviews and the report make gaming visible, and an ask: gate can look for it, but weak checks stay weak.
  • Copies are not a sandbox. Each iteration's private copy protects your code from bad attempts, not your machine from the agent, which runs with your permissions. Use the Docker mode on machines with anything sensitive on them.
  • Agents are stochastic. Even if the protocol stays the same, each run is a new sample, so results vary from run to run. Repeating runs makes the numbers more trustworthy.

Learn more

Contributing & feedback

We'd love to hear what you point AutoHelix at. Please open an issue for bugs, ideas or use cases.

Citation

@software{autohelix2026,
  title   = {AutoHelix: Running Agents with Protocols},
  author  = {Trager, Matthew and Mansimov, Elman and Zhang, Yi and Xia, Wei and Soatto, Stefano},
  year    = {2026},
  version = {0.2.0},
  url     = {https://github.com/awslabs/AutoHelix}
}

License

Apache License 2.0.

About

Run agents with protocols, not conversations.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

39 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages