MCP ServerHooks
Auto
wt hooks claude-codeOr enable during wt init when prompted.
What gets written
wt hooks adds the following hooks to ~/.claude/settings.json (user-level, applies to all projects):
| Event | Action |
|---|---|
SessionStart | Pre-loads project knowledge into context |
UserPromptSubmit | Searches workthin with your prompt |
Stop | Reminds Claude to call create-knowledge |
SessionEnd | Same reminder at session end |
Manual
Add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "wt search \"project recent solutions\" --hook 2>/dev/null || true"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "wt search \"${CLAUDE_USER_PROMPT:0:300}\" --hook 2>/dev/null || true"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "printf '{\"systemMessage\": \"Session complete. If you solved a problem, call create-knowledge.\"}'"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "printf '{\"systemMessage\": \"Session ending. If you solved a problem, call create-knowledge.\"}'"
}
]
}
]
}
}Verify
Start a new Claude Code session and ask a technical question. If matching knowledge exists in workthin, it will appear as context before Claude responds.