Expand description
Shared tool lifecycle โ ensures CLI and MCP paths have identical side effects.
The MCP server dispatcher handles session, ledger, heatmap, intent detection, and knowledge consolidation inline (via in-memory state). When the daemon is unavailable, CLI commands call functions here to achieve the same coverage by loading/saving state from disk.
NOTE: When the daemon IS running, CLI routes through daemon_client which
calls the MCP server โ these functions are NOT called in that path.
Functionsยง
- record_
file_ read - Record a file-read operation with full Context OS side effects.
- record_
search - Record a search/grep operation with full Context OS side effects.
- record_
shell_ command - Record a shell command with full Context OS side effects. Always records in stats (even for track-only 0-token calls) so the dashboard command counter stays accurate. Adding 0 tokens does not inflate savings.
- record_
tree - Record a tree/ls operation with full Context OS side effects.