{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}

Complete Hook Reference

Comprehensive guide to all available Claude Code hooks

30+ Hook Types

Hook Categories Overview

Claude Code Tracker supports comprehensive development intelligence through these hook categories:

Essential (5)
Core session & tool tracking
Performance (5)
System & debug monitoring
Code Quality (4)
Linting, testing, builds
Workflow (4)
Development patterns
Collaboration (4)
External interactions
Intelligence (5)
High-level project insights

Essential Hooks

Core hooks that every user should enable for basic session and development tracking.

session_start

Triggered when a new Claude Code session begins

Required
session_end

Triggered when a Claude Code session ends

Required
conversation_update

Logs conversation messages and interactions

Recommended
tool_call

Tracks which tools are used and their performance

Recommended
file_modified

Records file creations, modifications, and deletions

Optional

Performance & Debugging

Monitor system performance and track debugging activities.

Purpose: Record when tools fail with detailed error information.

Hook Configuration:
"tool_error": "curl -X POST http://localhost:8000/api/hooks/tool-error -H 'Content-Type: application/json' -d '{\"tool_name\": \"$TOOL_NAME\", \"error_type\": \"$ERROR_TYPE\", \"error_message\": \"$ERROR_MESSAGE\", \"stack_trace\": \"$STACK_TRACE\"}'"

Variables: $TOOL_NAME, $ERROR_TYPE, $ERROR_MESSAGE, $STACK_TRACE

Purpose: Monitor periods when Claude is processing vs actively working.

Hook Configurations:
"waiting_period_start": "curl -X POST .../api/hooks/waiting-period -d '{\"reason\": \"thinking\", \"context\": \"$CONTEXT\"}'" "waiting_period_end": "curl -X POST .../api/hooks/waiting-period -d '{\"duration_ms\": $DURATION_MS, \"end_time\": \"$TIMESTAMP\"}'"

Use Cases: Identify bottlenecks, optimize prompts, understand processing patterns

Purpose: Track memory, CPU, and disk usage during development.

Hook Configuration:
"memory_usage": "curl -X POST .../api/hooks/performance -d '{\"metric_type\": \"memory\", \"value\": $MEMORY_MB, \"unit\": \"MB\", \"threshold_exceeded\": $THRESHOLD_EXCEEDED}'"

Metrics: memory, cpu, disk, network

Code Quality & Testing

Track linting, testing, builds, and dependency changes.

code_analysis

ESLint, Prettier, type checking results

test_execution

Unit tests, integration tests, coverage

build_process

Compilation, bundling, deployment

dependency_change

Package installs, updates, removals

Development Workflow

Understand development patterns and workflow efficiency.

context_switch

Track project/context changes

Impact: Measure multitasking overhead
search_query

What you search for in code/files

Insights: Common patterns, knowledge gaps
browser_tab

Documentation, StackOverflow visits

Analysis: Research patterns, learning topics
copy_paste

Code copying patterns

Quality: Identify repetitive work

Pre-configured Hook Setups

Download ready-to-use configurations for different development styles:

Essential

Core tracking only

Download
Developer

Code quality focused

Download
Power User

Advanced analytics

Download
Research

Learning focused

Download
Team

Collaboration tracking

Download
Comprehensive

All hooks enabled

Download
Hook Statistics
Total Hooks Available: 39
API Endpoints: 10
Pre-built Configs: 7
Hook Variables: 25+
Quick Setup
  1. Download a pre-configured setup above
  2. Copy JSON content to your Claude settings
  3. Ensure tracker is running on port 8000
  4. Start Claude Code - hooks activate automatically!
Key Variables
$SESSION_ID
Current session ID
$TOOL_NAME
Tool being called
$TIMESTAMP
Current timestamp
$FILE_PATH
Modified file path
$ERROR_MESSAGE
Error details
{% endblock %}