Your coding agent's prompt often contains old versions of files it already edited. Here's what I measured, and what I learned trying to fix it
A developer observed that coding agents often include outdated file versions in their prompts, even after editing those files. Measurements from 67,074 OpenHands runs revealed that 77.8% of runs contained at least one request with a stale file view, and approximately one in seven requests carried such an outdated file. This issue occurs because the original read of a file typically remains in the conversation history, leading to the agent referencing old code alongside the updated version.
This report uniquely quantifies the prevalence of stale file views in coding agent prompts, showing 77.8% of 67,074 OpenHands runs had this issue, unlike prior anecdotal observations.
时间与来源
时间显示为 UTC
显示时区:UTC
本地时区尚不可用,暂时显示 UTC。
发布当时偏移:UTC+02026年9月28日 21:40 UTC
收录当时偏移:UTC+02026年9月28日 22:00 UTC
- 发布
- 2026年9月28日 21:40
- 收录
- 2026年9月28日 22:00
- 来源类型
- 开发者社区
- 档位
- 社区
- 信源状态
- 正常
档位是按信源手工设定的编辑判断,不是逐条打分。
讨论趋势
百分比基于采集到的讨论信号,不代表新增评论数或独立参与人数。曲线仅用于同一话题在不同时段的比较。
Something I didn't appreciate until I measured it: when Claude Code (or any agent) reads a file and later edits it, the original read usually stays in the conversation. Every following request carries the old code next to a file that no longer matches it.
I measured this on 67,074 public OpenHands runs (not Claude, but the same basic loop). 77.8% of runs had at least one request with a stale file view, even counting only the agent's own edits. About 1 in 7 requests carried one.
Most of the time the model copes by re-reading. Where it bites is:
- long sessions
- edits from outside the agent's view (formatters, you editing in your IDE, parallel agents)
- resumed or compacted sessions, where the model trusts what's in the conversation
Some practical things I took from it, whatever tool you use:
- If you edit a file mid-session, tell the agent to re-read it. Don't assume it notices.
- Watch for formatters or hooks rewriting files after the agent reads them.
- In long sessions, stale reads build up. Starting fresh with a summary often beats pushing on.
I also built a context engine that rewrites the outgoing request to keep code current. It works byte for byte in replay, but to be upfront: it doesn't integrate with Claude Code (only Pi and OpenHands), and in my small live tests the model didn't do better when it could just re-read. It also wasn't cheaper. The details are in the write-up, including the failures.
Write-up: https://felipebasurto.com/blog/model-context-is-not-static/
Video: https://www.youtube.com/watch?v=DIVOnXUCZkg
Curious whether people here notice this in practice, especially with parallel subagents editing the same repo.