Agent memory vs deterministic replay
Agent memory and deterministic replay both carry an AI agent's past work into its next run — which is where the confusion between them starts. Agent memory persists knowledge: facts, preferences, and instructions — memory files, conversation summaries, vector stores — loaded back into the model's context so the next reasoning pass starts better informed; the model still runs, still bills tokens, and may still act differently than it did last time. Deterministic replay persists behavior: the tool calls the agent made are recorded, compiled into a skill file, and re-executed directly, with an assertion checking every step and no model in the loop. Memory changes what the model thinks with; replay removes the model from steps that never needed it.
Two answers to the same bill
Every recurring agent job raises the same complaint: the agent re-derives from scratch what it already worked out yesterday. Agent memory answers by carrying knowledge forward. Claude Code loads CLAUDE.md files and its auto-memory notes at the start of every session; LangGraph gives agents short-term memory (the thread's message history within a session) and long-term memory (facts, past events, and rules stored across sessions); MemGPT pages older context in and out of the window the way an operating system moves data between fast and slow storage. Different designs, one destination: the model's context, read again on the next reasoning pass.
Deterministic replay answers by carrying behavior forward. The tool calls from a run that worked — typed JSON requests, typed JSON responses — are recorded and compiled into a skill file, and later runs execute the recording directly, checking an assertion at each step. No context window is involved, because no model is involved. One disambiguation: replay here means re-executing recorded tool calls against the live systems they originally hit. Observability products use session replay for a recording you watch; nothing re-executes.
The cost shapes follow from the mechanisms. Memory adds tokens to every run — the Claude Code docs note that memory files consume context tokens alongside the conversation, every session — and buys a better-informed pass with them. Replay subtracts the pass. In Reelier's published benchmark, the agent arm of a small two-step npm lookup averaged 18,390 input tokens per run; the replay arm measured 0 input and 0 output tokens, verified from the run record on every one of 1,000 replays rather than assumed.
Advisory knowledge vs executable behavior
Memory stays advisory. The Claude Code docs put it in four words: memory files are treated as "context, not enforced configuration" — the model reads them and tries to follow them, with no guarantee it acts the same way twice. That is what memory is for: the next judgment should be better, and a judgment pass is allowed to change its mind. It also means memory never buys determinism. As memories accumulate and get edited, the model's input shifts, and its behavior shifts with it.
A replay is executable. The recording is the artifact: each step re-runs exactly as recorded, an assertion checks the fresh response, and a step that diverges fails loudly instead of being papered over by fresh model output. Determinism holds by construction — in the same benchmark's N=1000 tail-variance test, all 1,000 replays produced byte-identical output, compared programmatically — and when the world under the recording changes, you get a named failing assertion, never a quiet adaptation.
The nearest neighbor in the memory taxonomy is what LangGraph's docs call procedural memory: stored rules and instructions an agent consults, its own prompt included. A compiled SKILL.md looks similar on disk — markdown, in your repo, reviewable like code. It differs in kind: the runner executes it without asking a model to follow it, and assertions stand in for adherence. Advice can be ignored; a failing assertion cannot.
Complements, and where the line sits
The two compose rather than compete, because they cover different halves of a job. Judgment — triage, synthesis, deciding what a change means — needs a model on every run, and memory is what makes those passes good. The deterministic core — fetch, extract, assert — needs no model after the first run, and replay is what makes those steps free. Most recurring jobs are a deterministic core wrapped in a thin judgment layer; give each layer its own mechanism.
Reelier draws that line in the CLI. At the default --max-level 0, a replay never constructs an LLM client, so 0 tokens holds by construction. Model help is opt-in and BYOK: --max-level 1 lets a model re-read an already-captured observation to heal a stale assertion, and --max-level 2 lets it additionally re-execute a single read or idempotent-write step. Destructive steps are never escalated.
Two more boundaries before you rely on either mechanism. Writes: replay is read-only by default, and recorded write steps re-fire only behind --allow-writes — a gate that earns its keep, since in the measured corpus behind Reelier's launch writing only 1.1% of scanned sessions were read-only end-to-end. Capture: where the platform keeps a scannable history, reelier scan reads it — Claude Code's ~/.claude/projects JSONL transcripts are the native format — while Cursor stores its history in a SQLite database, so it has no history scan; capture there is the reelier mcp --wrap recording proxy, which records every call losslessly while the job runs once as usual.
A real receipt
The receipt below is what replay's statelessness looks like: the vendor-status-sweep portfolio skill — two recorded HTTP calls, one to npm's public status API and one to GitHub's — replayed with the published CLI (npx -y reelier@latest, resolved to reelier@0.12.1) on 2026-07-21. The runner started cold. No memory store, no context window, no model: the recording was the only thing it knew.
npx -y reelier@latest run examples/portfolio/vendor-status-sweep.skill.md === vendor-status-sweep === ✓ Step 1 — npm status [passed] 150ms ✓ Step 2 — GitHub status [passed] 85ms PASSED: 2/2 steps ok, 0 failed, 235ms total
Verbatim seed receipt recorded in seldonframe/reelier examples/portfolio/README.md (“Seed receipts — 2026-07-21”, reelier@0.12.1); the README's run records confirm 0 LLM tokens, input and output. Replay it yourself from a checkout of the repo — read-only, no account, no key.
FAQ
Does a deterministic replay remember anything between runs?
Two plain files, and nothing else. The skill file is the recording, and each replay appends its receipt to .reelier/runs/<skill>.jsonl — the file reelier diff compares (the last two runs, SAME or DRIFTED). No embeddings, no store, no accumulated context. A replay needs only the skill file to run; the run log exists so drift between runs has a paper trail.
Which one cuts the token bill?
Replay, and only for the steps it covers. Memory changes what the model reads on each pass; the pass itself still happens and still bills. Replay removes the pass for the deterministic core — 0 tokens by construction at --max-level 0. A job that is judgment end-to-end has no replayable core, and memory plus a model is the right tool for the whole thing.
- Claude Code docs: memory — CLAUDE.md files and auto memory, loaded every session as “context, not enforced configuration”
- LangGraph docs: memory — short-term vs long-term, with semantic, episodic, and procedural subtypes
- MemGPT: Towards LLMs as Operating Systems — tiered context management, the memory line of research
- The benchmark harness (re-runnable) — the agent arm and the N=1000 replay arm behind the token figures above
- The published results: 18,390 input tokens/run on the agent arm vs 0/0 verified on 1,000 replays