
Hook Observer
- 1 repo stars
- Updated April 8, 2026
- cc-friend/claude-code-plugins
Logs all Claude Code hook events to JSONL for debugging and analysis
About
hook-observer is a Claude Code skill in the Debugging category. Logs all Claude Code hook events to JSONL for debugging and analysis
- hook-observer
- Debugging
- AI-coding skill
Hook Observer by the numbers
- Data as of Jul 7, 2026 (Skillselion catalog sync)
/plugin marketplace add cc-friend/claude-code-plugins/plugin install hook-observer@cc-friendAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| repo stars | ★ 1 |
|---|---|
| Last updated | April 8, 2026 |
| Repository | cc-friend/claude-code-plugins ↗ |
What it does
Logs all Claude Code hook events to JSONL for debugging and analysis
README.md
Hook Observer - Claude Code Plugin
A collection of Useful Claude Code tools and plugins by Tom Chen. For now it only contains the Hook Observer plugin.
Hook Observer
A Claude Code plugin that captures all 22 hook events and logs them to ~/.claude/hook-observer-data/events.jsonl.
Useful for debugging hooks when developing plugins, keeping history, and learning how Claude Code works under the hood.
To view these events in a real-time web app, use my CC Friend (Claude Code Friend).
Install
claude plugin marketplace add cc-friend/claude-code-plugins
claude plugin install hook-observer@cc-friend
Architecture
Once installed, every Claude Code hook event is logged to ~/.claude/hook-observer-data/events.jsonl as JSONL (one JSON object per line), enriched with _observer metadata (event ID, timestamp).
Claude Code hook event (JSON via stdin)
|
v
scripts/hook-handler.js Enriches with metadata, appends to JSONL
|
v
~/.claude/hook-observer-data/events.jsonl
- hook-handler.js: universal logger for 21 events. Reads JSON from stdin, enriches with
_observermetadata (event_id,timestamp), appends to JSONL file. Exits 0 immediately. - worktree-handler.js:
WorktreeCreatepassthrough. Logs the event, then runsgit worktree addand prints the path to stdout.
All hooks run with async: true (except WorktreeCreate) so they never slow down Claude Code.
Supported Events
| Category | Event | Description |
|---|---|---|
| Session | SessionStart |
Session begins or resumes |
| Session | UserPromptSubmit |
User submits a prompt |
| Session | SessionEnd |
Session terminates |
| Tool | PreToolUse |
Before a tool call executes |
| Tool | PostToolUse |
After a tool call succeeds |
| Tool | PostToolUseFailure |
After a tool call fails |
| Tool | PermissionRequest |
Permission dialog appears |
| Stop | Stop |
Claude finishes responding |
| Stop | StopFailure |
Turn ends due to API error |
| Agent | SubagentStart |
Subagent is spawned |
| Agent | SubagentStop |
Subagent finishes |
| Agent | TeammateIdle |
Teammate about to go idle |
| Task | TaskCompleted |
Task marked as completed |
| Task | WorktreeCreate |
Worktree being created |
| Task | WorktreeRemove |
Worktree being removed |
| Config | InstructionsLoaded |
CLAUDE.md file loaded |
| Config | ConfigChange |
Settings file changed |
| Config | PreCompact |
Before context compaction |
| Config | PostCompact |
After compaction completes |
| MCP | Elicitation |
MCP server requests input |
| MCP | ElicitationResult |
User responds to MCP input |
| Notification | Notification |
Claude Code sends notification |
Uninstallation
claude plugin uninstall hook-observer
Development
claude --plugin-dir /path/to/claude-code-plugins/hook-observer
This loads the plugin for a single session without installing it (uninstallation would not be necessary).
License
MIT