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.
Responses come from a local SQLite journal with exact SSE framing. The SDK can't tell the difference.
Rewrite any recorded response and replay the alternate timeline.
Compare two runs event-by-event, pinned to the first divergence.
Forks re-journal into new runs, so counterfactuals replay offline too.
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