# Level-0 (zero-token) replay

> Level-0 (zero-token) replay is the default mode of deterministic replay, in which an AI agent's recorded tool calls are re-executed with no model in the loop: the LLM client is never constructed, never called, and never billed, so the run costs exactly zero tokens by construction. Each recorded step re-executes against the live system it originally hit, an assertion checks every fresh response, and a step that diverges stops the run and fails loudly instead of being reasoned around. The level names the bottom rung of an escalation ladder — Level 1 and Level 2 are opt-in, bring-your-own-key model escalations that run only when a step drifts — so the zero is a structural property of the default, verified on the run record, not an average over lucky runs.

Markdown twin of https://www.reelier.com/learn/level-0-replay — one entry in Reelier's glossary of agent-replay terms. The blockquote above is the canonical definition; quote it with the link.

## Where the zero comes from

Replaying without re-running the model is the umbrella practice; Level 0 names its strict form: no LLM calls at any point in the run. `reelier run my-job.skill.md` replays at `--max-level 0` unless you say otherwise, and the rule at that level is blunt — the LLM client is never constructed. There is no prompt to assemble, no context window to fill, no sampling to pay for. Each step in the skill file is a recorded tool call, typed JSON request and typed JSON response; the runner executes it, checks its assertions, binds any extracted values, and moves on.

The zero is then verified rather than assumed. Every replay writes a run record to `.reelier/runs/<skill>.jsonl` whose totals carry explicit `llmInputTokens` and `llmOutputTokens` fields — 0 for a pure Level-0 run. The CLI prints an `LLM tokens:` line only when tokens were spent, and the guided first run goes further: if a Level-0 replay ever reported nonzero usage, it prints a warning with the real numbers instead of a zero claim that would not be true.

What the zero saves is measured, not estimated. In the published head-to-head benchmark, a live agent doing a small npm-metadata task averaged 18,390 input tokens per run; the replay arm's run records showed 0 in and 0 out, checked programmatically on every one of the 1,000 replays in the tail-variance test.

## The ladder above zero

A drifted step is where the levels earn their names. At Level 0 a divergence stops the run: the failing step reports its assertion, the remaining steps report `skipped`, and the process exits 1. Nothing improvises.

Opting in with `--max-level 1` unlocks Level 1: a model re-reads the same already-captured observation and proposes a patched assertion or bind. Nothing re-executes, so a Level-1 heal has zero side effects by construction. `--max-level 2` adds Level 2: the model proposes patched arguments and the step re-executes exactly once against the live system — and only when the step's effect is not destructive. A destructive step never auto-re-runs at any level; fixing one is a human's job.

Escalation is BYOK and lazy about it. The API key is resolved at first actual use, not at startup, so even a `--max-level 2` run that never diverges finishes with zero tokens and no key. A successful heal is written back to the skill file immediately, so the same drift never has to escalate twice. The ladder's aim is to return every job to Level 0.

## What Level 0 refuses to do

It refuses judgment. Triaging an anomaly, summarizing a report, deciding what a change means: that work needs a model on every run, and no replay level substitutes for it. Level 0 covers the deterministic core of a job — the fetch-extract-assert sequence that was identical yesterday and will be identical tomorrow. Most useful jobs are that core wrapped in a thin layer of judgment; replay the core, spend tokens on the layer.

It refuses writes unless told. Replay is read-only by default: `idempotent-write` steps do not re-fire without `--allow-writes`; `destructive` steps are stricter still — they never re-fire without an explicit `--yes`. The gate carries most of the safety story, because read-only jobs are rare — in the measured corpus behind Reelier's launch writing, only 1.1% of scanned sessions were read-only end to end. On a typical real job, the zero-token default is also a no-writes default until you opt in.

And it is not a cache. A Level-0 replay re-executes the recorded calls against the live systems, so latency is tool-call time (the receipt below spent 334ms on one real HTTP request) and the values asserted and bound are this run's values, fresh. When the world changes shape under the recording, the replay fails loudly. That is the design: silent adaptation is what the model would have done.

## A real receipt

This receipt was produced for this page: the `npm-download-radar` seed skill from the Reelier portfolio — one recorded HTTP call to the npm downloads API, with assertions on `status == 200`, `json.downloads >= 0`, and `json.package is string` — copied into an empty directory and replayed with the published CLI. The second command reads the run record the replay wrote; the zeros are in the totals, not in the prose.

```
npx -y reelier@latest run npm-download-radar.skill.md

✓ Step 1 — Last-week downloads [passed] 334ms

PASSED: 1/1 steps ok, 0 failed, 334ms total

cat .reelier/runs/npm-download-radar.jsonl

{"skill":"npm-download-radar","startedAt":"2026-07-21T21:53:11.941Z","finishedAt":"2026-07-21T21:53:12.276Z","passed":true,"steps":[{"n":1,"title":"Last-week downloads","level":0,"outcome":"passed","ms":334,"failures":[]}],"totals":{"steps":1,"passed":1,"unchecked":0,"skipped":0,"failed":0,"ms":334,"llmInputTokens":0,"llmOutputTokens":0}}
```

Run by the author on 2026-07-21: `examples/portfolio/npm-download-radar.skill.md` from seldonframe/reelier, copied to a scratch directory and replayed with the published CLI (`npx -y reelier@latest`, resolved to `reelier@0.13.0`). Both outputs verbatim; the run record is the file the replay itself wrote. Reproduce it the same way — read-only, no account, no key.

## FAQ

**Is zero-token replay the same thing as zero-shot?**

No. Zero-shot is a prompting term: a model performs a task without worked examples, and the model still runs, so the tokens still bill. Zero-token replay runs no model at all — recorded tool calls re-execute, and assertions stand in for the judgment the model applied the first time. When a step does need fresh reasoning, that is escalation, and the tokens it spends appear on the receipt as `LLM tokens: N in / M out`.

**Does Level 0 need an API key?**

No. At `--max-level 0` an LLM client is never constructed, so there is nothing to authenticate. Escalated runs resolve their key from `REELIER_LLM_API_KEY` (or `ANTHROPIC_API_KEY` on the default endpoint) only when a divergence actually triggers a model call — a `--max-level 2` run that never diverges completes without one.

## Related

- [Deterministic replay — the umbrella practice Level 0 is the floor of](https://www.reelier.com/learn/deterministic-replay)
- [Run receipts — where the zeros are recorded, step by step](https://www.reelier.com/learn/run-receipt)
- [Idempotent write gating — why replay stays read-only until you say otherwise](https://www.reelier.com/learn/idempotent-write-gating)
- [Headless agent — the unattended runs zero-token replay makes affordable](https://www.reelier.com/learn/headless-agent)
- [Set it up on Claude Code — freeze a session, replay it at Level 0](https://www.reelier.com/for/claude-code)
- [Agent cost calculator — re-run vs record-once arithmetic on your own numbers](https://www.reelier.com/tools/agent-cost-calculator)
- [From the blog: scheduled agents re-learn the job every run](https://www.reelier.com/blog/scheduled-agents-zero-token)

## Sources

- [seldonframe/reelier — the open-source (AGPL-3.0) implementation; the Level-0 rule lives in src/runner.ts](https://github.com/seldonframe/reelier)
- [Benchmark results — 18,390 input tokens/run (agent arm) vs 0/0 verified on every replay, raw tables](https://github.com/seldonframe/reelier/blob/main/docs/strategy/reelier-launch/benchmark-results.md)
- [api.npmjs.org — the live endpoint the example skill replays; returns fresh JSON on every call](https://api.npmjs.org/downloads/point/last-week/reelier)

Other terms: [Deterministic replay](https://www.reelier.com/learn/deterministic-replay) · [Agent drift](https://www.reelier.com/learn/tool-call-drift) · [Run receipt](https://www.reelier.com/learn/run-receipt) · [Snapshot testing for AI agents](https://www.reelier.com/learn/agent-snapshot-testing) · [Session-to-skill (skill compilation)](https://www.reelier.com/learn/skill-compilation) · [Recording MCP tool calls](https://www.reelier.com/learn/mcp-recording) · [Regression testing for AI agents](https://www.reelier.com/learn/agent-regression-testing) · [Idempotent write gating](https://www.reelier.com/learn/idempotent-write-gating) · [Assertion grammar for agent outputs](https://www.reelier.com/learn/assertion-grammar) · [Agent memory vs deterministic replay](https://www.reelier.com/learn/agent-memory-vs-replay) · [Headless agent](https://www.reelier.com/learn/headless-agent)
