Rewind the Crash
The vase broke. Choose how far to rewind the recording.
INTERACTIVE STUDIO · 5 STEPS
A vase breaks in your game. Rewind to find the bump, then try a fix on a copy.
The vase broke. Choose how far to rewind the recording.
Build a debugger with Node.js and a coding agent. Replay the same moves, find the last change and try a fix on a copy.
Download the five-rung Node project →Three Ways In · Layer 3 of 3 · Node.js 22+ · Zero Dependencies
Build a deterministic record-and-replay debugger with your coding agent across five rungs: immutable register/memory snapshots, nondeterministic input tape replay, pre-mutation write watchpoints, backward last-writer binary search, and bounded checkpoint ring eviction. Each rung gives you an architect prompt for Claude Code, Codex, or Cursor, a planted bug that unguided agents write, and a deterministic test suite that catches it.
{ ...state, regs: this.regs } by reference so stepping forward mutates saved history.stop that wrote the bad value at addr — Planted trap: Returning the first write to addr instead of the last write preceding the crash.unzip agent-track.zip && cd time-travel-debugger/agent-track
node --test test/*.test.mjs
mkdir -p my-debugger && cp -n src/starter.mjs my-debugger/engine.mjs
TTD_IMPL=./my-debugger/engine.mjs node --test test/rung-01.test.mjs
Download 5-Rung Agent Track (agent-track.zip) Read AGENT-TRACK.md on GitHub Open agent-track/README.md on GitHub
Explore how replay works in a longer run. Pick a step in the picture below. Gold marks a saved copy. The debugger loads it and runs forward to the step you picked.
Write a debugger for a small JavaScript machine, then use it on a compiled game. You’ll use ES modules (JavaScript files that share code) and WebAssembly (compiled instructions the game runs).
Start with Node.js on your computer. The first check tells you which methods to build.
git clone https://github.com/itsHabib/free-to-learn.git
cd free-to-learn
git checkout 7dba0d743224c10a707307769782b0db3f9a2a1a
cd courses/time-travel-debugger
node lab.mjs start project
node lab.mjs check project 01 --help-used none
Finish with six replay-budgeted bug investigations: each asks you to find a bad write within a fixed number of replayed instructions. Keep your fixes, first attempts and help records in the project folder.
Open the 13-unit course on GitHub → · Download the 13-unit course ZIP