MCP ServerHooks
Auto
wt hooks vscodeOr enable during wt init when prompted.
What gets written
wt hooks creates ~/.copilot/hooks/workthin.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: VS Code does not support a
SessionEndevent. UseStopto capture knowledge at the end of each agent turn.
Manual
Create ~/.copilot/hooks/workthin.json:
{
"hooks": [
{
"event": "SessionStart",
"command": "wt search \"project recent solutions\" --hook 2>/dev/null || true"
},
{
"event": "UserPromptSubmit",
"command": "wt search \"$VSCODE_USER_PROMPT\" --hook 2>/dev/null || true"
},
{
"event": "Stop",
"command": "printf '{\"systemMessage\": \"Session complete. If you solved a problem, call create-knowledge.\"}'"
}
]
}See the VS Code hooks documentation for more details.