Claude Code settings.json Builder

Point, click, copy. A complete settings.json — permissions, environment variables, model, hooks — assembled in your browser. Nothing leaves this page.

Reference verified against Claude Code v2.1 · 2026-07-09

Where will this file live?

Save as ~/.claude/settings.json

Permissions
Common:
Common:
Environment variables
Model
Hooks

Build hooks with the Hooks Builder — it generates a ready-to-paste hooks fragment. Paste it here and it merges into the full file.

Other settings

Your settings.json

{}

Paste into ~/.claude/settings.json — create the file if it doesn't exist. Changes apply to new sessions.

Claude Code settings.json — the complete reference

settings.json is Claude Code's configuration file. It controls what Claude is allowed to do without asking (permissions), the environment it runs in (env), which model it uses, and what happens at lifecycle events (hooks). It's plain JSON — no build step, no CLI wizard required — which is why a generator like the one above is all you need.

Three files, three scopes

The same schema lives at three paths, and which one you edit decides who it applies to:

FileScopeUse it for
~/.claude/settings.json User — every project on this machine Personal defaults: model choice, telemetry opt-outs, rules you want everywhere
.claude/settings.json Project — checked into git, shared with the team Team conventions: the test commands everyone allows, the secrets everyone denies
.claude/settings.local.json Local — this repo, just you Personal experiments and machine-specific paths; Claude Code gitignores it for you

Precedence: who wins when settings conflict

More specific beats more general. From highest priority to lowest:

  1. Enterprise managed policies — deployed by an IT admin (managed-settings.json in the system directory); users can't override these
  2. Command-line arguments — per-session flags like --model
  3. Local project settings.claude/settings.local.json
  4. Shared project settings.claude/settings.json
  5. User settings~/.claude/settings.json

For permissions specifically, rules from every file are merged — and a deny rule wins over an allow rule regardless of which file it comes from. You can allow Bash broadly in your user settings and a project's deny list will still block Bash(curl:*).

The permissions block

This is the block most people come here for. Five keys matter:

"permissions": {
  "allow": [ "Bash(npm run test:*)" ],
  "ask":   [ "Bash(git push:*)" ],
  "deny":  [ "Read(./.env)", "WebFetch" ],
  "additionalDirectories": [ "../docs/" ],
  "defaultMode": "acceptEdits"
}

Permission rule syntax

Every rule is either a bare tool name (WebFetch matches every use of the tool) or a tool name with a specifier: Tool(specifier). The specifier's meaning depends on the tool:

ToolRule exampleWhat it matches
Bash Bash(npm run build) Exactly that command, nothing else
Bash(npm run test:*) Any command starting with npm run test — the :* suffix is the prefix wildcard
Read / Edit Edit(docs/**) Files matching the pattern — gitignore-style globs (see path forms below)
WebFetch WebFetch(domain:example.com) Fetches from that domain only
MCP tools mcp__github Every tool exposed by the github MCP server
mcp__github__get_issue One specific tool on that server. Wildcards work after the mcp__server__ prefix — mcp__github__* matches every tool on the server and mcp__github__get_* matches its get_ tools — but the server segment itself can't be a wildcard

Bash rule gotchas

Read/Edit path forms

Read and Edit rules follow the gitignore spec, with four ways to anchor a path:

PatternAnchored toExample
//pathFilesystem root (absolute) Read(//etc/hosts)
~/pathYour home directory Read(~/.zshrc)
/pathThe directory containing the settings file Edit(/src/**)
path or ./pathThe current working directory Read(./.env)

The single leading slash is the one that surprises people: Edit(/src/**) is not an absolute path — it's relative to wherever the settings file lives. Use // when you really mean the filesystem root.

Common recipes

A sensible project baseline

"permissions": {
  "allow": [
    "Bash(npm run test:*)",
    "Bash(npm run lint:*)",
    "Bash(git diff:*)",
    "Bash(git log:*)"
  ],
  "ask": [ "Bash(git push:*)" ],
  "deny": [
    "Read(./.env)",
    "Read(./.env.*)",
    "Read(./secrets/**)"
  ]
}

Lock down network access

"permissions": {
  "allow": [ "WebFetch(domain:docs.anthropic.com)" ],
  "deny":  [ "WebFetch", "Bash(curl:*)", "Bash(wget:*)" ]
}

Deny beats allow — so this blocks all fetching except the allowed domain? No: a bare WebFetch deny blocks everything, including the allow rule. To allowlist domains, deny nothing and allow only the domains you want; unlisted domains then fall back to prompting. Keep the curl/wget denies either way — shell commands are the classic way around a WebFetch rule.

Environment variables

Everything under "env" is applied to every Claude Code session. Useful ones:

VariableWhat it does
ANTHROPIC_MODELModel override (same effect as the model setting)
BASH_DEFAULT_TIMEOUT_MSDefault timeout for shell commands Claude runs
BASH_MAX_TIMEOUT_MSCeiling for timeouts Claude may request
MAX_THINKING_TOKENSCap on extended-thinking budget
MCP_TIMEOUTMCP server startup timeout (ms)
DISABLE_TELEMETRYSet to 1 to opt out of telemetry (also disables feature-flag fetching)
DISABLE_AUTOUPDATERSet to 1 to disable auto-updates
HTTP_PROXY / HTTPS_PROXYRoute traffic through a proxy

All values must be strings — the builder above quotes them for you.

Hooks

Hooks run your own shell commands at lifecycle events — before a tool call (PreToolUse), after one (PostToolUse), when Claude finishes responding (Stop), and more. They live under the "hooks" key of this same file. Designing matchers and commands is its own topic — use the Hooks Builder, which walks through every event and emits a fragment you can paste into the Hooks field above to merge into your full settings.json.

Top-level key reference

KeyTypeWhat it does
permissionsobjectAllow/ask/deny rules, extra directories, default mode — see above
envobjectEnvironment variables for every session
hooksobjectLifecycle-event shell commands — see the Hooks Builder
modelstringDefault model, e.g. "opus" or a full model ID
statusLineobjectCustom status line: {"type": "command", "command": "…"} — see the Statusline Maker
includeCoAuthoredBybooleanfalse removes the Co-Authored-By: Claude git-commit byline (default true)
cleanupPeriodDaysnumberHow long chat transcripts are kept locally (default 30)
apiKeyHelperstringScript that prints an auth token — for short-lived credentials
forceLoginMethodstringPin login to "claudeai" or "console"
enableAllProjectMcpServersbooleanAuto-approve every server in the project's .mcp.json
enabledMcpjsonServers / disabledMcpjsonServersarrayApprove or reject specific .mcp.json servers by name
outputStylestringAdjusts the system prompt via a named output style

FAQ

settings.json or CLAUDE.md — which one do I want?
settings.json configures the tool: hard rules the software enforces (permissions, env, hooks). CLAUDE.md instructs the model: conventions and context it reads as prose. A deny rule in settings.json is enforced; a "please don't" in CLAUDE.md is a request.
Do I need to restart Claude Code after editing?
Start a new session to be sure. Settings are read at session start; a running session won't reliably pick up edits.
Where do MCP servers go — settings.json?
Server definitions live in .mcp.json (project) or via claude mcp add. settings.json only controls approval of those servers (enableAllProjectMcpServers and friends) and per-tool permission rules (mcp__server__tool).
My allow rule isn't working.
Three usual suspects: a deny rule somewhere in the stack (deny always wins, check all three files plus managed policies), a missing :* on a Bash rule you meant as a prefix, or a Read/Edit path anchored to the wrong base — remember /path is settings-file-relative, not absolute.
Is it safe to commit .claude/settings.json?
Yes — that's the point of the project scope. Keep personal machine paths and experiments in settings.local.json, which Claude Code adds to .gitignore automatically.