Claude Code Hooks Generator

Claude Code Hooks Generator (settings.json)

Build the hooks block for Claude Code settings.json without memorizing event names. Pick an event, matcher and handler, and get valid JSON with warnings for common mistakes. Free, in your browser.

Add hooks

Your hooks JSON

Put the hooks block in ~/.claude/settings.json (all projects), .claude/settings.json (shared with the project) or .claude/settings.local.json (personal, usually git-ignored). If a hooks block already exists, merge the events in.

How to use the Claude Code Hooks Generator

  1. Pick the event that should trigger your hook, such as PreToolUse, PostToolUse or Stop.
  2. If the event supports a matcher, enter it (for example Bash or Edit|Write). The field label shows what the matcher filters.
  3. Choose the handler type and enter the command, URL or prompt.
  4. Optionally set a timeout, status message, async or once.
  5. Copy the JSON into your Claude Code settings.json, or load an example first.

Frequently asked questions

What are Claude Code hooks?

Hooks are handlers that Claude Code runs automatically at set points in a session, such as before or after a tool call, when you submit a prompt, or when Claude finishes. They can run shell commands, call HTTP endpoints, or use a prompt or agent to check a condition.

Where do I put the hooks JSON?

In a hooks object inside a settings file: ~/.claude/settings.json for all projects, .claude/settings.json for a project you share with your team, or .claude/settings.local.json for personal project settings.

What does a matcher do?

A matcher narrows when a hook fires. For tool events it matches the tool name, for example Bash or Edit|Write. Other events match different fields, such as the notification type or how a session started. Events like Stop and UserPromptSubmit do not support matchers and always fire.

What is the if field?

A permission-rule filter such as Bash(git *) that narrows a tool hook to specific calls. The documentation says it is only evaluated on tool events and that on other events a hook with if set never runs, so this generator leaves it out for non-tool events.

Are hooks safe?

Hooks run arbitrary commands with your full user permissions, automatically. Read every command and script before you add it, and do not paste real secrets into a shared settings file.

How current is this?

The event names, matcher fields and handler options follow the official Claude Code hooks reference, last checked on 2026-11-01. New events are added regularly, so check the docs if an event you need is missing.

Everything runs in your browser. Nothing you enter is uploaded or stored by Nexatoolbox.