[BUG] Auto-compaction causes context switch from documentation to coding mode
- Platform :
- Claude Code 1.0.6 (Claude Code) using Sonnet 4.0
- Operating System: Linux 6.8.0-60-generic
- Terminal: Ubuntu 22.05
Bug Description
Auto-compaction causes incorrect context switch from documentation task to coding task, leading to unwanted code modifications when user expects documentation work to continue.
Steps to Reproduce
- Complete a coding task (Qt desktop application development)
- User explicitly shifts to documentation mode to document completed work
- Begin documenting the completed work using Read tools to review files
- Auto-compaction triggers during documentation session
- Assistant incorrectly resumes coding instead of continuing documentation
Expected Behavior
After auto-compaction, assistant should maintain current task context and continue documenting the completed Qt desktop application work.
Actual Behavior
After auto-compaction, assistant reverts to previous coding context and starts making unwanted code changes (widget spacing modifications) instead of continuing documentation work.
Additional Context
This occurred during a Qt desktop application development session where work had been completed and user wanted to document the achievements. The context switch caused confusion and unwanted modifications to working code. Session involved reading documentation files and reviewing completed work, but auto-compaction caused assistant to incorrectly interpret the situation as needing to resume development work.
The bug breaks user workflow when transitioning between development and documentation phases of a project.
I can confirm, the compaction and autocompact is very poor. It does not retain crucial information, and most of the times it loses track of the task and ends up joyfully telling you that "Perfect I did xyz !" when you asked "abc".
Even if you carefully ask Claude Code to read CLAUDE.md file as well as all the documentation files, it will totally forget to do it after compaction, leading to very poor performance in small sized projects.
This is why I asked for a refund several times (I'm not the only one), because in their marketing, they pretend that "we can let Claude Code do its thing and come back later", which is obviously a total fake news. Claude Code can impress beginner programmers, but as soon as you want to do serious work, you have to prompt engineer to the extreme and contain his deliriums to make unwanted large-scale adaptations. Honestly, it's less work to use a conventional LLM, they are not perfect, but they need far less supervision are are much cheaper.
Poor compaction is one of the main reasons why Claude Code doesn't work for real small-sized projects. I've already opened issues for that but they don't react.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.