[BUG] Context compaction triggers too frequently and takes too long, disrupting workflow
Resolved 💬 3 comments Opened Mar 10, 2026 by YooClid Closed Apr 16, 2026
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?
Context compaction occurs very frequently during normal development sessions and takes a significant amount of time to complete, during which the user cannot interact with Claude.
Problems:
- Frequency: Compaction triggers multiple times per session, even during moderate-length conversations. In a single working session (~2-3 hours), compaction can occur 3-5+ times.
- Duration: Each compaction takes 30-60+ seconds, during which the user must wait with no progress on their task.
- Context loss: After compaction, Claude loses critical context — forgets rules it wrote to memory files, misidentifies data sources, and repeats mistakes that were already corrected earlier in the session.
- Cumulative impact: Frequent compaction + context loss + repeated corrections = significant productivity drain. The user ends up spending more time re-explaining than getting work done.
Real-world impact: In a trading system management session, compaction caused Claude to read a 3-day-old cache file instead of calling a live API (a rule explicitly saved to memory/critical_rules.md), resulting in position data that was 12x wrong (BTC showed 1.79M KRW vs actual 148K KRW).
What Should Happen?
- Compaction should trigger less frequently — optimize context usage to delay compaction
- Compaction should be faster (ideally under 10 seconds)
- After compaction, persistent memory files (especially
critical_rules.md) should be re-read and actively applied, not just passively loaded
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session with a moderately complex project (40K+ lines codebase)
- Work for 30-60 minutes on tasks that involve reading files, running commands, and editing code
- Observe that context compaction triggers, pausing all interaction for 30-60 seconds
- After compaction, ask Claude to perform a task that was constrained by a rule written earlier in the session
- Claude violates the rule — the compaction summary did not preserve the constraint
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.71
Platform
Anthropic API
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 ↗