MCP ServerHooks
Auto
wt hooks copilot-cliOr enable during wt init when prompted.
What gets written
wt hooks writes ~/.github/copilot/hooks.json (user-level, applies to all projects) with the following hooks:
| Event | Action |
|---|---|
sessionStart | Pre-loads project knowledge into context |
userPromptSubmitted | Searches workthin with your prompt |
mainAgentStop | Reminds the AI to call create-knowledge |
sessionEnd | Same reminder at session end |
Manual
Create ~/.github/copilot/hooks.json:
{
"hooks": [
{
"event": "sessionStart",
"command": "wt search \"project recent solutions\" --hook 2>/dev/null || true"
},
{
"event": "userPromptSubmitted",
"command": "wt search \"$GITHUB_COPILOT_PROMPT\" --hook 2>/dev/null || true"
},
{
"event": "mainAgentStop",
"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 GitHub Copilot hooks documentation for more details.