[FEATURE] Add claudeCode.autoCompact settings to control context compaction behavior
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:
- Interrupts near-complete work: When a task is 90% done, forced compaction wastes tokens and disrupts flow
- 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:
- Stop current work
- Update task lists with progress
- Update documentation (no new files)
- Generate handoff prompt for next session
- Note MCP servers, staged changes, issues
- 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:
- Stop current work
- Update task lists with progress
- Update documentation (no new files)
- Generate handoff prompt for next session
- Note MCP servers, staged changes, issues
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗