[FEATURE] Add claudeCode.autoCompact settings to control context compaction behavior

Resolved 💬 3 comments Opened Oct 31, 2025 by mytribe-personal Closed Nov 3, 2025

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

The VSCode extension currently auto-compacts at ~25% remaining context (75% usage), reserving ~20% for the compaction process itself. This creates two issues:

  1. Interrupts near-complete work: When a task is 90% done, forced compaction wastes tokens and disrupts flow
  2. No user control over what gets compacted: The extension decides what context to remove, which may not align with user priorities

Use Case
Current workflow when approaching 25-30% remaining:

  1. Stop current work
  2. Update task lists with progress
  3. Update documentation (no new files)
  4. Generate handoff prompt for next session
  5. Note MCP servers, staged changes, issues
  6. Start fresh session with context

This manual process gives better continuity than auto-compact. A configurable approach would let users trigger this workflow instead of forced compaction.

Benefits
Power users: More control, fewer wasted tokens
Continuity: Better session handoffs with user-defined preparation
Flexibility: Choose between safety (current behavior) and efficiency (manual management)

Environment:
VSCode Extension: v2.0.30
Platform: Windows Desktop

Proposed Solution

Option 1: Disable auto-compact entirely

  • Add setting: claudeCode.autoCompact.enabled (default: true)
  • Let users manage context with /clear and /compact commands manually
  • Power users can optimize for their workflow

Option 2: Make auto-compact configurable

  • Add setting: claudeCode.autoCompact.threshold (default: 25, range: 5-50)
  • Allow triggering at lower thresholds (e.g., 10%) for users willing to risk hitting limits
  • Reduces wasted reserved tokens on near-complete tasks

Option 3: User-defined compaction strategy

  • Allow users to specify what should be prioritized for removal:
  • Oldest messages first
  • Tool outputs over conversation
  • Everything except messages tagged with [keep]
  • Let users define a "pre-compaction checklist" (update todos, save state, etc.)

Suggested labels: enhancement, vscode, context-management, ux

Alternative Solutions

We are going to try instructing Claude in Claude.md to follow our process when it approaches around 30% of context left, however, that means that we won't fully make use of our avaliable context window and will likely be stopping certain pieces of work early as there is basically a block on the last 40k tokens, reserved for autocompaction.

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

Current workflow when approaching 25-30% remaining:

  1. Stop current work
  2. Update task lists with progress
  3. Update documentation (no new files)
  4. Generate handoff prompt for next session
  5. Note MCP servers, staged changes, issues
  6. Start fresh session with context

This manual process gives better continuity than auto-compact. A configurable approach would let users trigger this workflow instead of forced compaction.

Additional Context

Benefits

  • Power users: More control, fewer wasted tokens
  • Continuity: Better session handoffs with user-defined preparation
  • Flexibility: Choose between safety (current behavior) and efficiency (manual management)

Environment:
VSCode Extension: v2.0.30
Platform: Windows Desktop

View original on GitHub ↗

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