Guilds AI / Blog

,

Claude Code Settings: Configure Permissions and JSON Files

Illustrative laptop showing a Claude Code JSON configuration file and permission management symbols.

Claude Code settings let you customize the coding assistant’s behavior, model preferences, permissions and project integrations. The main configuration files are settings.json and settings.local.json, with separate user, project and managed scopes. Choosing the correct file matters because it determines who receives a setting and which configuration takes precedence.

If you have not yet installed or launched the CLI, start with our guide to using Claude Code in terminal.

For an upstream error rather than a configuration problem, see our Claude Code 500 error troubleshooting guide.

For configuring Claude Code inside the editor, see our Claude Code in VS Code guide.

For temporary environment credentials and authentication checks, read our guide to using Claude Code with an API key.

For learning-oriented project instructions and exercises, see our Claude Code learning path.

Where are Claude Code settings stored?

Claude Code settings are stored in JSON files at different scopes. The scope determines whether the configuration follows your account on the machine, belongs to a project, or applies as an organizational policy. Use the following locations for local Claude Code sessions.

FilePurpose
~/.claude/settings.jsonPersonal defaults across projects on the current machine.
.claude/settings.jsonShared project configuration, suitable for version control after review.
.claude/settings.local.jsonPersonal project overrides, normally excluded from version control.
managed-settings.jsonAdministrator-managed policies; location and delivery vary by platform.

The tilde refers to your home directory. On Windows, look under your user profile. A custom CLAUDE_CONFIG_DIR can change the location of user configuration. Start Claude Code from the intended project directory and check which settings it loads, especially if you work in subdirectories or worktrees. Cloud sessions have different configuration rules, so do not assume a local override is available there.

How configuration precedence works

For ordinary conflicting settings, the general order from highest to lowest priority is administrator-managed policy, session-specific command-line overrides, project-local settings, shared project settings, and user defaults. The official Claude Code documentation notes exceptions for specific restrictive settings and keys that are accepted only at particular scopes.

Consider a personal preference that enables terminal tips across all projects. If the shared configuration disables tips in one repository, that project normally uses the shared value. A local override can change your preference for that repository without modifying the settings used by teammates.

Permission lists are not ordinary scalar preferences: applicable lists can combine across scopes. Deny rules take priority over allow rules, and a matching ask rule can still require approval even when another scope contains an allow rule. Managed restrictions and workspace trust can impose further limits. Inspect the effective permissions rather than assuming a higher-priority file replaces the entire list.

How to create or edit settings.json

Choose the scope first. Use the project-local file for experiments, and share team defaults only after reviewing them. Create the relevant .claude directory if necessary, open the existing file in your editor, and merge the new keys into its JSON object. Preserve unrelated configuration. JSON settings do not support comments or trailing commas.

The example below uses narrow read-oriented Git approvals, requests confirmation for matching package installation commands, and denies the built-in Read tool access to two sensitive paths. It is an illustration of the configuration structure, not a comprehensive security policy. Confirm the exact permission patterns against your installed version.

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(git diff)"
    ],
    "ask": [
      "Bash(npm install *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./secrets/**)"
    ]
  }
}

A Read rule does not necessarily prevent a shell command or another tool from accessing the same data. Keep sensitive credentials outside the accessible workspace and use OS-level isolation and sandbox restrictions where appropriate. Do not commit credentials, tokens or machine-specific secrets in a shared settings file. If you create the local settings file manually, ensure Git ignores it.

Configure permissions without granting unnecessary access

Use allow rules only for operations whose effects you understand, such as inspecting Git status. Use ask rules where a human should review a command before execution. Deny operations that the assistant must not perform. A seemingly harmless command can invoke project-controlled scripts, so review the repository and its dependencies before granting persistent execution permission.

Keep the default permission mode when you are unsure. Planning mode is useful for exploring changes before editing. Settings that broadly reduce approval requirements may have additional restrictions and are not necessary for a normal development workflow. Our AI coding agents guide covers review and safe delegation.

Other configuration files and settings

Claude Code also supports settings for its model selection, hooks, plugins and environment. A hook runs a configured action at a specified lifecycle event; review its commands just as you would review a build script. Use a secret manager or supported authentication mechanism for confidential credentials rather than storing them in JSON.

CLAUDE.md is used for standing project instructions, such as the test command or coding conventions. It is not a substitute for permission enforcement. MCP server definitions can have separate configuration files, including a project-level .mcp.json. See our MCP server setup guide for client configuration and connection checks.

For a broader overview of protecting information passed to model services, read our generative AI API security guide.

Troubleshoot settings that do not take effect

Run /status within a local Claude Code session to see which settings sources have loaded. Use /permissions to inspect applicable tool rules and their origins. The terminal /config interface exposes selected preferences, not necessarily every JSON key. Run claude doctor from the shell to investigate rejected settings and diagnostic information.

If your changes are missing, verify the file path, JSON syntax, session working directory, installed CLI version and organizational policy. Check whether another scope supplies a conflicting value. If an approval continues to appear, inspect applicable ask or deny rules and whether the workspace has been trusted. Most file changes can reload automatically, but some settings require a new session. Check behavior with a harmless test before relying on it.

The example JSON was syntax-checked, but the Claude Code runtime was not available for execution testing. Validate it against the current official settings and permission documentation before deploying it to your own environment.

Frequently asked questions

Is settings.local.json shared with my team? It is intended for personal project settings and should remain excluded from Git.

Can I override an administrator’s managed settings? Generally no. The official documentation describes specific exceptions that preserve more restrictive behavior; consult your administrator for changes to managed policy.

Why does Claude Code still ask for permission? A matching ask rule, a managed restriction, workspace trust or a rule that does not match the command can explain the prompt.

Is CLAUDE.md the same as settings.json? No. CLAUDE.md supplies instructions, whereas settings files configure supported application behavior and permissions.