[FEATURE] Don't waste tokens on commands that don't require agent
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
Simply calling /context will waste 8 tokens, and then the output from the command about 1k tokens.
There is no reason why calling this static command which does not require Claude should have to go through the language model to return what is a simple computation using the tokenizer. There is also no reason that afterwards the output from that command should be included in context given it uses about 0.5% of the entire context (again, for something that the model does not even need to be seeing).
<img width="821" height="1165" alt="Image" src="https://github.com/user-attachments/assets/1be6ad43-1033-40c8-ae0f-c3880ff446f5" />
Proposed Solution
There are a number of commands that do not need to go through the language model. It is trivial to identify if one of these has been typed. If it has, it should be triggered directly. This will solve the first problem of these commands being added to context (not huge since they are just a few tokens) and also latency (should be instant and work locally).
However more to the main point, I sincerely doubt that anybody wants the output of /context or similar commands like /config or /status to end up in the chat history. It is difficult to conceive of a reason why the model should need to see this information. However these commands could be given a flag or their output's inclusion in context could be an optional setting, if we are really that worried about it.
Alternative Solutions
Right now the only real workaround is to rewind the conversation after each time you run a command like /context, or to simply accept degraded performance.
Priority
Medium - Would be very helpful
Feature Category
API and model interactions
Use Case Example
This is pretty important if you follow the principle of frequent intentional compaction or other similar context engineering practices where the primary goal is curating the context the agent sees in order to maximize performance.
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗