MCP ServerHooks
Auto
wt hooks codex-cliOr enable during wt init when prompted.
What gets written
wt hooks writes ~/.codex/hooks.json (user-level, applies to all projects) with the following hooks:
| Event | Action |
|---|---|
SessionStart | Pre-loads project knowledge into context |
UserPromptSubmit | Searches workthin with your prompt |
Stop | Reminds the AI to call create-knowledge |
Note: Codex CLI does not support a
SessionEndevent. UseStopto capture knowledge at the end of each agent turn.
Manual
Create ~/.codex/hooks.json:
{
"hooks": {
"SessionStart": {
"command": "wt search \"project recent solutions\" --hook 2>/dev/null || true"
},
"UserPromptSubmit": {
"command": "wt search \"$CODEX_USER_PROMPT\" --hook 2>/dev/null || true"
},
"Stop": {
"command": "printf '{\"systemMessage\": \"Session complete. If you solved a problem, call create-knowledge.\"}'"
}
}
}See the Codex CLI hooks documentation for more details.