/compact command fails with 'Conversation too long' error at 82% token capacity

Resolved 💬 9 comments Opened Oct 11, 2025 by halso Closed Jan 11, 2026

Bug Report

Description: The /compact command fails with an error message suggesting the conversation is too long, even when there is still 18.5% free space remaining.

Steps to Reproduce:

  1. Have a conversation that reaches approximately 163k/200k tokens (82% capacity)
  2. Run /compact command
  3. Observe error: "Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again."

Current Context:

  • Total tokens: 163k/200k (82%)
  • Free space: 37k (18.5%)
  • Autocompact buffer: 45k tokens (22.5%)

Expected Behavior:
The /compact command should successfully compress the conversation history when there is free space available.

Actual Behavior:
Command fails with error suggesting to go back in conversation history, even though there is 18.5% free space.

Impact:
Cannot continue long coding sessions without restarting conversation, losing context and progress.

Environment:

  • Claude Code CLI
  • Model: claude-sonnet-4-5-20250929

View original on GitHub ↗

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