context command manages conversation context for AI agents.
Usage
Commands
Examples
Show current context
Add file to context
Clear context
Compact the store
compact cleans per-agent history only. It prints Compaction complete (N agent(s)). and exits 0 when work was done.
Export the store
Empty store
The CLI is explicit about empty-state situations instead of reporting false success:Why is my store empty?
get_global_store() is an in-memory singleton scoped to the current process. The agent runtime does not write to it automatically — it only holds what a caller populated in this process via the context API. A separate CLI process cannot see a store an agent run filled elsewhere; move it across processes with snapshot() / restore(). See Context Management API → Scope.
This CLI
context compact is not the runtime ContextCompactor (the /context compact slash command / ExecutionConfig(context_compaction=True)). The CLI operates on the process-local get_global_store(); the runtime compactor trims a live agent’s chat_history. See Context Compaction.See Also
- Context Management API - Store scope, population, and snapshot/restore
- Fast Context - Fast context retrieval
- Knowledge - Knowledge base management

