claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Instant auto-compaction not instant - compaction takes same time as before v2.0.64

Open amihos opened this issue 2 weeks ago • 5 comments

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?

Version 2.0.64 changelog states "Made auto-compacting instant", but the compaction step/process still takes the same amount of time as before. Currently on v2.0.65 and the issue persists.

When auto-compaction triggers (or when using /compact manually), the process duration is identical to pre-2.0.64 versions - there's no observable improvement in how quickly compaction completes. The feature advertised as "instant" has no noticeable performance difference.

What Should Happen?

Per the v2.0.64 changelog: "Made auto-compacting instant"

The compaction process should complete significantly faster (ideally instantly or near-instantly) compared to previous versions where it would take noticeable time to process and summarize the conversation context.

Error Messages/Logs

No error messages - the feature just doesn't behave as advertised.
  Compaction completes successfully but takes the same duration as pre-2.0.64 versions.

Steps to Reproduce

  1. Use Claude Code v2.0.64 or later (tested on v2.0.65)
  2. Start a conversation and accumulate context until it reaches ~80% or triggers auto-compaction warning
  3. Either wait for auto-compaction to trigger OR run /compact manually
  4. Observe that the compaction process takes the same amount of time as it did in previous versions
  5. Expected: "Instant" compaction as per changelog
  6. Actual: Same duration as before the "instant" feature was introduced

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.65 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • The v2.0.64 changelog explicitly states "Made auto-compacting instant" as a feature
  • Issue persists in v2.0.65, suggesting the "instant" optimization is either not active or has a bug

amihos avatar Dec 11 '25 09:12 amihos

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9577
  2. https://github.com/anthropics/claude-code/issues/5879
  3. https://github.com/anthropics/claude-code/issues/10881

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 11 '25 09:12 github-actions[bot]

The reported issue is different and new.

amihos avatar Dec 11 '25 10:12 amihos

This is an issue I'm also having. Thought it would /compact instant, but it takes the same ammount of time as before (i'm on 2.0.67). Do we need to configure something?

Also, this is NOT a duplicate. It's a new feature and it's not working at the moment.

Found 3 possible duplicate issues:

  1. [Bug] Performance Degradation: Conversation Compaction Extremely Slow #9577
  2. Performance Degradation: Excessive History Compaction Blocking Code Generation #5879
  3. [BUG] Claude Code consistently degrades in performance over long sessions #10881

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

mihailmariusiondev avatar Dec 12 '25 11:12 mihailmariusiondev

According to the instant compaction feature (v2.0.64+), the following should be happening but is not occurring on my machine:

  1. Session memory file not being created/updated: - Expected: A session memory file should be stored in ~/.claude/ that contains a continuously updated summary - Actual: No such summary file is being generated or updated in my .claude folder
  2. Background summarization not running: - Expected: Every message sent/received should trigger an automatic background update to the session memory - Actual: No background summarization appears to be happening between messages
  3. Session memory contents missing: - Expected: The session memory should contain:
    • Session title
    • Current status (discussion points, completed items, open questions)
    • Learnings and key results
    • Auto-updated work log - Actual: These files/data structures are not present in my .claude directory
  4. Compaction behavior: - Expected: Manual /compact should instantly load the pre-written summary from session memory - Actual: Compaction still takes time as if generating a fresh summary

Environment:

  • Claude Code version: 2.0.67
  • OS: Windows

amihos avatar Dec 12 '25 15:12 amihos

macOS user confirming this issue with additional diagnostic findings.

Environment:

  • Claude Code v2.0.68
  • macOS (Darwin 25.0.0)
  • Issue persists after closing all windows and fresh restart in clean terminal

Key Finding - Session Memory File Location:

The instant compact feature writes incremental summaries to: ~/.claude/projects/[project-path]/[session-id]/session-memory/summary.md

Evidence of intermittent functionality:

I have working examples from when the feature was active (Dec 11-12). These files contain detailed session summaries with sections like: Session Title, Current State, Task Specification, Files and Functions, Errors & Corrections, Learnings, Key Results, Worklog.

The problem:

Out of 900+ sessions in one project folder, only 1 has a session-memory subfolder. New sessions do not create this folder - the background summarization process isn't activating.

Suspected cause:

I had multiple terminal windows running Claude Code simultaneously. Some terminals may have been running older versions while others had auto-updated. This version mismatch between concurrent sessions may have corrupted state or caused the feature to stop activating entirely.

What I've tried:

  • Closed all Claude Code sessions
  • Started fresh in clean terminal
  • Cleared ~/.claude/statsig/ cache
  • Verified no PreCompact hooks interfering
  • Manually created the session-memory folder - nothing gets written to it

Additional observation:

Auto-update from v2.0.67 to v2.0.68 occurred during troubleshooting. The feature was last working on v2.0.65 or earlier.

Expected behavior: Each session should create a session-memory/summary.md file that gets updated incrementally, making /compact instant by using pre-built summaries.

Actual behavior: No session-memory folder is created. Even when manually created, nothing is written to it. /compact falls back to slow full-conversation summarization (5+ minutes). The background process is completely dead.

s3-oz avatar Dec 13 '25 00:12 s3-oz

we rolled back instant auto compact. We will share our coms for when it is rolled back

ltawfik avatar Dec 13 '25 02:12 ltawfik

FYI — this is behind a feature flag. If you have the Node version installed you can re-enable it, or even better you could partially reproduce the behavior by spinning up a background subagent triggered by a regular hook. If you already have a summary.md available, you can pass it into Claude to generate/update the instructions the agent uses to maintain that file. At that point your “instant compact” basically becomes: run /clear, then /continue-sess, where continue-sess is a custom slash command that just loads the previously saved session-memory file and resumes from it. Obviously this wouldn't work for you auto-compacters out there, unless you had the main Claude agent spin up a headless version of CC and do all its work through there instead of itself, directly, but that's another subject entirely. The point is, if you want something, the harness as it is, is almost certainly powerful enough to do the same thing in a different way.

transcendr avatar Dec 13 '25 17:12 transcendr