Summary
/compact is currently a user-only slash command. The agent itself should be able to invoke compaction when it detects it's running short on context or when a long task naturally hits a phase boundary.
Use cases
- Multi-phase workflows (e.g. plan → implement → review pipelines) where the agent knows when a phase is complete and the prior context can be safely summarized.
- Long-running autonomous sessions where the user isn't present to trigger
/compact manually.
- Skill / plugin authors who want to script a compaction step at a known-safe boundary.
Proposal
Expose /compact as a callable tool (e.g. compact_context) so the agent can invoke it programmatically, with the same effect as the user typing the slash command. Permission-gate it the same way other state-changing tools are gated.
Out of scope
Auto-compaction policy (when to fire, what to summarize) is separate; this issue is only about exposing the existing capability to the agent.
Summary
/compactis currently a user-only slash command. The agent itself should be able to invoke compaction when it detects it's running short on context or when a long task naturally hits a phase boundary.Use cases
/compactmanually.Proposal
Expose
/compactas a callable tool (e.g.compact_context) so the agent can invoke it programmatically, with the same effect as the user typing the slash command. Permission-gate it the same way other state-changing tools are gated.Out of scope
Auto-compaction policy (when to fire, what to summarize) is separate; this issue is only about exposing the existing capability to the agent.