[FEATURE] Auto-compact currently triggers mid-execution of CLI commands, causing unnecessary token re-reads and increased costs.

Resolved 💬 4 comments Opened Oct 20, 2025 by BeepsDotNet Closed Jan 11, 2026

Preflight Checklist

  • [x] 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

---
Title: Auto-compact should wait for command completion to optimize token usage

Description:

Issue

Auto-compact currently triggers mid-execution of CLI commands, causing unnecessary token
re-reads and increased costs.

Current Behavior

  1. User runs a CLI command
  2. Conversation is read (tokens used)
  3. Command begins executing
  4. Auto-compact triggers during execution
  5. Next response re-reads conversation (tokens used again)

Expected Behavior

Auto-compact should wait until the current command completes before triggering, since:

  • Context is already loaded for the executing command
  • Compacting mid-execution adds overhead
  • Waiting until completion would be more token-efficient

Impact

  • Unnecessary token usage (double conversation reads)
  • Increased API costs
  • Reduced performance during long-running commands

Proposed Solution

Defer auto-compact triggers until after the current command/tool execution completes.

Environment

  • Platform: Windows (MSYS_NT-10.0-26100)
  • Claude Code version: [latest]

---

Proposed Solution

Expected Behavior

Auto-compact should wait until the current command completes before triggering, since:

Context is already loaded for the executing command
Compacting mid-execution adds overhead
Waiting until completion would be more token-efficient

Alternative Solutions

_No response_

Priority

Low - Nice to have

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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