Feature: Configurable auto-compact threshold + proactive idle-time compaction

Status Closed — duplicate
Maintainer reply None cached
Activity 1 comment · opened Jul 16, 2026 · closed Aug 20, 2026

Problem

Auto-compact currently triggers when a new message is submitted and context is critically low (~2%). This means:

  1. The user pays the compaction delay on their next real question — not on a throwaway prompt or during idle time.
  2. There's no way to set a higher threshold (e.g., 10%) so compaction happens earlier and less disruptively.
  3. During idle sessions (user is away, screen locked), context just sits at 2% with no action taken.

Desired Behavior

1. Configurable threshold in .claude.json

{
  "autoCompactThreshold": 0.10
}

When context remaining drops below this fraction (default: current behavior, ~0.02), trigger auto-compact on the next idle moment rather than waiting for the user to submit a message.

2. Proactive idle-time compaction

If context is below threshold AND no prompt has been received for N seconds (suggested default: 30s), compact automatically without requiring user input. The user returns to a fresh context window instead of paying the delay on their first real question.

Workaround today

/compact (manual) — works, but requires the user to notice the status bar percentage and act before asking their next question.

Why this matters

In long autonomous sessions (running agents, background tasks, extended analysis), context fills up while the user is away. The current model penalizes the user's first productive message back with compaction latency. Proactive compaction during idle time eliminates this entirely.

Suggested config shape

{
  "autoCompactThreshold": 0.10,    // fraction, 0.0–1.0; default = current behavior
  "autoCompactIdleSeconds": 30     // seconds idle before proactive compact fires
}

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗