Example settings files - Claude Code Docs
Documentation Index Fetch the complete documentation index at: /docs/llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. This page holds three example settings.json files, one for each place you save a setting: A developer’s ~/.claude/settings.json A team’s .claude/settings.json , committed to the repository An organization’s managed-settings.json Each one is a plausible file for that reader, so you can see the shape and copy the parts you want.
None of them is a recommended baseline. Every value comes from the key’s entry on the settings reference , which has its type, default, and where it can be set. Each example has two tabs. Copyable settings file is the file as you’d save it. What each key does is the same file with a comment above each key; Claude Code doesn’t accept comments in a settings file, so copy from the first tab. Your own settings One developer’s personal settings.
It picks a model and effort, adjusts the terminal, and pre-approves a read-only command and one file read. Everything not listed keeps its default. A file like this goes in ~/.claude/settings.json , where it applies to every project you open. Copyable settings file What each key does Save this as ~/.claude/settings.json . It’s valid JSON with no comments, so you can paste it as is and delete the keys you don’t want. ~/.claude/settings.json { "model" : "claude-sonnet-5" , "modelSettings" : { "claude-sonnet-5" : { "effortLevel" : "xhigh" } }, "editorMode" : "vim" , "theme" : "light-daltonized" , "statusLine" : { "type" : "command" , "command" : "jq -r ' \" [ \\ (.model.display_name)] \\ (.context_window.used_percentage // 0)% context \" '" , "padding" : 2 }, "spinnerTipsEnabled" : false , "preferredNotifChannel" : "terminal_bell" , "permissions" : { "allow" : [ "Bash(git diff *)" , "Read(~/.zshrc)" ] }, "autoUpdatesChannel" : "stable" , "cleanupPeriodDays" : 20 } The same file with a comment above each key.
Read it here; copy from the other tab, because Claude Code doesn’t accept comments in a settings file. ~/.claude/settings.json { // Start every session on Sonnet 5 "model" : "claude-sonnet-5" , // Run Sonnet 5 above its default high level; /effort saves a level per model, and --effort sets one for a single session "modelSettings" : { "claude-sonnet-5" : { "effortLevel" : "xhigh" } }, // Vim keybindings in the prompt "editorMode" : "vim" , // The colorblind-friendly light theme "theme" : "light-daltonized" , // A status line below the prompt: model name and context used "statusLine" : { "type" : "command" , "command" : "jq -r ' \" [ \\ (.model.display_name)] \\ (.context_window.used_percentage // 0)% context \" '" , "padding" : 2 }, // Hide the tips that rotate under the spinner "spinnerTipsEnabled" : false , // Ring the terminal bell for notifications, such as a finished task or a waiting permission prompt "preferredNotifChannel" : "terminal_bell" , // Let Claude Code run git diff and read your .zshrc without asking "permissions" : { "allow" : [ "Bash(git diff *)" , "Read(~/.zshrc)" ] }, // Take updates from the stable channel "autoUpdatesChannel" : "stable" , // Delete session transcripts and other local session data older than 20 days "cleanupPeriodDays" : 20 } A team’s shared settings One team’s shared settings, committed to the repository so everyone who clones it gets the same permissions, hooks, and plugin marketplace.
Save a file like this at .claude/settings.json at the top of the repository. What to know before you commit one: Cloud sessions outside a project ’s threads read it too. A cloud session with one repository starts inside the clone, so the committed file applies there as well. Telemetry goes in managed or personal settings. Claude Code ignores the OpenTelemetry exporter variables in a repository’s settings files, apart from some values that turn telemetry off.
Set them in managed settings for your organization, or in each person’s ~/.claude/settings.json . Allow rules wait for trust. Allow rules and extraKnownMarketplaces entries take effect after each person trusts this folder itself , not only a parent folder; deny and ask rules apply in every session, trusted or not. The hook is a script in the repo. This file’s hook runs .claude/hooks/block-rm.sh ; How a hook resolves walks through writing it.
Rules match the command and path as written. Bash(git push *) doesn’t match git -C . push . Read(./.env) on its own stops the file tools and commands that name the file, such as cat .env , but not grep -r run over the directory ; the sandbox block in this file closes that gap, because the sandbox adds your Read deny paths to what every sandboxed command can’t read. Copyable settings file What each key does Save this as .claude/settings.json at the top of the repository and commit it.
It’s valid JSON with no comments, so you can paste it as is and delete the keys you don’t want. .claude/settings.json { "permissions" : { "allow" : [ "Bash(npm run *)" ], "ask" : [ "Bash(git push *)" ], "deny" : [ "Read(./.env)" , "Read(./.env.*)" , "Read(./secrets/**)" ] }, "hooks" : { "PreToolUse" : [ { "matcher" : "Bash" , "hooks" : [ { "type" : "command" , "command" : "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh" } ] } ] }, "extraKnownMarketplaces" : { "acme-tools" : { "source" : { "source" : "github" , "repo" : "acme-corp/claude-plugins" } } }, "enabledPlugins" : { "code-formatter@acme-tools" : true }, "sandbox" : { "enabled" : true , "filesystem" : { "allowWrite" : [ "/tmp/build" ] }, "network" : { "allowedDomains" : [ "registry.npmjs.org" , "*.example.com" ] } }, "plansDirectory" : "./plans" } The same file with a comment above each key.
Read it here; copy from the other tab, because Claude Code doesn’t accept comments in a settings file. .claude/settings.json { "permissions" : { // Run npm scripts without asking "allow" : [ "Bash(npm run *)" ], // Confirm before git push commands "ask" : [ "Bash(git push *)" ], // Deny reads of env files and the secrets folder by the file tools and file-reading commands "deny" : [ "Read(./.env)" , "Read(./.env.*)" , "Read(./secrets/**)" ] }, // Before every Bash command, run a script in the repo that can block it "hooks" : { "PreToolUse" : [ { "matcher" : "Bash" , "hooks" : [ { "type" : "command" , "command" : "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh" } ] } ] }, // Register the team's plugin marketplace on every clone "extraKnownMarketplaces" : { "acme-tools" : { "source" : { "source" : "github" , "repo" : "acme-corp/claude-plugins" } } }, // Enable one plugin from that marketplace; a plugin from an external source such as a GitHub repository still needs each person to install it once "enabledPlugins" : { "code-formatter@acme-tools" : true }, // Sandbox commands: writable build dir; npm and example.com pre-allowed "sandbox" : { "enabled" : true , "filesystem" : { "allowWrite" : [ "/tmp/build" ] }, "network" : { "allowedDomains" : [ "registry.npmjs.org" , "*.example.com" ] } }, // Keep plan files inside the repo "plansDirectory" : "./plans" } An organization’s managed settings A managed-settings.json file that shows the shape of the managed keys, with one plausible value for each.
It isn’t a recommended policy: pick the keys that match your own requirements and set your own values. The example sets these keys: forceLoginMethod and forceLoginOrgUUID pin the login method and organization availableModels and enforceAvailableModels restrict which models sessions can use permissions.deny denies two file reads and curl commands as Claude writes them , and disableBypassPermissionsMode removes the bypass permission mode allowManagedPermissionRulesOnly and allowManagedMcpServersOnly make the managed permission and MCP allowlists the only ones that apply allowedMcpServers pins the MCP server by URL strictKnownMarketplaces allows one plugin marketplace sandbox sandboxes comma
The rest of this page is on the live site.