What it does
The hook integration installs aUserPromptSubmit hook that injects a short GitWhy awareness paragraph at the start of every agent turn. This guarantees the agent is aware of GitWhy in every conversation, regardless of context window state.
Setup
Rungit why setup and select Hook from the menu, or add the hook configuration below manually.
This adds a hook configuration to .claude/settings.local.json (for Claude Code):
git-why hook-run outputs a short instruction paragraph that the agent receives before your prompt.
What gets injected
When to use the hook
Use the hook when:- The agent frequently loses awareness of GitWhy mid-session
- You want a hard guarantee that every prompt includes GitWhy context
- Other integration methods are not available for your agent
- Skill files or Rules are working reliably (lower token cost, same awareness)
- You are concerned about per-turn token usage
Agent compatibility
See also
- MCP server — tool access without per-turn injection
- Rules — session-level awareness at lower token cost