[FEATURE] Expose /clear and /compact as callable tool actions
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
/clear and /compact are handled by the CLI's UI layer and cannot be triggered by MCP tools, hooks, or the agent itself. This means users must manually type slash commands to manage their conversation — the agent has no way to act on natural language requests like "please compact your conversation" or "clear the history." This creates a gap between the UI layer and the agent layer, limiting the ability to build conversation management workflows through MCP servers or automation.
Proposed Solution
Expose clear and compact as agent-layer primitives that can be invoked via tool calls. This would allow:
- MCP tools to trigger conversation management actions - The agent to respond to natural language requests to compact or clear
- Optional parameters (e.g., compact focus instructions) to be passed programmatically
By Having that you can infinitely long sessions running without having to use a files and other clunky approaches. The agent can in a sense "forget" things in a controlled manner which is greatly powerful for research and long running tasks in general.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
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 ↗