2026-11-26 15:40 UTC

Agent Trace brings selected Codex and Claude Code histories into local MCP workflows

state: watchingheat: mediumuncertainty: mediumrelevance: mediumagent-session-history cross-harness-contextWill Cook

What is this?

Will Cook’s Apache-2.0 Agent Trace project reads selected Codex and Claude Code session files and exposes their histories to agents through a local MCP server and Python library. Its README says the reader and agent tools are available now; a desktop app and its in-Codex interface are not yet packaged. Agents can search and read conversations from either tool, while structured operation-level queries—such as retrieving command outputs or patches, including selected subagent records—are supported only for certain newer Codex records, not Claude histories or older Codex conversation-only files. The server reads only files listed by the user, does not execute recorded commands, and retrieved text may be sent onward by the requesting host to its model provider. Cook’s Show HN post describes the cross-tool context-sharing use case. The later supplied HN item is about a separate product, Diana, and provides no evidence about Agent Trace. No independent adoption or performance evidence is supplied.

Why it matters

Agent Trace could let a coding agent carry useful context across sessions and between Codex and Claude Code, reducing manual transcript copying and enabling targeted inspection of prior tool activity. Its local, user-selected access model and open-source availability may make this useful to individual developers and agent workflows, but packaged desktop features are still future work, and the supplied evidence does not establish adoption or broader impact.

Current assessment

New development: Will Cook presents Agent Trace as a working local MCP server and Python library for reading user-selected Codex and Claude Code histories; the project is free and Apache-2.0. The README documents compact and detailed conversation views, search, paging, and, for supported Codex event records, operation-level search and retrieval, including outputs, patches, and selected subagent histories. These structured queries do not cover Claude histories or older Codex files. The desktop app and in-Codex interface shown in project materials are not yet packaged, despite the original post describing an app and asking whether people want the interface. The server reads files on request and does not execute their recorded commands; the requesting host may transmit retrieved text to its model provider. Potential implication: agents could reuse prior work across harnesses and inspect specific evidence from earlier runs rather than rely on pasted transcripts. Evidence is first-party project documentation and the author’s Show HN post; no independent validation or adoption data is provided. The supplied later HN story concerns Diana, a separate terminal product, and does not substantiate Agent Trace claims.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady1 platformsage 552h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-03 15:20⭐ origin directly observedShow HN: Agent Trace, let agents query Codex and CC chat histories
will-cook-25 on hacker news
—
11-07 02:19first on hacker news · published · +83.0hDiana – a terminal that records what your coding agents did
gyandroid
—
11-03 15:20amplified on hacker newshn.story.50353110
will-cook-25
peak 1 · 0 comments · 34% of case engagement
11-07 02:19amplified on hacker news 👑hn.story.50401027
gyandroid
peak 2 · 0 comments · 69% of case engagement
11-03 15:21our radar first saw it · +0.0hdiscovery anchor: hn.story.50353110—
pace: p35 vs 1845 stories at the 336h mark (now 552h old) — ahead of adobe-max-ai-agents-creative-tools-mcp (1.5x), behind 42loop-agent-operated-product-experiment (0.8x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hn ⭐Show HN: Agent Trace, let agents query Codex and CC chat histories
Retrieved article excerpt

Open article · Retrieved 2026-11-03T15:23:25.543557+00:00

# Agent Trace

[Agent Trace desktop app showing a running Codex chat, its workers and copy controls](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/images/agent-trace.png)

*Desktop app preview. You can install the history reader and agent tools today. The desktop app and its in-Codex interface aren't packaged yet; both would also be free and open source.*

**Let an agent read your earlier Codex and Claude Code conversations.**

Agent Trace reads the session files that Codex and Claude Code save on your computer. An agent in either app can read chats from both sources, including messages and recorded tool activity from a chat that is still running. You choose which session files it can access.

The **MCP (Model Context Protocol) server** runs locally and gives your agent tools for finding and reading those histories. The package also includes the underlying Python library. The desktop app shown above uses the same reader and adds automatic chat discovery, file watching and copy controls.

## What it does

For **Codex and Claude Code histories**, an agent can find a selected chat by title or ID and read it in either view:

| View | What it returns |
| --- | --- |
| **Compact** | Messages and tool-call previews, including commands and file paths where recorded. Tool results are omitted. Codex event records also provide visible reasoning summaries, command outcomes and changed paths. |
| **Detailed** | The conversation plus recorded tool inputs and results. For Codex event records, large outputs and patches have previews with references for retrieving the full value; repeated large text blocks appear once, with references where they recur. |

Compact is a filtered transcript, not an AI-written summary. Long responses are split into pages that the agent can request as needed.

See the difference on a real recorded command

[Two views of the same Codex test command. Compact includes its exit status; detailed adds the recorded output showing 124 tests passed and none failed. Selected fields are shown.](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/images/compact-detailed.svg)

Both views include the command. Detailed also includes its output. This command pipes the tests through `tail`, so the exit code alone does not establish that the tests passed; the recorded test summary does. The image shows excerpts from [the actual validation history](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/investigation.md).

An agent can also request just this command's output with `read_trace_item`, selecting the `/aggregated_output` field. It does not have to read the whole detailed conversation.

For **supported Codex event records**, an agent can also:

- **Find a specific operation:** search commands, outputs, patches and other recorded items by text, type or failure status. Each match identifies the field and matching passage.
- **Read just the relevant evidence:** retrieve one item, such as a command execution, or one field, such as its output. Results include session and item IDs so the agent can identify its source.
- **Include subagents:** search a parent chat and the child chats whose files you have also selected. Parent-child links are checked against the session records.
- **Check what changed:** compare two reads of a running chat to find added, updated or removed items. An unreadable child chat is reported as unavailable.

These queries use structured records of individual Codex operations, called *native items* in the code. They are not yet available for Claude histories or older Codex files that contain only conversation records. An agent in either app can query a supported Codex file.

## Try it

With Git and Python 3.10+ (macOS/Linux shell):

```
git clone https://github.com/wcook04/agent-trace-mechanism.git
cd agent-trace-mechanism
python3 -m venv .venv
.venv/bin/python -m pip install '.[mcp]'
.venv/bin/python tools/inspect_recorded_run.py
.venv/bin/python tools/inspect_agent_tree.py
.venv/bin/python tools/inspect_cross_provider.py
```

These retrieve a real validation history, a Codex review with two subagents, and a Claude review that read their findings through MCP. They print the results without running the recorded commands. No API key, private app or Node installation is needed. [Use your own chats in Codex or Claude →](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/mcp.md#setup)

[A real investigation: checking a worker's failed tests, correction and retry →](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/investigation.md)

[A fresh coordinator and two subagents reviewing this repository →](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/agent-tree.md)

[Claude reads the Codex review, then Codex reads Claude’s findings →](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/cross-provider.md)

## Let your agent set it up

Give Codex or Claude Code this request:

> Install Agent Trace from <https://github.com/wcook04/agent-trace-mechanism> on this machine. Read `skills/agent-trace/SKILL.md` and follow its installation guide for my host and environment. Preserve my existing configuration, help me select which histories to register, and verify a real MCP read from my working project.

The [portable skill](https://github.com/wcook04/agent-trace-mechanism/blob/main/skills/agent-trace/SKILL.md) covers setup and using the tools.
To keep it available in future chats, run one of these from the checkout:

```
python3 tools/install_skill.py --host codex
python3 tools/install_skill.py --host claude
```

This installs instructions only; it doesn't connect MCP or grant access to any
chat. The [installation guide](https://github.com/wcook04/agent-trace-mechanism/blob/main/skills/agent-trace/references/install.md) covers
project-scoped skills, custom folders, Windows commands and connection checks.

## How it works

Each session file uses JSONL: one JSON record per line.

[Agent Trace reads selected Codex and Claude Code session files. An agent in either app sends MCP requests and receives selected text with source references.](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/images/history-flow.svg)

1. **You choose the source files.** A local JSON configuration file, called the manifest, lists the session files the server may read. The server does not automatically add other chats.
2. **Agent Trace parses the records.** For Codex events, it combines updates to the same item ID into that item's latest recorded state. For Claude conversations, it pairs tool calls with their results and groups messages into turns.
3. **The agent requests what it needs.** MCP tools return conversation text, search matches or selected Codex items. The server retains the result of a read in memory as a *snapshot*, so later pages refer to the same version even if the source file grows. A fresh read picks up new records; snapshots last until the server exits.

The public server reads files on request, without changing them or executing the recorded commands. Continuous file watching is part of the desktop app. The requesting host may send retrieved text to its model provider. [Data access and privacy](https://github.com/wcook04/agent-trace-mechanism/blob/main/SECURITY.md).

Start with [the Codex reader](https://github.com/wcook04/agent-trace-mechanism/blob/main/src/trace_mechanism/codex_native.py), [the conversation parsers](https://github.com/wcook04/agent-trace-mechanism/blob/main/src/trace_mechanism/parser.py) and [the retrieval adapter](https://github.com/wcook04/agent-trace-mechanism/blob/main/src/trace_mechanism/agent_tools.py). [The MCP server](https://github.com/wcook04/agent-trace-mechanism/blob/main/src/trace_mechanism/mcp_server.py) defines the callable tools.

[Usage and tool reference](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/mcp.md) · [How records are processed](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/mechanism.md) · [Development and repository map](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/development.md)

Inside Codex

[Agent Trace plugin inside Codex with chat selection and attach, copy and preview controls](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/images/codex-plugin.png)

The desktop app's plugin lets you select a chat and attach, copy or preview its context inside Codex. Agents can also retrieve context directly through its tools. This repository contains the reader and standalone MCP server used to inspect the mechanism.

## Contributing

[Bug reports and pull requests](https://github.com/wcook04/agent-trace-mechanism/blob/main/CONTRIBUTING.md) are welcome. The [development guide](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/development.md) covers tests and package checks; the [example index](https://github.com/wcook04/agent-trace-mechanism/blob/main/examples/README.md) explains the recordings and generated files. Keep private transcripts out of issues and pull requests.

## Why I built it

I built this while using AI for maths research and making videos and interfaces to help people understand the results.

The core is free and open source, and the full desktop app would be too, under the same Apache-2.0 licence. I won't charge for it. I've just got a lot on my plate, so I'd like to know if people would use it before I spend the time packaging it. If you would, [let me know what you'd use it for](https://github.com/wcook04/agent-trace-mechanism/issues). I'd be happy to make it available.

I'm also sharing this because I'd like more people to see my main projects. You can find them on [my homepage](https://wcook04.github.io/), or start with [the introduction video](https://www.youtube.com/watch?v=MBmVMMogXTA).

Apache-2.0; copyright 2026 Will Cook. Redistributed copies must retain the applicable notices under the licence. If you use Agent Trace in published work, please [cite it](https://github.com/wcook04/agent-trace-mechanism/blob/main/CITATION.cff).

[Licence](https://github.com/wcook04/agent-trace-mechanism/blob/main/LICENSE) · [Attribution](https://github.com/wcook04/agent-trace-mechanism/blob/main/NOTICE) · Will Cook · [Source provenance](https://github.com/wcook04/agent-trace-mechanism/blob/main/docs/provenance.json) · [Security](https://github.com/wcook04/agent-trace-mechanism/blob/main/SECURITY.md)
will-cook-2510
🟧 hnDiana – a terminal that records what your coding agents didgyandroid20

Interpretation history

Decision trace