OpenWriterControle/plugins/claude-code/scripts/context/openagents-repo/lookup/hook-events.md
Darren Hinde a8fc9c7715
feat(plugin): enhance context management and skill invocation (#239)
* fix(shellcheck): declare and assign separately in router.sh (SC2155)

* feat(plugin): enhance context management and skill invocation

- Update .context-manifest.json to include profile and detailed source information.
- Revise context-scout.md to clarify context root discovery and navigation.
- Modify commands to replace deprecated skills with updated ones (brainstorming → approach, systematic-debugging → debugger).
- Streamline install-context.md for clarity and remove interactive profile selection.
- Improve oac-status.md to provide a more comprehensive status report.
- Add OAC system paths to session-start.sh for better context management.
- Remove obsolete skills and improve documentation for existing commands.
2026-02-23 12:12:29 +00:00

1.5 KiB

Hook Events Reference

Purpose: Quick reference for all Claude Code hook events


Available Events

Event When It Fires Can Block?
PreToolUse Before tool calls Yes (exit 2)
PostToolUse After tool calls complete No
PermissionRequest Permission dialog shown Yes (allow/deny)
UserPromptSubmit User submits prompt No
Notification Claude sends notification No
Stop Claude finishes responding No
SubagentStop Subagent task completes No
PreCompact Before compact operation No
SessionStart New/resumed session No
SessionEnd Session ends No

Matcher Syntax

  • "Bash" - Match specific tool
  • "Edit|Write" - Match multiple tools (OR)
  • "*" - Match all tools
  • "" - Match all (for Notification)

Exit Codes

Code Behavior
0 Success, continue execution
1 Error logged, continue execution
2 Block operation, feed stderr to Claude

Input/Output

Hooks receive JSON via stdin:

{
  "tool_name": "Bash",
  "tool_input": { "command": "ls -la" },
  "session_id": "...",
  "transcript_path": "..."
}

Output to stderr is fed back to Claude when blocking (exit 2).


  • ../concepts/hooks-system.md - Hooks overview
  • ../examples/hooks/ - Hook examples

Reference: https://docs.anthropic.com/en/docs/claude-code/hooks