Files
claude-code/hooks/hooks.json
OpenCode Test 73400a21ab Add UserPromptSubmit hook for context injection
Injects contextual information when user submits a prompt:
- Current time with period (morning/afternoon/evening/night)
- Git branch if in a repository
- Relevant memory items based on prompt keywords (2+ matches)
- Pending decisions needing attention

Design:
- Skips short prompts (<10 chars) to not slow down commands
- 5s timeout to keep prompts responsive
- Lightweight keyword matching for memory relevance

Also updates general-instructions.json with git workflow notes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 12:34:39 -08:00

47 lines
851 B
JSON

{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/prompt-context.py",
"timeout": 5
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/session-start.sh"
}
]
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/pre-compact.sh"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/session-end.sh",
"timeout": 120
}
]
}
]
}
}