Stop re-running your agent to reproduce one bug.

rewind records a run once, then replays it byte-exact — offline, no API key, $0. Fork any step to compute the future that would have happened.

1× record → ∞ replaysevery run replays forever
$0 per replayzero network, zero tokens
byte-exactdown to SSE chunk boundaries
demo — crash at the last step, 3 paid LLM calls deep
rewind record -- npx tsx demo/agent.ts ✗ TypeError: Cannot read properties of undefined (reading 'toFixed') rewind replay 3f2a91c4 -- npx tsx demo/agent.ts ✗ same crash · offline · $0.00 vim demo/agent.ts # one-line fix rewind replay 3f2a91c4 -- npx tsx demo/agent.ts ✓ audit complete — $5522.61 · fix verified without a single API call rewind fork 3f2a91c4 --at 4 --text '{"total_usd": 0}' # what if the model said $0? rewind diff 3f2a91c4 9be07d12 first divergence at seq 4 — same request, different response

replay

Responses come from a local SQLite journal with exact SSE framing. The SDK can't tell the difference.

fork

Rewrite any recorded response and replay the alternate timeline.

diff

Compare two runs event-by-event, pinned to the first divergence.

closed under replay

Forks re-journal into new runs, so counterfactuals replay offline too.

Quick start

import Anthropic from "@anthropic-ai/sdk";
import { fromEnv } from "rewind";

const session = fromEnv();
const client = new Anthropic({ fetch: session.fetch });
// wrap other non-determinism: await session.io("fx_rate", fetchRate)
rewind record -- node agent.js          # run live, journal everything
rewind replay <run> -- node agent.js    # re-run offline
rewind fork <run> --at 46 --text …      # rewrite step 46
rewind diff <run> <fork>                # where the futures diverge