[FEATURE] Compact before starting a new plan step instead of in the middle of code changes

Resolved 💬 4 comments Opened Dec 25, 2025 by TimeHunter81 Closed Dec 29, 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

Compaction happening during code changes bear lower-quality code being written, compared to when we compact once a step has been completed before starting a new one.

Proposed Solution

In VS Code extension, it tends to trigger compaction around 80%, so starting at 65%, it should look into triggering compaction if there are still planned steps to complete.

Two ways this could be done:

  • Inject context window percentage into system reminders for model-aware compaction. And then it's a claude.md guidance each user would add.
  • Native option, handled by Claude without system reminders. Downside of this is that you guys at Anthropic tend to prioritize CLI over VS Code extension for new feature delivery, and I use VS Code extension...

Alternative Solutions

I wish I could have done this with hooks, but hooks are not supported yet by the VSCode extension (tracked under https://github.com/anthropics/claude-code/issues/8985).

Side note that the feature category drop-down for a new feature request in the repo only has "CLI commands and flags", and nothing about the VSCode extension.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Provided as part of the proposed solution.

Additional Context

_No response_

View original on GitHub ↗

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