Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteClaude Code hooks automate work at specific points in a session; OpenTelemetry is a separate way for organizations to export monitoring data. This guide moves from lifecycle events to matching and handler choices, then to telemetry controls. “Progressive disclosure” is an editorial description of that sequence, not a named Claude Code feature.
What are Claude Code hooks?
A hook is a configured handler that runs when a particular lifecycle event occurs. Depending on the event, a handler can be a shell command, HTTP endpoint, MCP tool call, prompt, or agent. Claude Code provides JSON context to the handler: command handlers receive it on standard input, while HTTP handlers receive it in the request body. The available inputs and decisions differ by event, so check the current hooks reference before implementing one.
As an Amazon Associate I earn from qualifying purchases.
Think of a hook configuration as three parts: the lifecycle event that can trigger it, an optional matcher group that filters when it runs, and one or more handlers. A hook may observe an event, provide context, or affect a decision. Its output and exit behavior matter; silence does not automatically approve an action.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Which Claude Code hook events are available?
The events are easier to reason about by the point in the session they represent. This grouping is an explanatory aid, not a separate product taxonomy; the event reference defines each event’s precise firing condition, schema, matcher field, supported handlers, and decisions.
#1 Best Overall
Session boundaries and setup
Setup,SessionStart, andSessionEndcover setup and session boundaries.
Prompt and response flow
UserPromptSubmitandUserPromptExpansionrelate to prompt handling.MessageDisplay,Stop, andStopFailurerelate to message display and stopping behavior.
Tools and permissions
PreToolUseruns before a tool is used;PostToolUseruns after successful use.PostToolUseFailureandPostToolBatchcover failure and batch cases.PermissionRequestandPermissionDeniedrelate to permission decisions.
Agents and tasks
SubagentStartandSubagentStopmark subagent activity.TaskCreated,TaskCompleted, andTeammateIdlerelate to task and teammate activity.
Workspace and configuration
InstructionsLoaded,ConfigChange,CwdChanged, andDirectoryAddedcover instructions, configuration, and workspace changes.FileChanged,WorktreeCreate, andWorktreeRemovecover file and worktree changes.
Context, model, and MCP input
PreCompactandPostCompactrelate to context compaction;PreModelSwitchandPostModelSwitchrelate to model changes.ElicitationandElicitationResultcover MCP elicitation.
Notifications
Notificationis the notification event.
How do you run a hook only before a particular tool?
Use PreToolUse for a handler that should run before tool execution, then add a matcher group for the relevant tool. For example, the hooks reference demonstrates matching Bash and narrowing further to relevant Bash commands. That lets a guard run for selected commands instead of every tool action. The exact matcher fields and syntax are event-specific; use the reference’s current example rather than assuming all events accept the same filters.
In the documented guard example, a handler can return a structured deny decision for destructive commands. A successful exit without output leaves the normal permission flow in place. This distinction is important: a hook can be designed to intervene, but merely running a hook or producing no output does not itself grant permission.
Where do hook settings apply?
Choose a configuration location based on who should receive and control the automation. The settings documentation describes settings behavior and precedence; the hooks reference covers hook-specific sources and scope.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- User settings: apply across that user’s projects.
- Project settings: can be committed and shared with a project.
- Local project settings: are project-specific and are not shared.
- Managed settings: are controlled by an organization.
- Other contexts: plugins, skills, and subagent frontmatter can define hooks within their respective contexts.
Do not assume that a hook configured for a local session behaves identically in a cloud or self-hosted context; configuration availability can differ.
Rank #3
How is OpenTelemetry different from hooks?
Hooks automate or influence behavior at lifecycle events. OpenTelemetry export is for organization-managed monitoring, not another hook type. Claude Code can export metrics as time-series data, events through the logs/events protocol, and optional traces to configured exporters. The organization chooses the exporter and, where applicable, the OTLP endpoint and monitoring backend. See the OpenTelemetry monitoring guide for the current configuration options.
The documented setup uses environment variables, including CLAUDE_CODE_ENABLE_TELEMETRY, exporter selection, and an OTLP endpoint where applicable. Administrators can also provide these values through a managed settings file. Repository .claude/settings.json and .claude/settings.local.json are ignored for OpenTelemetry exporter variables, and Claude Code does not pass OTEL_* variables to spawned subprocesses such as hooks and MCP servers.
Rank #4
What telemetry does Claude Code send?
“Telemetry” can mean different data flows, so identify the one you intend to control. Anthropic’s data usage documentation describes operational usage metrics and error reports, while OpenTelemetry export is configured for organization-managed monitoring. Feedback-related commands are another distinct path: depending on user selection and configuration, they can send conversation history, including code.
Recommended Free Tools
The data usage documentation describes operational metrics as excluding code, prompts, and file paths. Error reports have their own documented contents and redaction behavior; do not assume the metrics description also describes error reports or feedback submissions. Defaults and controls can vary with API provider, subscription, Claude Code version, and applicable organization agreements. Consult the current data usage page for the conditions that apply to your account.
Best Value
How do you disable or manage telemetry?
First decide which data flow you mean. For Anthropic operational metrics and error reporting, use the separate controls described in the data usage documentation; do not treat a hook setting as a telemetry opt-out. For organization-exported OpenTelemetry, administrators configure export through the documented environment variables or managed settings. The monitoring guide covers exporter configuration and signal selection. If feedback submission is the concern, treat it separately from both operational reporting and configured OpenTelemetry export.
Before deploying organization-wide settings, verify the current behavior for your provider and account conditions. The Claude Code documentation is living documentation and does not state a publication date; these pages were checked on October 7, 2026.
Quick Recap
Which mechanism should you use?
- Choose a hook when a command or other handler should run at a session, prompt, tool, permission, task, workspace, or context event.
- Use the data usage controls when the question is Anthropic’s operational metrics or error reporting.
- Configure OpenTelemetry when your organization needs to export selected metrics, events/logs, or optional traces to its monitoring stack.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




