Skip to content

[BUG] Session context truncated at version boundary after /exit when reopening in 2.1.85 #39856

Closed as not planned

Description

@osipxd

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After ending a session with /exit and reopening Claude Code in 2.1.85, the model's context is truncated at the previous version boundary — it can see messages from the most recent version segment but not from earlier segments. The session JSONL and parentUuid chain are fully intact.

Confirmed with /context: in 2.1.84 the session had 133.9k tokens (67%) of message context. After /exit + reopen in 2.1.85, context dropped to 5.1k tokens (2.5%) — only the 2.1.84 and 2.1.85 messages were visible; all prior history was gone. After downgrading back to 2.1.84, the full context and history became visible again.

The model self-diagnosed: "The previous session's context was not carried over. I only knew what was in the git log shown at conversation start. The autocompact buffer didn't transfer either — this is a fresh session."

What Should Happen?

Reopening a session in 2.1.85 should load the full conversation history from the session JSONL, not just the most recent version segment. The parentUuid chain exists and is intact — it just needs to be traversed fully.

Error Messages/Logs

None - there is simply a lack of context. Diagnosed via /context showing 5.1k tokens vs expected 133.9k tokens.

Steps to Reproduce

  1. Run a long session in version 2.1.81 (or any version before 2.1.84)
  2. End it with /exit
  3. Open Claude Code in the same working directory in 2.1.84 — verify with /context that full history is present
  4. End it with /exit
  5. Update to 2.1.85 and open Claude Code in the same working directory
  6. Run /context — context is now near-empty; ask about prior work — model has no knowledge of it

Reproduced in two separate sessions across two projects. Downgrading to 2.1.84 restores full context.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.84

Claude Code Version

2.1.85

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Kitty

Additional Information

Related prior fixes that did not address this case:

  • 2.1.83: "Fixed SDK session history loss on resume caused by hook progress/attachment messages forking the parentUuid chain" — parentUuid chain verified intact in our sessions.
  • 2.1.83: "Fixed remote sessions forgetting conversation history after a container restart" — applies to remote sessions only.

Activity

  1. github-actions commented on Mar 27, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] 2.1.27 session resume logic is loosing context #22107
    2. Conversation history missing on resume (except last message) #24304
    3. Session resume loads blank — 4.5 MB JSONL file intact, no error, no content #28577

    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

  2. changed the title [-]Session context lost after /exit when reopening in 2.1.85[/-] [+][BUG] Session context truncated at version boundary after /exit when reopening in 2.1.85[/+] on Mar 27, 2026
  3. osipxd commented on Mar 27, 2026

    @osipxd
    Author

    Found 3 possible duplicate issues

    This issue is reproducible on the different version range.

  4. github-actions commented on Apr 27, 2026

    @github-actions

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

  5. github-actions commented on May 8, 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.

  6. locked as resolved and limited conversation to collaborators on May 8, 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 stepsplatform:macosIssue specifically occurs on macOSregressionstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions