[BUG] Compacted context isn't saved if I exit immediately after compacting

Resolved 💬 2 comments Opened Jan 31, 2026 by JJC1138 Closed Feb 1, 2026

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?

I compacted a full context, then exited Claude Code, then resumed the session, and the context was full again as if it hadn't been compacted.

What Should Happen?

The compacted context should be saved even if Claude Code is exited immediately afterwards.

Error Messages/Logs

Steps to Reproduce

  1. Resume a session with a significant amount of the context window used.
  2. Run /compact and wait for that to complete normally.
  3. Exit Claude Code (I use Ctrl-D x 2 in case that's important).
  4. Resume session with claude --resume.
  5. Run /context and see that the context is still as full as it was before the compaction.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.29 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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