[BUG] Sporadic context compaction triggers on first message in some sessions (1M Opus 4.6)
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?
Context compaction triggers on the very first user message in some sessions, even with a trivial input
like "hi". This started on 2026-04-01 and was not happening before.
The behavior is inconsistent:
- Some sessions compact immediately on the first message (status bar shows ~8-10% context usage)
- Other sessions with the exact same config work normally through heavy multi-agent investigations
without compacting
Nothing changed in my setup between when it worked and when it started.
What Should Happen?
A 1M context window session should not trigger compaction on the first user message. The full context
window should be available for conversation, with compaction only triggering when actual conversation
content approaches the limit
Error Messages/Logs
No error messages — compaction completes silently. The only indicator is the context percentage
resetting and the "context compressed" notification appearing after the very first message.
Steps to Reproduce
- Open a new Claude Code session (
claudein terminal) - Have ~60 custom skills and MCP servers configured (Playwright, Gmail, Google Calendar, Zapier)
- Type a short message like "hi" or any trivial input
- Observe context compaction triggers immediately
- Close session, open a new one — may or may not reproduce (intermittent, roughly 30-50% of sessions)
- Sessions that don't compact on first message work normally through entire heavy conversations
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2026-03-31
Claude Code Version
2.1.89
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Machine: Apple Silicon Mac (M1 Max)
- Setup: ~60 custom skills loaded via ~/.claude/skills/, MCP servers: Playwright, Gmail, Google
Calendar, Zapier, Chrome MCP Bridge
- The issue appears to be server-side — same machine, same config, same version. Some sessions hit it,
others don't, suggesting different backend nodes may have different behavior.
- Not reproducible on demand — it's probabilistic across new sessions.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗