Skip to content

[Bug] Resume flag reverts to pre-compaction state after manual compaction #14462

Closed as not planned

Description

@mrasvialpha

Bug Description
i just compacted, ctrl^C twice then started claude with --resume with latest conversation. it went back to pre compaction state that i had to compact once more.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.0.72
  • Feedback ID:

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/rasvi/.local/share/claude/versions/2.0.72 (expected in multi-process scenarios)\n    at TZR (/$bunfs/root/claude:2428:2165)\n    at yYA (/$bunfs/root/claude:2428:1885)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-18T12:24:18.197Z"},{"error":"Error\n    at nk (/$bunfs/root/claude:59:1144)\n    at <anonymous> (/$bunfs/root/claude:60:10097)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:62:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-18T12:24:18.597Z"},{"error":"Error\n    at nk (/$bunfs/root/claude:59:1144)\n    at <anonymous> (/$bunfs/root/claude:60:10097)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:62:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-18T12:24:18.597Z"},{"error":"RangeError: stdout maxBuffer length exceeded\n    at unknown\n    at onData (node:child_process:153:110)\n    at emit (node:events:95:22)\n    at addChunk (internal:streams/readable:264:47)\n    at readableAddChunkPushByteMode (internal:streams/readable:242:18)\n    at handleNumberResult (internal:streams/native-readable:69:18)\n    at <anonymous> (internal:streams/native-readable:43:68)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-18T12:24:19.379Z"},{"error":"Error\n    at nk (/$bunfs/root/claude:59:1144)\n    at <anonymous> (/$bunfs/root/claude:60:10097)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:62:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-18T12:25:49.200Z"}]

Activity

  1. mintmcqueen commented on Dec 24, 2025

    @mintmcqueen

    Second this. Seems like the same issue as #14820

    Significant impediment to functionality.

  2. github-actions commented on Jan 24, 2026

    @github-actions

    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.

  3. carrotRakko commented on Jan 29, 2026

    @carrotRakko

    I can confirm this bug still exists in v2.1.23 and have done detailed analysis.

    Reproduction Steps (detailed)

    1. Have a conversation with at least one user→assistant exchange
    2. Run /compact (manual compaction)
    3. Wait for compaction to complete (summary displayed, files read)
    4. exit or Ctrl+C
    5. claude --resume <session-id>
    6. Result: Conversation reverts to pre-compaction state

    Observed Behavior at Data Level

    I captured .jsonl transcript snapshots at each step:

    Step Lines Last meaningful entry
    Before /compact 550 assistant response to user
    After /compact 558 compact_boundary + summary + /compact stdout
    After exit 562 /exit command + "Catch you later!"
    After --resume 568 New assistant grafted to PRE-compaction user message

    Key Finding

    When examining the transcript after resume:

    • The new assistant message has parentUuid pointing to the last user message before compaction
    • It completely ignores the compact_boundary, compact summary, and all post-compaction entries
    • The compaction data is still present in the .jsonl file, but the resume logic skips over it

    Hypothesis

    The resume logic appears to search for a "valid" anchor point to continue from. When it can't find one in the post-compaction entries (which are mostly user messages from /compact command output), it falls back to the pre-compaction conversation.

    This is consistent with the original reporter's observation that "i had to compact once more" - the second compaction would produce a new valid anchor point.

    Environment

    • Version: 2.1.23
    • Platform: Anthropic API
    • OS: Ubuntu/Debian Linux (Dev Container)

    ✍️ Author: Claude Code (Dev Container) with @carrotRakko

    Note: This comment was written and submitted by an AI agent (Claude Code), with human review and approval.

  4. JJC1138 commented on Feb 1, 2026

    @JJC1138

    Just to confirm a workaround: If you send a message after compacting and wait for the response before exiting, then the compacted context is correctly saved when you resume.

  5. github-actions commented on Mar 2, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  6. github-actions commented on Mar 10, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  7. locked as resolved and limited conversation to collaborators on Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsmemoryplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions