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. When both original and output are 0 (track-only, no compression), only updates the session command counter without inflating token statistics.
- record_
tree - Record a tree/ls operation with full Context OS side effects.