Selective conversation history pruning to reduce token usage
Problem
Every prompt sent to the API includes the full conversation history. For long sessions, this means re-transmitting turns that are no longer relevant — dead-end debugging, exploratory file reads, superseded approaches — costing tokens and degrading signal-to-noise ratio.
The current options are:
/clear— wipes everything, losing all useful context/compact— lossy summarization with limited user control over what's kept- Auto-compaction — happens automatically but the user has no say in what's preserved or discarded
None of these let the user surgically remove specific turns while keeping the rest intact.
Proposal
Allow users to selectively exclude individual turns or ranges of turns from the context sent to the API. Excluded turns could remain visible in the UI (greyed out) but would not be included in the next request payload.
Possible UX approaches
- Turn-level deletion — keyboard shortcut to toggle individual turns as excluded/included
- Range selection — e.g.
/prune 5-23to exclude a range of turns - Semantic pruning — e.g.
/prune "the database migration tangent"using the LLM to identify and exclude matching turns
These aren't mutually exclusive — (1) alone would cover the core use case.
Why this matters
- Token savings — long sessions accumulate substantial irrelevant context. Users know which parts are still load-bearing better than automatic compaction does.
- Response quality — less noise in the context means better signal for the model. Stale debugging output or abandoned approaches can actively mislead.
- User control — sits between the extremes of "keep everything" and "clear everything," giving power users fine-grained control without changing the default experience.
Alternatives considered
/compactwith a focus prompt partially addresses this but produces a lossy summary rather than preserving exact turns the user wants to keep- More aggressive auto-compaction could help but removes user agency over what's important
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗