Expose autoCompactThreshold in statusLine JSON payload

Resolved 💬 2 comments Opened Apr 10, 2026 by martineserios Closed May 24, 2026

Problem

The statusLine hook receives a JSON payload with used_percentage (the current context usage), but the auto-compact threshold is not exposed. Statusline scripts that want to show "X% until auto-compact" (matching CC's own footer text) must hardcode an assumption about the threshold.

Current payload (relevant fields):

{
  "used_percentage": 42,
  ...
}

What CC's footer shows: 42% context used · 43% until auto-compact (when threshold = 85%)

To reproduce this in a statusline script, authors must hardcode THRESHOLD=85 and compute remaining = threshold - used_percentage. If the user has a custom threshold (or if Anthropic changes the default), the statusline silently shows the wrong number.

Request

Add auto_compact_threshold (or compact_threshold_percentage) to the statusline JSON payload:

{
  "used_percentage": 42,
  "auto_compact_threshold": 85,
  ...
}

Why it matters

  • Statusline scripts can compute the correct "until compact" suffix without assumptions
  • The value is already computed by CC internally (it drives the footer text)
  • Makes the statusline payload self-consistent with the footer display

Related

  • #43981 — configurable compact threshold (if that ships, the threshold becomes user-configurable → even more important to expose it in the payload)
  • #46375 — expose activePermissionMode in statusline payload (same pattern)
  • #28999 — expose usage quota in statusline payload (same pattern)

Workaround

COMPACT_THRESHOLD=${BRANA_AUTOCOMPACT_THRESHOLD:-85}
UNTIL_COMPACT=$(( COMPACT_THRESHOLD - CTX_PCT ))

Works but requires the user to keep the env var in sync with any future threshold config.

View original on GitHub ↗

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