Inspiration
In 1980, Smalltalk-80 kept a whole running system in one image file: save it, move it, open it later exactly as it was, and inspect it while it runs. Most of today's tooling gave that up. A stopped program loses its state, and that hurts the programs we now write the most: long-running AI agents that take many steps and pay a model for each one. When one crashes, it usually starts over. And when one does something wrong, we can read its trace, but not what it had in memory when it did it.
ChronoImage rescues the Smalltalk image for AI agents. A trace shows what an agent said. An image shows what it had in memory when it said it.
What it does
A small Rust agent compiled to WebAssembly reads Frankenstein in 12 parts and asks an LLM about each one. After every step, its whole 8 MiB memory is captured as 2,048 chunks of 4 KiB, each with a SHA-256 fingerprint. Only changed chunks are stored. The AI model is never touched: we capture the memory of the program that uses it.
- Recover without repeating anything. Crash the agent at step 9 and compare three ways back, measured in the browser: starting from zero, replaying with the saved answers (how durable-execution tools work), and pasting the copy. All three reach the same fingerprint. Pasting the copy takes about 2 ms; replaying takes hundreds of ms and grows with the work done. At work factor 1000, recovering step 12 took 2.80 ms against 1.01 s.
- Audit its memory. Read any snapshot in the Inspector, and search a word across every step to see when it entered and left the agent's top 10.
- Correct it while it runs. Like a saved game, fork at step 6 and rename a word in branch B's memory. The page shows the chunks that changed (in red, down to the bytes), and the agent's next question to the AI already contains the new word. With the live model on, the answers change too.
- Hand it over. Save the run as one
.chronofile: a verifiable copy (integrity, not a signature) that carries the agent module. Open it in another browser and the agent resumes with its whole memory checked, edits included.
How we built it
With Kiro, spec first. Four specs with EARS requirements, steering rules (integer-only arithmetic in the agent; no invented numbers on the page: every figure is measured, reported by the provider, or labeled as derived), and two hooks: one runs the engine and runtime tests on every save, the other flags hard-coded metrics in the UI. Decisions went through measured gates: incremental capture only after measuring that ~205 of 2,048 chunks change per step, and autosave timing only after a Chrome measurement showed that saving after every step slowed a run by 12%.
Stack: Rust no_std agent (WebAssembly, no imports), TypeScript + React in a Web Worker, Vitest + fast-check property tests against the real module, headless-Chrome checks of the real UI, and a Vercel function that forwards only the agent's own question template to the LLM.
Claude (Anthropic) was used as an external reviewer of Kiro's work.
Challenges
- A property test found a hole a unit test never would: flipping padding bits in the last deflate byte passed every hash. Now the compressed stream itself is fingerprinted.
- Measuring before freezing the agent exposed three defects: a quadratic edge check, a top 10 chosen from only the first 256 slots, and two strategies that ranked identically.
- Writes to address 0 silently vanished in release builds, and an edge table that filled up made the agent look faster instead of broken.
- A UI pause looked fixed in Node but not in Chrome: the fix had to give the Worker's event loop a real turn.
What we learned
Measure first, then decide; say what was not measured; and make the honest number the one on screen. Editing memory is only safe when it respects the agent's own structures: renaming a word works, but "forgetting" one needs the agent's cooperation.
What's next
Signed images, snapshots inside a step, more effect kinds than one LLM call, and exposing inspect, search and fork as tools, so that one agent can audit another.
Built With
- ai-agents
- chrome-devtools-protocol
- comlink
- fast-check
- gzip
- headless-chrome
- indexeddb
- kiro
- llm
- node.js
- openrouter
- react
- rust
- sha-256
- tailwindcss
- typescript
- vercel
- vite
- vitest
- web-workers
- webassembly
