[BUG] Context compression causes Claude to falsely deny prior work exists, leading to repeated wrong answers
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When a session’s context is compressed, Claude loses the ability to accurately search prior session history. In practice, this means:
Work that was done in a previous session (emails written, research completed, emails sourced) gets “forgotten”
When asked to retrieve that work, Claude searches compressed session JSONL files — but truncates long assistant messages at ~500 characters when scanning
Because the relevant content sits deeper in a long message, Claude misses it entirely
Claude then confidently tells the user the work was never done — which is false
This has happened repeatedly in the same ongoing project: Claude denied that LinkedIn DMs existed (they were in session 448da812, MSG 76, but the search truncated before reaching them). Claude denied that an email address was sourced by Claude (it was in session fbeeccd0, MSG 1035, and was missed for the same reason).
The user had to argue with Claude multiple times, knowing from memory that the work existed, before Claude searched far enough into the message to find it.
What Should Happen?
When Claude searches prior session JSONL files for content, it should:
Read the full text of each message, not a truncated snippet
If a message is too long to read fully, flag that it may have missed content rather than asserting the work doesn’t exist
Never confidently state “this was never done” unless it has exhaustively searched all session files with full-message reads
Error Messages/Logs:
No error messages. The failure is silent — Claude returns a confident wrong answer with no indication that the search was incomplete.
Error Messages/Logs
Steps to Reproduce
Start a multi-session project in Claude Code desktop app (same working directory across sessions)
In Session A: ask Claude to write a long response (e.g. 20+ LinkedIn DMs in one message)
Continue working until Session A’s context is compressed into a summary
In Session B (or after compression): ask Claude to retrieve the DMs written in Session A
Claude will search the Session A JSONL file but truncate each message at ~500 characters
If the content you’re looking for appears after the 500-character mark in that message, Claude reports it as not found
Claude confidently tells you the work was never done
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Running via Claude desktop app (Code tab) — CLI not in PATH, version not retrievable from this session
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The session JSONL files are stored at:
~/.claude/projects/<project-path>/<session-id>.jsonl
Each line in the file is a JSON object. Long assistant messages (20+ items in one response) are stored as a single JSONL entry. When Claude’s internal session-search logic reads these files, it appears to only scan the beginning of each entry — making it structurally blind to content in the second half of long responses.
This is particularly damaging in ongoing work sessions (campaigns, projects, research threads) where prior work is the foundation for current decisions. The user cannot trust Claude’s answer about what was or wasn’t done, which breaks the entire value of persistent project sessions.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗