[BUG] Session unexpectedly initialized without user action, causing conversation history loss
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?
During an active session on Claude Code on the web (cloud environment), the system automatically displayed a message "セッションを初期化しました" (Session has been initialized) without any user action. This caused complete loss of conversation history, and Claude lost all context from earlier in the same session.
Timeline:
- User was working on a task (repository separation work)
- Session appeared to freeze/stop responding
- User typed "続けて。" (Continue) to resume
- System displayed "セッションを初期化しました" in the chat
- Claude had no memory of what happened earlier in the session
- Conversation history started from the middle, missing all initial messages
User actions before the issue:
- No
/clearor/resetcommands were executed - No UI buttons were clicked
- Simply tried to continue the conversation
Session context:
- Session duration: Several months (used intermittently, not continuously)
- Today's active session before issue: 1-2 hours
- Platform: Claude Code on the web (cloud environment)
What Should Happen?
According to the documentation:
"The system will automatically compress prior messages in your conversation as it approaches context limits."
Expected behavior:
- Session should compress (summarize) old messages when approaching limits
- Conversation history should be preserved
- Context should remain intact
- User should not lose conversation history without explicit action
Actual behavior:
- System displayed "初期化" (initialized), not "再開" (resumed)
- History was completely lost, not compressed
- No warning or user confirmation before initialization
The message said "初期化" (initialized), not "再開" (resumed):
- "再開" (resumed) = normal when restarting paused session (history preserved)
- "初期化" (initialized) = abnormal (history cleared)
Error Messages/Logs
No error messages. The system displayed:
セッションを初期化しました
(Session has been initialized)
This appeared in the chat as a system message, similar to "セッションを再開しました" (Session resumed) messages.
Steps to Reproduce
Hard to reproduce intentionally, but conditions were:
- Use Claude Code on the web (cloud environment)
- Create a session and use it intermittently over several months
- Let the session accumulate substantial conversation history
- Continue working in the session (today's active session: 1-2 hours)
- Session may hit some internal limit (memory, context, time, etc.)
- Try to continue the conversation → session gets initialized instead of compressed
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Latest version as of 2026-06-20 (Claude Code on the web)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Non-interactive/CI environment
Additional Information
Important context:
- Long-running session: Several months old, used intermittently (not continuously active)
- No user action triggered this: User did not execute any clear/reset command
- Loss of trust: Users rely on conversation history preservation. Unexpected loss is a critical issue.
- Japanese UI message: "セッションを初期化しました" suggests this may be locale-specific behavior
Impact:
- Critical: Breaks user workflow mid-session without warning
- Requires manual recovery (copy-pasting history to restore context)
- Significant time waste and confusion
- Damages trust in the system's reliability
Suggested investigation:
- Check session management for long-running sessions (multi-month usage)
- Check what triggers "初期化" (initialize) vs "再開" (resume) messages
- Verify context compression is working correctly in cloud environments
- Check if there's an undocumented limit for intermittent/long-running sessions
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗