mcp_tool hooks that call codex_hook_event. The installer sets this up:
Manual setup
~/.codex/config.toml
server value must match the server name in config.toml.
~/.codex/hooks.json
chat_hook_event hooks (Hooks and capture).
What each event does
Thread routing
One Codex process can run several conversations over one MCP connection. Slaunt keeps them apart using theparams._meta.threadId Codex attaches to every request, including ordinary tool calls.
- Same
threadIdmeans same Slaunt thread and run; a different one means a different thread. - Calls with no selector belong to the connection’s own runtime, separate from every hook thread, and need their own
thread_begin. - To get a new Codex thread, start a new conversation.
new_thread: trueon a hook thread is rejected. - A bridge that can’t forward
threadIdcan send the native ID as_meta["ai.slaunt/codex-session-id"]or theX-Slaunt-Codex-Session-Idheader. If both are present they must match. - Don’t combine Codex selectors with the generic boundary headers; the request is rejected with
-32602.