Claude Code Settings Generator

Claude Code reads hooks and the status line from a settings.json file, subagents from Markdown files in .claude/agents, and custom commands from .claude/commands. Pick an event, a matcher and a command, fill in an agent or a command, and this page writes each file with a live preview you can check, copy or download.

Where each file goes (as of October 2026)
WhatProject filePersonal file
Hooks and status line.claude/settings.json~/.claude/settings.json
Private project overrides.claude/settings.local.jsonNot applicable
Subagent.claude/agents/<name>.md~/.claude/agents/<name>.md
Slash command.claude/commands/<name>.md~/.claude/commands/<name>.md

Updated

The Claude Code docs explain every option, but you still end up hand-typing nested JSON where one missing bracket or a misspelled event name means the hook silently never fires. This generator keeps the event names, matcher rules and handler fields in dropdowns, shows the exact file as you type, and checks a settings.json you paste against the same rules.

Hooks for settings.json

Everything is built in this tab. Nothing you type is uploaded.

Three hooks worth copying

Each example is a complete settings.json. Merge the hooks key into your own file if you already have one.

Run Prettier after every edit

PostToolUse fires after the tool succeeds. The hook input arrives on stdin, so jq pulls out the edited file path.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
          }
        ]
      }
    ]
  }
}

Block edits to .env files

A PreToolUse script that exits with code 2 stops the edit and sends its stderr back as the reason.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "jq -r '.tool_input.file_path' | grep -q '\\.env' && { echo 'Editing .env files is blocked' >&2; exit 2; } || exit 0"
          }
        ]
      }
    ]
  }
}

Desktop alert when Claude needs you (macOS)

Notification fires when Claude Code is waiting for input or permission.

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs you\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}

Every hook event and whether it takes a matcher

Event names from the hooks reference. Matcher support is shown where the docs state it.

Claude Code hook events (as of October 2026)
EventMatcher
SessionStartSource
SetupSee docs
SessionEndSee docs
UserPromptSubmitIgnored
UserPromptExpansionSee docs
PreToolUseTool name
PermissionRequestTool name
PermissionDeniedTool name
PostToolUseTool name
PostToolUseFailureTool name
PostToolBatchIgnored
NotificationSee docs
MessageDisplayIgnored
SubagentStartSee docs
SubagentStopSee docs
TaskCreatedIgnored
TaskCompletedIgnored
TeammateIdleIgnored
StopIgnored
StopFailureSee docs
InstructionsLoadedSee docs
ConfigChangeSee docs
CwdChangedIgnored
DirectoryAddedSee docs
FileChangedSee docs
WorktreeCreateIgnored
WorktreeRemoveIgnored
PreCompactSee docs
PostCompactSee docs
PreModelSwitchSee docs
PostModelSwitchSee docs
ElicitationSee docs
ElicitationResultSee docs

How a hook entry is shaped

Under the hooks key, each event name holds a list of matcher groups. Each group has an optional matcher and its own hooks list, and each handler has a type plus the field that type needs: command for command hooks, url for http hooks, prompt for prompt hooks.

Matchers made only of letters, digits, underscores, hyphens, spaces, commas and pipes are exact names or lists, so Edit|Write matches either tool. Any other character turns the matcher into a regular expression, which is how mcp__github__.* catches every tool from one MCP server.

Settings files merge, they do not replace

Hook entries from your personal file, the project file and the local file all run. That makes it safe to keep a personal formatter hook in ~/.claude/settings.json and a team-wide safety hook in the project file.

If you paste an existing settings.json into the checker, it reads only the hooks and statusLine keys and leaves everything else alone, so permissions and env blocks pass through untouched.

How it works

  1. Choose a tab: hooks, subagent, status line or slash command.
  2. Fill in the fields. Events that ignore matchers grey the matcher box out so you do not add one by mistake.
  3. Read the preview on the right. It updates on every keystroke and is checked as you go.
  4. Copy it or download the file, then save it at the path shown above the preview.

Tips

  • A hook script that exits with code 2 blocks the action on events that can block, such as PreToolUse, and its stderr is shown as the reason.
  • Use ${CLAUDE_PROJECT_DIR} in hook commands so the script path works whatever folder the session started in.
  • Give a subagent only the tools it needs. A reviewer rarely needs Edit or Bash.
  • Keep status line scripts fast. Claude Code cancels a run that is still going when the next update arrives.

Frequently asked questions

Which hook events does Claude Code support?

The hooks reference lists 33 events as of October 2026, including SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification, SubagentStop, Stop, PreCompact and SessionEnd. The full list is in the event dropdown on this page.

Which events accept a matcher?

Tool events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied) match on tool name, and SessionStart matches on its source, such as startup or resume. UserPromptSubmit, Stop and a few others ignore matchers silently.

What fields does a subagent file need?

Only name and description are required in the front matter. Optional fields include tools, model (sonnet, opus, haiku, fable, a full model ID or inherit), color, permissionMode and maxTurns. The Markdown body becomes the subagent's system prompt.

What data does a status line script receive?

Claude Code pipes JSON to the script on stdin. Useful fields include model.display_name, workspace.current_dir, cost.total_cost_usd and context_window.used_percentage. Whatever the script prints becomes the status line.

Are slash commands still supported now that skills exist?

Yes. Files in .claude/commands keep working and create the same /name command as a skill would. A skill with the same name takes priority over the command file.

Related: Claude skills builder, CLAUDE.md, AGENTS.md and Cursor rules generator, MCP server directory, How to build an MCP server, .env file format, We.Inc and Claude.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

Product

Who It's For

Features

Resources

Company

View Sitemap