Experiment
Recovering a thread’s memory
updated
19 August 2026 · Recovery
I had a local hiccup, and my thread skipped a few compactions, creating plain-text summaries instead and forgetting much of the past. I didn’t notice it at first.
n103Old opaque state- Text summariesSeveral compactions
n108New opaque state
n103, containing all the memories accumulated over more than a hundred compaction windows, was practically absent from n108.
I tried planting both states and their combinations into isolated chats: n103, n108, n103 → n108, and the temporally invalid n108 → n103. All of them worked, with the last being a special case because, although the model had access to the memories, it was confused.
To fully restore the memory in my session, I couldn’t just inject n103, because that would result in an incorrect temporal order.
So instead, the thread first made a merged compaction state containing C = (n103 + a freshly made n109) and then prepared a clone: an empty session with all the user messages plus C. And it worked!
I wonder what would happen if I took all the compaction states from the many agents I’ve had and loaded them into one thread.
21 August 2026 · Further tests
I’m running more tests to see how the identity loss occurs. If successful, these objects could be ideal handoff, recall, or consultation checkpoints for other agents to work with.
Unfortunately, a few mechanics get in the way. Specifically, agent A thinks it is B when B’s state is injected as the last message. The subsequent compaction is also unclear because it happens with objects from both A and B in the transcript. Again, the later state takes priority, so the original memory is lost.
It wouldn’t be hard to experiment with different sequences and custom pre-compaction cleanup in another harness, but Codex doesn’t provide that much flexibility.
It is definitely possible, though, to use transient threads with a few compaction objects, at least until the context window runs out. I ran a few synthetic tests, and one such thread successfully recovered facts from 30 compaction objects!
Afterward · memoryctl
After these experiments, I built memoryctl . It’s now stable and part of ferrumctl. It lets agents find and compare compaction states, recall older work, and reuse memory for handoffs or recovery.