Feature: Auto-compact without confirmation when context reaches threshold (e.g. 90%)

Resolved 💬 1 comment Opened Jun 3, 2026 by hufs-taehyun Closed Jul 7, 2026

Feature Request

Current Behavior

When autoCompactEnabled: true is set in settings.json, Claude Code shows a notification at ~90% context usage, but still requires manual user confirmation (clicking a button or typing /compact) to actually perform the compaction.

Desired Behavior

Add an option to perform compaction automatically and silently when context reaches a configurable threshold, with no user interaction required.

For example, a new setting like:

{
  "autoCompactEnabled": true,
  "autoCompactThreshold": 0.9,
  "autoCompactConfirm": false
}

With autoCompactConfirm: false, compaction should trigger automatically at the specified threshold without requiring any manual confirmation.

Use Case

During long coding sessions, users are repeatedly interrupted by the 90% notification and must manually confirm compaction each time. This breaks flow, especially when working on multi-step tasks with many tool calls. Fully automatic compaction would allow uninterrupted work.

Alternatives Considered

  • Claude Code Notification hooks — hooks can run shell commands on notifications, but cannot invoke /compact since it is a Claude Code slash command, not a shell command.
  • AutoHotKey (Windows) / AppleScript (macOS) — brittle and platform-specific workarounds.

Additional Context

The autoCompactEnabled setting already exists, suggesting the infrastructure is in place. This request is simply to extend it with a confirm: false mode that skips the confirmation step.

View original on GitHub ↗

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