[BUG] Current task context lost after automatic compact

Resolved 💬 2 comments Opened Apr 25, 2025 by dopper Closed Jun 10, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.80
  • Operating System: macOs
  • Terminal: iTerm2

Bug Description

Often Claude Code will get lost and go off on tangents when interrupted with an automatic /compact. An example is reviewing a task plan for completeness and interrupted with /compact. Once this is over it will start trying to implement changes in code unrelated to the session, sometimes related to recent git transactions. One consideration to address this is a form of breadcrumbs so it does not completely lose track of what it was doing. This could be done in a project level hidden file, or similar to prevent this behavior.

Steps to Reproduce

  1. Long big task, interrupted with auto compact
  2. Sometimes it will go off track and start unrelated tasks, hard to force this to happen but it happens often.

Expected Behavior

Claude Code should recall where it left off prior to interrupted compact and pick back up with some context.

Actual Behavior

Will start unrelated unpredictable tasks.

Additional Context

Sometimes auto compact does not work, you have to force /compact, and other times only a /clear will work. Probably unrelated but also happens often.

View original on GitHub ↗

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