Skip to content
codeband is pre-release. These docs describe its first release, and some of what they describe is still being built.

Run fork

A run fork is a new run that branches off an existing run at an agent step you choose, with another harness, model, prompt or input for that agent step. An agent step is the recorded work of one agent within a run, from what it starts from to what it produces. The harness is the existing agent runtime that runs an agent step, such as Claude Code or Codex CLI.

A run fork answers “what if” for one agent without paying for the whole run again. Say the implementer of a run wrote a weak code change. You fork the run at that agent step with another model. The agent steps before it keep their recorded values, the new agent step starts from the same commit with the same prompt and input, and the old run stays as it was. You then compare the two runs on the page for the old run.

A run fork branches off a run at one agent step into a new run that points to its parent Parent run never changes planner#0 agent step on Claude Code implementer#0 agent step on Claude Code tests#0 shell step Code change the run ends recorded value reused same step request, another harness points to its parent Run fork at implementer#0 planner#0 not run again implementer#0 agent step on Codex CLI tests#0 runs again Code change its own code change

The example pipeline fix_bug calls three steps. The agent planner reads the target repository and writes a plan. The agent implementer changes the code from that plan. The shell step tests runs the test suite. The first run of fix_bug ran implementer#0 on Claude Code, and you fork that run at implementer#0 on Codex CLI.

  1. You ask for a run fork at implementer#0, with another harness. The run fork reaches the daemon as a run request, the description of a run to start, like every new run.
  2. The engine creates a new run with its own run journal, the ordered list of journal entries that records everything a run has produced so far. The new run points to its parent, the run you forked.
  3. The new run reuses the parent’s run journal up to implementer#0. codeband moves a run forward by run replay: it runs the pipeline from the start, and each recorded step returns its recorded step output instead of running again. So planner#0 returns its recorded plan and does not run again.
  4. implementer#0 has no record in the new run, so it runs as a new agent step. It starts from the recorded step request of the old implementer#0, everything that agent step started from, with your change applied. Here only the harness differs.
  5. The steps after implementer#0 have no record in the new run either. tests#0 runs again on the code that the new agent step wrote, and the run fork ends on its own, with a code change or without one. A run fork delivers nothing: its code change and its new tickets stay in its run journal until you deliver them.

You can fork a run fork. Each run points to its parent, so the runs for one task form a tree that starts at the first run.

Change Fits when you want to
Harness See how Claude Code and Codex CLI handle the same task
Model Try a stronger or a cheaper model on one agent step
Prompt Test a new wording of the agent’s prompt on a step request where the old one went wrong
Input Give the agent a corrected input, such as a better plan

The rest of the step request stays as recorded. A run fork without any change runs the same step request again, which shows how much the work of one agent varies on it.

A run is immutable. codeband never edits a recorded run, and a run fork never writes to its parent. Each change makes a new run instead.

The run journal of a run stays an honest record of what happened. A run that ended in a pull request still shows the agent step that wrote it, even after a run fork of that run found a better one.

Within one run, each step has exactly one recorded value. When a run resumes on changed pipeline code, a recorded agent step still returns its recorded value, even if its prompt changed in the code since then. To run a recorded agent step again, you fork the run.

Why a run fork starts from the same step request

Section titled “Why a run fork starts from the same step request”

An agent step’s step request is everything it starts from: the rendered prompt, the input, the attached step artifacts and the start commit, the commit the agent step starts from. Your pipeline code writes the step request, and the engine records it as written. codeband gives an agent nothing that the pipeline didn’t put into the step request. The agent may explore the target repository at its start commit, and the harness may pass files of that commit to it, such as the repository’s instruction files.

Because the step request holds everything the agent step started from, a run fork can give the new agent step the same start. Anything that codeband added on its own, outside the step request, would be missing from the record, and a run fork could not give it to the new agent step.

The same step request does not make the agent do the same work. A model can take another path from the same prompt, so a new agent step on an unchanged step request can still end differently from the old one.

Give the agent everything it needs through the step request

Section titled “Give the agent everything it needs through the step request”

Information from outside the start commit, such as a CI log or a ticket’s comments, reaches the agent only when your pipeline code adds it to the agent step’s input or attaches it as a step artifact. Then the run fork gets it too.

Expect the steps after the chosen agent step to run again

Section titled “Expect the steps after the chosen agent step to run again”

A run fork reuses the record only up to the chosen agent step. Every function step, shell step and agent step after it runs again, and every human step after it, a typed question to a person, asks its question again. A function step with a side effect outside codeband, such as a message to a chat channel, does it again in the run fork.

The page for a run in the web interface lists its run forks and shows them next to the run: their scores, cost and time, and the step output of each at the agent step where they branch off. A step output is what an agent step produces: its typed value, its step artifacts, its end commit and its agent transcript. The parent run never changes, and the run fork started from the same step request except for what you changed. So when the parent’s implementer#0 and the run fork’s implementer#0 differ, the difference comes from your change or from how much the agent varies on that step request. The run store keeps every step output, so you compare runs without running anything again.

Scores carry the comparison past one agent step. A scorer of your factory scores every run when it ends, a run fork included, so the page shows, for example, that the run fork on Codex CLI passed ci on its first try and cost less.

When a run fork did better than its parent, codeband deliver or Deliver on its page delivers its recorded run result, to a pull request or a patch file, as Run result describes. The parent keeps its own run result and where it went.

  • Agent step: the step request and the step output that a run fork starts from and compares.
  • Scorer: the scores by which you compare a run and its run forks.
  • Agent: where the harness, the model and the prompt that a run fork can change are set.
  • Run: how a run starts, ends and keeps its run journal.
  • Architecture: the daemon and the run store that hold every run and its run forks.