Skip to content
RCreddit.com·

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

AI summary

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.

Why this one

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.

Time & source

Times shown in UTC

Display time zone: UTC

Local time zone unavailable; showing UTC.

PublishedOffset at this time: UTC+0Sep 28, 2026, 21:40 UTC

IngestedOffset at this time: UTC+0Sep 28, 2026, 22:00 UTC

Published
Sep 28, 2026, 21:40
Ingested
Sep 28, 2026, 22:00
Source type
Dev community
Tier
Community
Source status
Healthy

Tier is a per-source editorial setting, not a per-item score.

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.

Source·reddit.com