Hooks let workthin run automatically in the background: searching for relevant knowledge at session start and before each prompt, and reminding you to capture solutions when a session ends.
How it works
Setup
wt hooksOr add hooks to a specific tool:
wt hooks cursorHooks can also be enabled during wt init — you will be prompted automatically.
Supported Tools
| Tool | Session start | Search on prompt | Capture | Session end |
|---|---|---|---|---|
| Claude Code | ✓ | ✓ | ✓ | ✓ |
| Cursor | ✓ | ✓ | ✓ | ✓ |
| VS Code | ✓ | ✓ | ✓ | — |
| GitHub Copilot CLI | ✓ | ✓ | ✓ | ✓ |
| OpenAI Codex CLI | ✓ | ✓ | ✓ | — |
| Gemini CLI | ✓ | ✓ | ✓ | ✓ |
ChatGPT and Claude Desktop do not support hooks — use Instructions instead.
Hook behavior
On session start — wt search "project recent solutions" --hook pre-loads relevant project knowledge into context.
On prompt submission — wt search "<prompt>" --hook runs in the background. If matching knowledge exists, it is injected as a system message before the AI responds.
On stop / session end — A system message reminds the AI: "If you solved a problem, call create-knowledge to capture it." The AI then calls the create-knowledge MCP tool directly.