Auto-compact triggers mid-task causing context loss and hallucinations

Resolved 💬 4 comments Opened Nov 4, 2025 by hoiung Closed Nov 7, 2025

Problem

Auto-compact (automatic conversation summarization) triggers in the middle of active tasks, causing severe context loss that leads to:

  1. Hallucinations - Claude loses track of what was actually done vs what needs to be done
  2. Task derailment - Work goes "to la la land" because critical context is lost in the summary
  3. Workflow disruption - Defeats purpose of checkpoint/handover workflows designed to preserve context

Current Behavior

  • Auto-compact triggers automatically based on token limits (no user control)
  • No warning before compaction happens
  • No way to disable or configure when it triggers
  • Summarization loses critical details that break task continuity
  • Not documented in public docs or exposed in settings

Impact

Severe UX problem for complex multi-stage workflows:

User: "Continue from where we left off"
Claude: [Reads auto-generated summary]
Claude: [Proceeds based on incomplete/incorrect context]
User: "Wait, that's wrong - you're hallucinating"

The summary mechanism appears to:

  • Lose track of file modifications
  • Lose intermediate decisions and rationale
  • Lose specific technical details
  • Conflate what was planned vs what was actually implemented

Expected Behavior

Option 1: User control (preferred)

  • Add autoCompact setting to ~/.claude/settings.json:

``json
{
"autoCompact": {
"enabled": false,
"threshold": 150000 // token count
}
}
``

Option 2: Better summarization

  • Preserve critical state information
  • Include file modification history
  • Maintain task progress tracking
  • Keep technical implementation details

Option 3: User prompting

  • Warn before auto-compact triggers
  • Ask user if they want to compact now or start new session
  • Give option to save checkpoint first

Workarounds

Users currently must:

  1. Use /rewind to go back before compaction (loses all subsequent work)
  2. Start fresh chat with manual context (time-consuming, error-prone)
  3. Build elaborate checkpoint/handover workflows (shouldn't be necessary)

Environment

  • Claude Code CLI
  • Multi-hour development sessions with complex state
  • Project with mandatory 5-stage development workflow
  • Multiple repositories with cross-references

Feature Request

Please either:

  1. Add settings to disable auto-compact
  2. Add settings to configure compaction threshold
  3. Improve summarization to preserve critical context
  4. Add user prompting before auto-compact triggers

The current behavior breaks complex development workflows where context preservation is critical.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗