[BUG] On compaction, "All user messages" is incomplete / out of order.
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 is compacted, the history of prompts is retained in the memory as 6. All user messages:, but it contains redacted elements / out of order prompts.
Example:
- "Can you analyze the code from the create-event route, the Time Slots form and the floating action button, and figure out what causes this behavior? In particular: What happens to cause
the times to disappear / How does that affect the second save request / How are the fields refilled with the correct values / How are the fields refilled with the incorrect values" (with full
repro steps)
- "That explains the repro that the team found on investigation, but it doesn't match the timeline we saw on the server... something must have happened to clear all the timestamp fields
and not refill them between 12:19:19 and 13:59:37. What are some things that could have done this, supported by your understanding of the code, and confirmed by a careful reading of the
code?"
- "After investigation, a way was found to reproduce something like this behavior. [repro steps]... Can you analyze the code from the create-event route, the Time Slots form and the
floating action button, and figure out what causes this behavior?"
In this case, the third record is actually a part of the same prompt as the first record (you can tell from the shared "can you analyze the shared create-event route" text, and is also redacted; the middle record comes after both.
Retaining faulty memory of the conversation history seems like it can't improve reliability.
What Should Happen?
The 6. All user messages: block in memory should accurately reflect user messages, their content, an in the correct order.
Error Messages/Logs
Steps to Reproduce
- Carry on a conversation until compaction
- Record user prompts manually
- Press ctrl+o after compaction
- Compare recorded user prompts to remembered user prompts
Claude Model
sonnet 4.6
Is this a regression?
unknown
Last Working Version
_No response_
Claude Code Version
2.1.87
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗