Skip to main content
Claude Code is configured at multiple levels — global user settings, project-local settings, CLAUDE.md instruction files, CLI flags, and MDM-managed enterprise policies. Settings are merged at runtime with a defined precedence order.

Config file locations

The global settings file applies to every Claude Code session on your machine. Create or edit it at:
Example:
Add "$schema" to get autocomplete and validation in editors that support JSON Schema.
The project-local config file lives inside your project directory and is merged on top of the global config for sessions in that project. It is not committed to version control (add .claude/settings.local.json to .gitignore).
A project-shared settings file can be committed alongside your code. It applies to every team member who opens Claude Code in that project.
CLAUDE.md files contain natural-language instructions that are injected into Claude’s system prompt. Claude Code reads them from:
  • ~/.claude/CLAUDE.md — global instructions for all projects
  • <project-root>/CLAUDE.md — project-level instructions (can be committed)
  • Any subdirectory CLAUDE.md — applied when Claude operates in that subdirectory
Use CLAUDE.md for instructions, conventions, and context that would otherwise need to be repeated in every conversation — for example, coding standards, project architecture notes, or preferred test frameworks.
Enterprise administrators can push settings to all users via MDM (Mobile Device Management) or a managed settings file. These are applied with the highest precedence and cannot be overridden by user or project settings. See MDM-managed settings below.

Key settings

Override the default model Claude Code uses. Accepts a full model ID or a version alias.
Enterprise administrators can restrict which models are available using availableModels:
If availableModels is set to an empty array, only the default model is selectable.
Controls how Claude Code handles tool permission requests. Set via permissions.defaultMode:
You can also define fine-grained allow, deny, and ask rules:
Change the terminal theme with the /theme slash command, or set it in config:
Adjust session transcript retention (days). Set 0 to disable persistence:
Inject environment variables into every Claude Code session:
Run custom shell commands before or after tool executions. See Hooks for full documentation.
Control whether Claude Code adds co-authored-by attribution to commits and PRs:
Setting pr to an empty string removes attribution from PR descriptions. Set includeGitInstructions: false to remove built-in git workflow instructions from Claude’s system prompt.

The /config slash command

Run /config inside a Claude Code session to open the interactive settings UI. From there you can:
  • View your current effective settings (merged from all sources)
  • Change individual settings and see them take effect immediately
  • Switch between the Config and Permissions tabs
The settings UI shows the resolved value for each setting and which source it came from (user, project, managed).

Environment variables

Several environment variables influence Claude Code’s runtime behavior without modifying config files:
Environment variables take effect per-process. To make them permanent, add them to your shell profile or to the env key in settings.json.

MDM-managed settings

Enterprise administrators can distribute settings to managed machines using:
  • macOS MDM — Deploy a configuration profile targeting Claude Code’s bundle ID
  • Managed settings file — Place managed-settings.json in the managed settings path
The managed settings path is platform-dependent. Retrieve it programmatically via the getManagedFilePath() utility, or contact your IT administrator. Managed settings support all keys from the standard settings schema, plus enterprise-only policy keys:

Config precedence

When the same setting is specified in multiple places, the following precedence order applies (highest to lowest):
MDM-managed settings cannot be overridden by users or projects. They are enforced by the enterprise administrator.

Permission model

Understand how Claude Code gates tool usage and requests consent.

Hooks

Run shell commands before and after tool executions.

MCP servers

Connect external tools and data sources via MCP.

Commands reference

Full reference for the /config command.