Feature Request: Configurable auto-compact threshold

Open 💬 3 comments Opened Jun 24, 2026 by watermann420

Preflight Checklist

  • [ ] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Feature Request: Configurable Auto-Compact Threshold

Problem Statement

Claude Code's automatic context compression only triggers when approaching the hard context limit
(~80-90% usage). This creates several issues:

  1. Performance degradation - Large contexts slow down response times significantly before

compression kicks in

  1. No proactive management - Users cannot prevent context bloat, only react to it
  2. Token waste - Running near-full context consumes more tokens than necessary
  3. Autonomous workflows suffer - Long-running tasks (training, monitoring) accumulate context

without user intervention, eventually hitting the wall

  1. Manual burden - Users must watch context usage and manually run /compact

Proposed Solution

Add a configurable autoCompactThreshold setting:

{
"autoCompactThreshold": 20
}

Behavior:

  • When context usage exceeds threshold, automatically run /compact
  • Show brief notification: "Auto-compacted at 20% usage"
  • Default: disabled (current behavior preserved)
  • Range: 10-90%

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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