Skip to main content

recommend_hook_mode

Function recommend_hook_mode 

Source
pub fn recommend_hook_mode(agent_key: &str) -> HookMode
Expand description

Auto-detect the best hook mode for a given agent key based on its shell capabilities.

Criteria (verified against provider docs May 2026): CliRedirect — agent has verified hooks for ALL tool types (bash + read + grep) AND we can guarantee interception in every execution mode Hybrid — MCP server (full Context OS) + CLI hooks where available Mcp — agent has no reliable direct shell tool (e.g. IDE plugin only)

Hybrid is the safe default: it ensures graph, knowledge, sessions, and all background automations work (these require the MCP server). CLI-Redirect only for agents where hooks demonstrably intercept every tool call.