[BUG] Context limit reached · /compact or /clear — forced at ~85% with autoCompact: false (Opus 4.6, v2.1.39)

Resolved 💬 3 comments Opened Feb 11, 2026 by manny-dev-neurofieldz Closed Mar 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and found related reports (#19018, #18264, #23751)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

With autoCompact: false, Claude Code forces a hard stop with the message "Context limit reached · /compact or /clear to continue" at approximately 170k/200k tokens (~85% usage). The agent cannot continue working — it's a blocking wall, not a warning.

This happens repeatedly across sessions. The /context command shows ~30-35% free space remaining when the block triggers.

What Should Happen?

With autoCompact: false, the user should retain control over when compaction occurs. The system should either:

  1. Allow work to continue with a non-blocking warning
  2. Or at minimum, give the user several turns of warning before a hard block, so they can perform orderly session closeout

Impact

This is particularly damaging for long-running agentic workflows. The hard block prevents the agent from completing in-progress work or writing any state preservation artifacts before context is lost, forcing manual transcript recovery from JSONL files.

Error Messages/Logs

Context limit reached · /compact or /clear to continue

Steps to Reproduce

  1. Set autoCompact: false in settings
  2. Use Opus 4.6 with 200k context window
  3. Work through a session until ~170k tokens used (~85%)
  4. Session halts with "Context limit reached · /compact or /clear to continue"

Claude Model

Opus 4.6 (claude-opus-4-6)

Is this a regression?

Yes — same behavior reported in #19018 since v2.1.7+

Last Working Version

Unknown (inherited from #19018 which reports v2.1.6 as last working)

Claude Code Version

2.1.39

Platform

Claude Max

Operating System

macOS (Darwin 24.5.0)

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issues tracking the same underlying bug:

  • #19018 — Same exact symptom, Opus, macOS, autoCompact off (v2.1.12, Jan 2026)
  • #18264 — autoCompact: false ignored, triggers at ~78% (Linux)
  • #23751 — Compaction fails at 48% (Opus 4.6 specific)
  • #24079 — Auto-compact triggers with 51k tokens free
  • #24458 — Context limit reached at 27% usage (regression in 2.1.33)

This bug has persisted from v2.1.7 through v2.1.39 (5+ weeks). The autoCompact: false setting is effectively broken for Opus users.

View original on GitHub ↗

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