[FEATURE] /compact options
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 am aware we can use subagents for some of the issues, but agents are not always called unless we specifically call them, or sometimes they are called even though we don't necessarily name them... that's fine.
The feature request is about /compact or it could be a new command.
If we are not using agents, essentially, /compact grabs the whole context and summarizes it, and this is normally fine for a lot of cases, but because we are talking about code, sometimes it's important to keep certain things and delete some large context messages, selectively.
Proposed Solution
For example, lets say we are refactoring a web app.
We may be doing the changes, then require a test with playwright, puppeteer, or whatever.
Browsing the HTML page normally takes a lot of context, hence this is better done by an agent, but sometimes you want to see exactly what is happening.
If you open a few HTML pages, context fills up very quickly, so despite the logic we are working on being small, context is now filled with a test HTML, which we could summarize or delete from context.
I would like for /compact to open another window, and have the option to do a normal /compact by default, or to delete or summarize certain messages, such as those tests. This would allow for context to be freed while keeping the logic as it was.
This could be done manually:
a) where user specifies specific messages to delete from context, or
b) AI could consider the full context, and recommend the ones no longer needed, or by token size as percentage of the context, or
c) AI could analyze the context and suggest deleting context based on the current feature being worked on, for example, we are working on 3 different tasks, we could as well delete the previous 2, keeping only information related to the last task being caried out, or related to the todo list, when available. This could be something like /reorganize or /focus or similar.
The idea here, would be not to summarize the whole context, but make it focused on the task at hand and remove temporary content like tests that are no longer needed in context, or large messages that take a lot of tokens, or unrelated tasks messages from previous tasks.
Essentially, a refocusing mode, instead of a generic mode.
Manual control over what goes out of the context would be fine, but automatically done would also be interesting.
Also, I would like to see the amount of tokens in context, like 120000/200000 (50%) or similar, so we can see the impact of certain messages in context, and potentially mark them for deletion soon, or immediatly after testing.
For example: Test page X with playwright and summarize any issues on console.log.
We no longer need the actual result from playwright in context, only the console content, or a summary, so deleting this would keep the context focused and clean, and improve the overall quality.
Alternative Solutions
Perhaps each message could have a sequential ID, and we could instead of compact, use something like /clear 5,6,9,11 to delete the messages from context, or something like /ignore maybe.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗