Auto-compact warning is nearly invisible — needs color/styling customization

Resolved 💬 3 comments Opened Feb 23, 2026 by mydandyandy Closed Feb 27, 2026

Problem

The "Context left until auto-compact: XX%" warning message is displayed in such a dim, low-contrast style that it's effectively invisible — especially when running multiple terminal windows simultaneously. Auto-compaction is one of the most impactful events in a Claude Code session (potential context loss, background task disconnection, workflow disruption), yet its warning is the quietest element on screen.

Current Behavior

  • The warning appears in dim/muted text somewhere in the terminal
  • No color customization, no bold, no ANSI styling options
  • Users must actively hunt for it across multiple terminal windows
  • By the time you notice it, auto-compact may have already fired

Requested Behavior

At minimum, one or more of:

  1. Make the warning visually prominent by default — red, bold, or high-contrast text as context usage increases (similar to how battery warnings escalate on mobile devices)
  2. Allow settings.json customization of the warning's appearance — ANSI color codes, bold, threshold for when styling changes
  3. Expose a hook or notification type (e.g., context_warning) that fires at configurable thresholds, so users can trigger custom alerts (sound, toast notification, custom status line update, etc.)
  4. Allow threshold configurationCLAUDE_AUTOCOMPACT_PCT_OVERRIDE exists but isn't documented well. A proper settings.json field like autoCompactWarningThreshold would be cleaner.

Why This Matters

Power users who:

  • Run multiple Claude Code sessions simultaneously
  • Use custom status lines and hooks for workflow automation
  • Rely on pre-compaction summaries to preserve context
  • Have background tasks (file watchers, etc.) that disconnect on compaction

...need adequate warning to prepare. The current implementation treats auto-compaction as a minor footnote when it's actually a major session event.

Context

  • Multiple related issues exist (#11819, #14160, #12297, #12995) requesting compaction threshold customization — all closed as not planned
  • The PreCompact hook helps but only fires AFTER the decision to compact, not as an early warning
  • Custom status lines (via settings.json statusLine) can show context %, but they're a workaround for what should be a first-class feature
  • This is arguably an accessibility concern — dim text on terminal backgrounds is hard to read for many users

Environment

  • Windows 11, multiple terminal windows
  • Claude Code with custom statusLine, hooks, and background watchers
  • Heavy daily usage with frequent compaction cycles

---
Session: Tank (0894)

View original on GitHub ↗

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