[Feature] expose autoCompactWindow / 'until auto-compact' percentage to statusLine stdin

Resolved 💬 2 comments Opened May 25, 2026 by jasonm4130 Closed Jun 26, 2026

Summary

statusLine command hooks receive context_window.used_percentage, but that's calculated against the model's full window (e.g. 1 000 000 tokens for extended-context Sonnet) — not against the user's effective autoCompactWindow setting. This makes it impossible for statusLine plugins to display the same "X% until auto-compact" value Claude Code's own UI shows.

Repro

  1. Set "autoCompactWindow": 400000 in ~/.claude/settings.json (or use the default — same shape).
  2. Use any documented statusLine example that reads .context_window.used_percentage.
  3. Run a session until CC's own UI shows e.g. "4% until auto-compact" (i.e., 96% of your effective window).
  4. The plugin renders ~35% because used_percentage = current_tokens / 1_000_000.

CC's own UI clearly computes the auto-compact percentage internally; statusLine plugins have no access to it.

Requested change

Expose one of these in the statusLine stdin payload:

{
  "context_window": {
    "context_window_size": 1000000,
    "effective_context_window_size": 400000,
    "used_percentage": 35,
    "until_auto_compact_percentage": 4
  }
}

Either effective_context_window_size (so plugins can compute the ratio) or until_auto_compact_percentage (so plugins can display it directly) would close the gap. Both would be ideal.

Why this matters

The user-facing autoCompactWindow setting is the only honest signal of how much context the session will tolerate before auto-compaction reshapes it. Every statusLine plugin in the ecosystem that draws a context bar is currently misreporting against the wrong denominator for users who've narrowed their effective window — which is precisely the population that cares most about the bar.

Workaround

Plugins can require users to also set an env var (e.g. HANDOFF_EFFECTIVE_MAX_TOKENS=400000) duplicating the autoCompactWindow value, then compute against current_usage.total_input_tokens / max. This works but duplicates configuration the harness already has.

Context

Surfaced while building a context-fill-triggered handoff plugin: https://github.com/jasonm4130/claude-skills/tree/main/plugins/handoff

View original on GitHub ↗

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