TL;DR Run the
jqbelow over the.jsonlof your long sessions. If a file shows two or more identical reads, add aCLAUDE.mdrule to work from the earlier read, and ask for line ranges when you only need part of a file: 9 lines cost 309 new tokens, the whole file 21,842.
Up to v2.1.316, when Claude called Read on an unchanged file with the same range as before, Claude Code didn't send it again: it returned one line saying the call was wasted. v2.1.317 removed that line. Every reread of an unchanged file now enters the context whole, and it stays in the history that gets sent again on every later turn.
What a second read returns now
The v2.1.317 changelog says it in one line:
Removed the Read tool's "file unchanged since your last Read" stub: reading an unchanged file again returns its content
What Claude used to get, as the v2.1.316 binary sends it:
Wasted call — file unchanged since your last Read. Refer to that earlier tool_result instead.
And when it used Read on a CLAUDE.md already loaded at startup, a similar note: This file is already in your context ... and has not changed on disk. In v2.1.316 this was on by default, with a remote switch to turn it off; in v2.1.325 the file_unchanged result type and that switch are gone. Tested on v2.1.325, the second read returns the whole file again with its line numbers, and a Read on the project's CLAUDE.md returns the full file even though it was already in context.
What each reread costs
To measure it, a -p run on Sonnet 5.5 was told to read a 44 KB, 1,503-line TypeScript file three times in a row without touching it. Each row is one API request from the session's .jsonl; new tokens are input_tokens plus cache_creation_input_tokens:
request what it adds new tokens read from cache
1 startup and first Read call 5,318 28,047
2 1st read 21,842 33,363
3 2nd read, identical 21,842 55,203
4 3rd read, identical 21,842 77,043
Two things follow:
- A reread costs as much as the first read: 21,840 of those tokens are written to the cache, which on a subscription is a one-hour write at twice the input price.
- You don't pay for it once. The right column grows by 21,840 per copy, and every copy rides along in every request left in the session as a cache read (0.05x the input price on Opus 5.5 and Sonnet 5.5). It's the same mechanism that makes repeating an
@on the same file expensive, now throughRead.
Editing the file in between doesn't change the math. After an Edit, the result tells Claude the file's state is already in its context and there's no need to read it back. In another test session, with a prompt that asked to read, edit and read twice more, each whole read after the edit added 21,849 new tokens.
Why you don't see it coming
- The UI groups them. The three reads in the table show as a single line,
Read 1 file. /contextdoesn't split them out. It all lands inMessages. Per the v2.1.325 binary, itsFile reads using ...suggestion, the one in the/contexttip's screenshot, shows up once reads pass 5% of the window and 10,000 tokens (from 15% on,Read results using ...replaces it), and the "save ~" it offers is 30% of everything read: a fixed estimate, not counted repeats. In the table's session, opened in the terminal, it didn't appear.- Unprompted, it didn't reread. In a four-turn session on the same file, an edit included, neither Sonnet 5.5 nor Opus 5.5 read it again. And in a separate run that said "check the file again", Sonnet answered from the read it already had. The rereads in the table were asked for in the prompt; the ones in your sessions only your transcript can show.
So before you change anything, check whether it happens to you.
How to find them and cut them
1. Count the identical reads in a session
Claude Code stores every Read result in the session's .jsonl, with the path, the start line and the content. This jq groups by all three and lists whatever was read identically more than once:
jq -s -r '[.[] | .toolUseResult.file? | select(.filePath? and .content?)]
| group_by([.filePath, .startLine, .content])
| map(select(length > 1))[]
| "\(length) identical reads · \(.[0].numLines) lines · \(.[0].filePath)"' \
~/.claude/projects/<your-project>/<session>.jsonl
On the test session that read the file, edited it and read it twice more:
2 identical reads · 1504 lines · /root/pagos/src/payments.ts
Read counts 1,504 lines because the file ends in an empty line. The first read isn't listed because its content predates the edit: only identical copies are grouped. If a /compact ran between two of them, check the size: after compacting, Claude Code brings back up to five recently modified files with their content, and one over 5,000 tokens comes back only as a path, so that reread was needed. Each subagent has its own .jsonl and its own context.
2. If they show up, give Claude the rule
In the project's CLAUDE.md or in ~/.claude/CLAUDE.md:
# Reading files
A file you already read in this session is still in your context. Before reading it again, work from that read; read it again only if it changed since (an edit, a tool or the user), or read just the lines you are missing with offset and limit.
It does what the removed note did, placed where Claude reads it at the start of every session. In the short tests it changed nothing, because without it there were no rereads to cut either: it's for the sessions where step 1 does find them.
3. Ask for the part, not the file
When you know what you're after, say it. "Read lines 1494 to 1502 of src/payments.ts and tell me what handler150 returns" got Sonnet 5.5 to call Read with offset 1494 and limit 9, and the request added 309 new tokens. "What does handler42 return in src/payments.ts when input is 100", with no range, led Opus 5.5 to a Grep that added 382. The whole file, 21,842.
Reference
| Reread | Needed? | What it costs since v2.1.317 |
|---|---|---|
| Unchanged file, first read still in context | No | The whole file again |
| After you or a tool changed it | Yes | The whole file, with the change |
After a /compact or /clear |
Yes, unless the compact brought it back | The whole file |
Only a range with offset and limit |
If you're missing that part | The lines asked for |
Official docs: Tools reference
Requirements
- Claude Code v2.1.317 or later. Measured on v2.1.325, in
-pruns on a test project with Sonnet 5.5 and Opus 5.5, and with the table's session opened in the terminal. jqfor step 1.