Last assistant message lost when terminal closed abruptly and session resumed
Resolved 💬 2 comments Opened Jan 30, 2026 by prattfamilychannel-ai Closed Feb 28, 2026
Environment
- Claude Code v2.1.23
- Windows 10/11
- Opus 4.5
Description
When closing the terminal window directly (clicking X) instead of graceful exit, then resuming the session with claude --resume or claude -c, the last assistant message is missing from the conversation history.
Steps to Reproduce
- Have an active Claude Code session with multiple messages
- Close the CMD/terminal window directly (X button)
- Resume the session with
claude --resumeorclaude -c
Expected Behavior
Full conversation history including last assistant message should be displayed.
Actual Behavior
Last assistant message is missing/truncated. Only user messages remain visible.
Additional Context
- Stop hooks were running when terminal closed (one had "bash not recognized" error on Windows)
- Large session transcripts (16MB+) may be more affected
- Issue occurred across multiple sessions
- The missing message was fully rendered on screen before terminal was closed
- Reproduced consistently across different sessions
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗