MCP ServerHooks
Auto
wt hooks cursorOr enable during wt init when prompted.
What gets written
wt hooks writes ~/.cursor/hooks.json (user-level, applies to all projects) with the following hooks:
| Event | Action |
|---|---|
sessionStart | Pre-loads project knowledge into context |
beforeSubmitPrompt | Searches workthin with your prompt |
stop | Reminds the AI to call create-knowledge |
sessionEnd | Same reminder at session end |
Manual
Create ~/.cursor/hooks.json:
{
"hooks": [
{
"event": "sessionStart",
"command": "wt search \"project recent solutions\" --hook 2>/dev/null || true"
},
{
"event": "beforeSubmitPrompt",
"command": "wt search \"$CURSOR_USER_PROMPT\" --hook 2>/dev/null || true"
},
{
"event": "stop",
"command": "printf '{\"systemMessage\": \"Session complete. If you solved a problem, call create-knowledge.\"}'"
},
{
"event": "sessionEnd",
"command": "printf '{\"systemMessage\": \"Session ending. If you solved a problem, call create-knowledge.\"}'"
}
]
}See the Cursor hooks documentation for more details on available events.