[BUG] Please don't clear terminal history on compact
Resolved 💬 2 comments Opened Mar 22, 2025 by kentonv Closed Apr 15, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 0.2.53 (Claude Code)
- Operating System: Debian 12.9
- Terminal: gnome-terminal
Bug Description
When the context runs out and /compact is performed automatically, it clears the terminal history and replaces it with the new compacted context.
I get that, after compact, this is all Claude knows. But I, as a human, would like to be able to scroll up to my previous history. I also often like to save the transcript at the end and attach it to my pull requests (I use my terminal's "copy as HTML" function and publish it). It was very sad for me that my history suddenly disappeared!
Steps to Reproduce
- Have long successful claude-code session.
- Hit 0% context remaining.
- The system automatically runs
/compact.
Expected Behavior
I still have my chat history.
Actual Behavior
History is gone. Scrolling to the top of my terminal only shows me the post-compact context.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗