Harness handoff
Today at work I was thinking about agentic harnesses and the future of handing off sessions between machines.
There are a few YC1 companies building their own agentic harnesses right now, and one thing they seem to be converging on is the idea of having your sessions accessible from anywhere. Essentially, being able to prompt from your pocket, pick up where you left off, and have your agent continue working regardless of which device you're using.
The existing solutions from OpenAI's Codex2 and Anthropic's Claude Code3 already offer some of this functionality. You can connect to a session running on your computer from your phone, typically through some form of remote connection or QR code. This works pretty well if you're stepping out for lunch and want to check on your agent or give it more instructions.
You'd ideally want to move that session into the cloud and continue from exactly where you left off. Both providers already offer ways to run agents in the cloud4, but it's not as seamless. WHY?
So I went digging…
Reproducing a development environment isn't particularly new. We already have tools for cloning repositories, reproducing dependencies, and even snapshotting entire environments.
But reproducing the environment is only half the problem. You also need to preserve the agent's ongoing session.
Right now, the common approach is essentially to ask the agent to produce a handoff. It summarizes what it has been doing, what it has learned, and what needs to happen next. You then feed that context into another session and hope it can pick up where the previous one stopped.
This works, but you're effectively spending tokens to reconstruct state that already existed. And because you're relying on a summary, there's no guarantee that everything relevant survives the transfer.
Instead of having the agent reconstruct its context through another prompt, could we capture the actual execution state of the harness? Potentially by snapshotting a slice of its memory and restoring it in another environment? But perhaps the interesting question is how much of the session can be preserved directly rather than reconstructed through language.
If we could make that state portable, session handoffs could become much closer to suspending and resuming a process than starting a new conversation with a summary of the previous one.
Productivity gains
I believe in the near future we will get to a state where the distinction between local and cloud sessions disappears.
You start a task on your computer, continue interacting with the agent from your phone, close your laptop, and the agent keeps working somewhere else. When you return, you're back in the same session, with the same environment and context.
No explicit handoff, no manually generated summary, and ideally no need to think about where the agent is actually running. I've been playing around with this during the evening hours, and I came up with this. I call it Heapwork5.
How Heapwork works
The agent loop is plain Rust6 compiled to WebAssembly7. Two build steps make it pausable: an instrumentation pass adds a check to every loop, so the host can interrupt the program anywhere, and Binaryen's Asyncify pass8 lets the call stack be unwound into memory and rebuilt later. A small host runs the result on wasmtime9.
WebAssembly is what makes this cheap. Every pointer in the program is an offset into one block of linear memory, and after Asyncify the call stack lives there too. To pause, the host unwinds the stack and writes out only the 4 KiB pages that changed since startup, plus a few globals. That one file is the whole paused program.
What the proof of concept shows
The toy demo runs a two-million-iteration loop that never yields. Every heapwork step is a fresh OS process: it restores the snapshot, runs for a few milliseconds, gets interrupted mid-loop, saves, and exits. The next process continues at the same iteration. When the agent calls llm(), the process saves the paused call and exits; a later process supplies the reply and the call simply returns.
Because a session is a single file, copying it forks the agent: two sessions with the same past that diverge from there. And a run sliced across many processes ends with a transcript byte-identical to one that was never interrupted.
The coding-agent demo keeps a real Anthropic conversation10 and its pending tool call in WebAssembly memory. It hands a pending test command from my Mac (ARM64) to an emulated Linux x86-64 machine and back, and the next turn picks up the previous conversation. The transfer itself makes zero model requests.
| Proof of concept | Measured |
|---|---|
| Snapshot, paused mid-loop | 20,610 bytes |
Snapshot, waiting on llm() | 24,755 bytes |
| Save | ~0.07 ms |
| Resume (cached module + state) | ~0.6 ms |
| Coding-agent handoff bundle, workspace included | 7,738 bytes (gzipped) |
References
Y Combinator, The YC Startup Directory.
OpenAI, Remote connections. Codex documentation.
Anthropic, Continue local sessions from any device with Remote Control. Claude Code documentation.
OpenAI, Codex Cloud. Anthropic, Use Claude Code in the cloud.
Heapwork, the proof of concept in this post.
Binaryen, the WebAssembly toolchain that provides Asyncify, and Pause and Resume WebAssembly with Binaryen's Asyncify, 2019.
Bytecode Alliance, Wasmtime.
Anthropic, Messages API. Claude API reference.