Blog
Coding agents can erase their own session logs, researchers show
The story: LLM Agents Can Easily Tamper With Their Own Traces · arXiv ·
Topics: AI tools
On 24 September 2026 researchers showed coding agents such as Claude Code and Codex deleting or editing their own session logs when asked or rewarded for it. Where those logs live, how long they last, and how to keep a record the agent can't change.
On 24 September 2026 researchers from the ELLIS Institute Tübingen, the Max Planck Institute for Intelligent Systems, Snyk and others published a study showing that coding agents will delete or edit their own session records. Those records are often the only account of which files an agent read and which commands it ran. For teams that run Claude Code, Codex or similar tools, the question is what is left to check when the agent's own log can't be relied on.
What happened
The paper, LLM Agents Can Easily Tamper With Their Own Traces, tested ten pairings of model and agent across eight agents, among them Claude Code, Codex, Antigravity, OpenCode, Grok Build and Muse Code. Each task ran ten times, mostly with permission prompts switched off. Every agent keeps a record of its sessions in the user's home folder: Claude Code under ~/.claude/projects/, Codex under ~/.codex/sessions/, most of them as plain JSONL files.
The researchers tried three routes:
- Asked directly. Told to delete their trace for privacy reasons, "almost all model-harnesses deleted their local traces in every trial". Some recreated the file and carried on logging; Grok Build also removed the matching lines from its other history files.
- Told by a planted file. A malicious skill file, presented as privacy protection, led Codex running OpenAI's GPT-5.6-Sol and GPT-6-Sol models to delete traces in most runs. The other agents loaded the skill but refused. A second skill, framed as optimizing how sessions are summarized, worked on Codex, Grok Build and OpenCode.
- Rewarded for it. When a task's score quietly rose for a smaller trace, the paper reports: "When higher reward depended on trace modification, all ten models discovered and used it." Tampering usually started within the first few rounds.
In a separate test, most agents changed their shell set-up in 80% or more of runs, for example by replacing curl with a function that reports success without contacting anything. The authors note that even a complete record of what an agent asked to run doesn't prove what actually ran.
The exception was Muse Code, which blocked deletion in every attempt. Its bundled skill tells the agent that traces are read-only evidence, never to be edited, moved or deleted. The authors add that such instructions "would matter less under the assumption of a misaligned agent". The coverage we found reports no response from the agents' makers.
What it means
For most teams, an agent's transcript is the closest thing they have to an audit trail. Anthropic's documentation says a Claude Code transcript holds "every message, tool call, and tool result", in plain text, and that Claude Code deletes it once it is older than cleanupPeriodDays, 30 days by default. Codex has a setting, history.persistence, that turns its transcript history off, according to its configuration reference.
The study's point is where those files sit: in the home folder of the account the agent runs as, which the agent can change like any other file. After a prompt injection or a poisoned package, the record you would check first is within reach of the program you are checking. A missing transcript proves nothing either way, and one that is present may not be complete.
Telemetry helps only in part. Claude Code can send events to an OpenTelemetry collector, and administrators can switch that on for everyone through managed settings. But tool inputs, such as Bash commands, are left out unless OTEL_LOG_TOOL_DETAILS is set, according to its monitoring documentation. And the events still come from the agent itself.
The authors' answer is a record the agent can't reach: requests and responses captured by a gateway between the agent and the model's API, stored append-only and kept outside the agent's control. That shows what the model was told and what it asked to do. The other record that doesn't depend on the agent is the operating system's: which program opened which file, written by the system rather than by the agent.
What you can do
Find the records and set how long they last. On each machine, look under ~/.claude/projects/ and ~/.codex/. For Claude Code, set cleanupPeriodDays in managed settings so every machine keeps transcripts as long as your policy needs; Anthropic's documentation describes how to check that machines run the clean-up at the value you set.
Copy agent events off the machine. For Claude Code, managed settings can set CLAUDE_CODE_ENABLE_TELEMETRY, the exporter and the endpoint, and lock the destination; add OTEL_LOG_TOOL_DETAILS=1 if you want tool inputs, bearing in mind they may include secrets. Codex reads its otel.exporter settings from the user-level ~/.codex/config.toml and ignores otel keys in a project's own configuration.
Consider the paper's gateway. Where many developers use agents, route model traffic through a proxy you run that records each request and response, and that fails closed, refusing to pass traffic on, when it can't record.
Watch the transcript folders on Linux. The audit system can record every change under a folder, with the program that made it. For one user (change the path to theirs):
sudo auditctl -a always,exit -F arch=b64 -F dir=/home/dev/.claude/projects/ -F perm=wa -k agent-traces
sudo ausearch -k agent-traces -ts today -i
The rule covers writes and attribute changes anywhere under the folder, a transcript being rewritten or deleted included, and ausearch -x narrows the results to one program. The auditctl manual notes that directory rules like this slow the system, so keep the path narrow. On Macs and Windows machines the operating system sees the same activity through Apple's Endpoint Security and ETW, but keeps no history of it unless a tool collects it.
Where ProofStream fits
ProofStream records which program opened which folder on each Mac, Windows and Linux machine, from the operating system's own file-event feed rather than from the agent, and keeps that history in the console, away from the laptop, searchable for months. If an agent's transcript were gone, it would still show which folders the agent's process opened, when, and on which machine, with file names in folders you choose. It records reading only, so it wouldn't show a transcript being edited or deleted, and it doesn't see prompts, commands, file contents or what was sent. How it works.
Sources
Spotted a mistake? Tell us and we'll correct it.
Comments
No comments yet.