What remains of a session

From usage and costs to a shared memory: how I preserve sessions, context, and decisions when working with coding agents.

November 28, 2026 · About 6 minutes to read

A steam tug tows the Temeraire along the Thames at sunset in J. M. W. Turner’s painting.

The Fighting Temeraire

J. M. W. Turner, 1839. National Gallery, London. Image: Wikimedia Commons. Public domain.

The code written, the tests that pass, and the problems solved are the aspects we tend to assess in a session with a coding agent. To get there, though, the agent has read files, run commands, and discarded solutions, while we have weighed alternatives, changed our minds, and decided which paths were worth pursuing. The repository keeps the result of this work, but the reasoning that made it possible is often lost.

Session transcripts remain on our computers for at least a while, in the folders where the tools store their history. Other team members and the agents they work with cannot consult them, though, and unless we take steps to preserve them, we risk losing them before they become useful again, perhaps months or years later.

The project I want to talk about began with a different need, but collecting those transcripts helped me understand how useful it could be to make them available for future work. In trying to do that, the project took a different shape from the one I had originally imagined.

Starting with the numbers

When coding agents are used in a company, understanding their costs soon becomes a necessity. Vendors' consoles show overall usage, but they don't always tell us how much work on a particular project cost, which sessions required the most resources, or what happened during those sessions.

I wanted to collect this data in one place without depending on a particular tool, so I started with agent usage telemetry to attribute consumption to individual projects and the sessions that generated it.

The first data gave me something to think about: of roughly 100,000 recorded operations, three quarters were terminal commands and fewer than ten percent were file edits. Counting operations doesn't tell us how much time was spent or how useful the work was, but those numbers made me think about how little the resulting code tells us about what happens during a session. Exploring, running tests, and figuring out how to proceed account for a substantial part of an agent's work, even when they don't lead to a change worth keeping in the repository.

Over time, I replaced the original stack with a dedicated application that calculates costs and usage from individual request events and displays them by project and session. To understand what lay behind those numbers, I also chose to collect the transcripts, where I could find the commands that had been run, the failed attempts, and the discussions that had led to a particular solution.

A shared memory

Collecting sessions made me confront the fact that each machine held a different part of the project's history. A solution found while working on one computer stayed in that computer's sessions, while another might hold the attempts and discussions that had led to a different decision. Switching harnesses, the tools through which we work with agents, also changed the available history. The repository was the same, but what we could learn about earlier work depended on where we were working and which tool we were using.

Agents also routinely maintain project documentation, but not everything that comes up during a session makes it into those documents. A decision may be documented without the failed attempts and discussions that preceded it, which remain in the agent's history and can help explain why that solution was chosen.

I therefore centralized the sessions and made them searchable so I could recover a project's context regardless of the computer or harness being used. There was no longer any need to transfer histories manually or reconstruct what had already been addressed on another machine.

Making sessions accessible to agents also lets them consult earlier work, including that of other team members, while respecting each person's permissions. A decision discussed on one computer can then become the starting point for work on another, even with a different agent.

The collection can therefore become a shared project knowledge base where we can find the reasons behind decisions, the constraints encountered, and the solutions found. This knowledge would otherwise remain in the memories of the people involved and in conversations between colleagues. Preserving it and making it accessible also lets people who join later reconstruct the context without having to know whom to ask or depend on the availability of those who were there.

From sessions to decisions

Having access to transcripts doesn't necessarily make it easy to find the information we need. If I discover during a session that a particular approach doesn't work, the explanation might be scattered across hundreds of operations. I can search for it in the text, but I need to know what to look for or have the patience to reconstruct the reasoning. A colleague facing the same problem might not even know that the session exists and end up repeating attempts whose outcome we already know.

That's why I introduced a shared decision log for each project, recording the decisions made, the reasons behind them, and the results, including discarded alternatives and failed attempts. The log makes this information available without having to extract it from session transcripts first.

Each entry stays in the log even after the decision it describes has been superseded. Entries aren't deleted; new ones are added to confirm a choice or explain why it was changed, preserving the path that led to the current situation.

The log complements the documentation and helps explain system behavior whose rationale may not have been recorded in the project documents. Consulting it lets us find the results of earlier attempts and decide whether it makes sense to revisit a path someone else has already explored.

What remains

These considerations have shaped Admiral. It began as a way to collect telemetry and track usage, then grew to preserve sessions and the decisions made while working with agents.

When we work with an agent, we make decisions, carry out checks, and make mistakes that often find no place in a commit or in the documentation. Preserving what we've learned can save time and effort for someone facing the same problem, including ourselves once we've forgotten the reasons behind a decision.

Not everything deserves to be kept, and there's no guarantee that what we keep will be used again. Still, it's worth holding on to information that could help us understand the project: if it remains only in one computer's history or one person's memory, we risk losing it before we need it again.