[FEATURE] Context configuration
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
I want to be able to customize the guidance and model used for compaction operations (and would prefer the option to do them myself programmatically via plugin) as they are not necessary with my tooling, hooks do not have the desired impact, and I am getting tired of manually compacting.
Proposed Solution
-
onRequestCompactionhook/plugin integration where I can choose to cancel/prevent compaction and stop generation, override the model/provider and/or guidance statement used during compaction, or return the result of a custom compaction solution. -
compaction.model,compaction.guidance,compaction.targetLength,compaction.maxLength,compaction.truncationMethod(or equivalent) options to allow me to delegate the compaction to a specific model with custom instructions and requirements, a chosen heuristic for fallback.
Alternative Solutions
Manual compaction guidance, slow compaction, wasted context space.
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
Example scenario:
- I am working with tooling that knows which files I changed and can produce heuristics to very quickly and easily provide higher quality context in a fraction of the time
- Automatic compaction occurs
- My plugin intercepts, provides the heuristic solution
- Context smol, Claude happy
- AGI achieved internally
Additional Context
<3
This would continue to build on the work done in https://github.com/anthropics/claude-code/issues/5643 and would allow users and the community to iterate on solutions to address the similar but less specific proposals from https://github.com/anthropics/claude-code/issues/8656 etc...
This is similar to my request #14585
This is similar to my request #14585
Similar in that it would enable it, yes (the feature you described is among what I have built for which I need this, ironically).
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This is a feature request and is still relevant.