[FEATURE] Allow selective removal of tool results from context window
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
When working on large codebases, file reads (Read tool, PDF reads, long grep outputs) embed full file contents into the context and quickly
consume the context window — even on 1M token models. The content is only needed at the moment of the edit, not for the rest of the session.
Feature request: Add the ability to selectively remove specific tool result messages from the context window, similar to how some chat
interfaces allow deleting individual messages.
Proposed Solution
Options that would work:
- A /drop-reads command that removes all Read/tool result content but keeps the conversation messages
- A way to mark a tool result as "ephemeral" so it's not included in subsequent context
- Click-to-remove on individual tool results in the UI
Why it matters:
- A single PDF or large Java file read can cost 5,000–20,000 tokens
- These inflate the context permanently even though the content is no longer needed
- On a 1M context model, file reads alone can consume 60–70% of the window in a long session
- /compact summarizes everything indiscriminately — there's no surgical option
This would allow much longer productive sessions without hitting context limits.
Alternative Solutions
_No response_
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗