14* **Project settings** are saved in your project directory:14* **Project settings** are saved in your project directory:
15 * `.claude/settings.json` for settings that are checked into source control and shared with your team15 * `.claude/settings.json` for settings that are checked into source control and shared with your team
16 * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore `.claude/settings.local.json` when it is created.16 * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. Claude Code will configure git to ignore `.claude/settings.local.json` when it is created.
17* For enterprise deployments of Claude Code, we also support **enterprise17* **Managed settings** (Enterprise): Enterprise administrators can configure and distribute Claude Code settings to their organization through the [Claude.ai admin console](https://claude.ai/admin-settings/claude-code). These settings are fetched automatically when users authenticate, take precedence over user and project settings, and cannot be overridden locally. This feature is available to Claude for Enterprise customers. If you don't see this option in your admin console, contact your Anthropic account team to have the feature enabled.
18 managed policy settings**. These take precedence over user and project18
19 settings. System administrators can deploy policies to:19 For organizations that prefer file-based policy distribution, Claude Code also supports `managed-settings.json` and `managed-mcp.json` files that can be deployed to system directories:
20 * macOS: `/Library/Application Support/ClaudeCode/managed-settings.json`20
21 * Linux and WSL: `/etc/claude-code/managed-settings.json`21 * macOS: `/Library/Application Support/ClaudeCode/`
22 * Windows: `C:\ProgramData\ClaudeCode\managed-settings.json`22 * Linux and WSL: `/etc/claude-code/`
23* Enterprise deployments can also configure **managed MCP servers** that override23 * Windows: `C:\Program Files\ClaudeCode\`
24 user-configured servers. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration):24
25 * macOS: `/Library/Application Support/ClaudeCode/managed-mcp.json`25 <Note>
26 * Linux and WSL: `/etc/claude-code/managed-mcp.json`26 These are system-wide paths (not user home directories like `~/Library/...`) that require administrator privileges. They are designed to be deployed by IT administrators.
27 * Windows: `C:\ProgramData\ClaudeCode\managed-mcp.json`27 </Note>
28
29 See [Enterprise managed settings](/en/iam#enterprise-managed-settings) and [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) for details.
30
31 <Note>
32 Enterprise deployments can also restrict **plugin marketplace additions** using
33 `strictKnownMarketplaces`. For more information, see [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions).
34 </Note>
35* **Other configuration** is stored in `~/.claude.json`. This file contains your preferences (theme, notification settings, editor mode), OAuth session, [MCP server](/en/mcp) configurations for user and local scopes, per-project state (allowed tools, trust settings), and various caches. Project-scoped MCP servers are stored separately in `.mcp.json`.
28 36
29```JSON Example settings.json theme={null}37```JSON Example settings.json theme={null}
30{38{
58`settings.json` supports a number of options:66`settings.json` supports a number of options:
59 67
60| Key | Description | Example |68| Key | Description | Example |
61| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |69| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------- |
62| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |70| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |
63| `cleanupPeriodDays` | How long to locally retain chat transcripts based on last activity date (default: 30 days) | `20` |71| `cleanupPeriodDays` | Sessions inactive for longer than this period are deleted at startup. Setting to `0` immediately deletes all sessions. (default: 30 days) | `20` |
64| `companyAnnouncements` | Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random. | `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]` |72| `companyAnnouncements` | Announcement to display to users at startup. If multiple announcements are provided, they will be cycled through at random. | `["Welcome to Acme Corp! Review our code guidelines at docs.acme.com"]` |
65| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |73| `env` | Environment variables that will be applied to every session | `{"FOO": "bar"}` |
66| `includeCoAuthoredBy` | Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |74| `attribution` | Customize attribution for git commits and pull requests. See [Attribution settings](#attribution-settings) | `{"commit": "🤖 Generated with Claude Code", "pr": ""}` |
75| `includeCoAuthoredBy` | **Deprecated**: Use `attribution` instead. Whether to include the `co-authored-by Claude` byline in git commits and pull requests (default: `true`) | `false` |
67| `permissions` | See table below for structure of permissions. | |76| `permissions` | See table below for structure of permissions. | |
68| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](/en/hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |77| `hooks` | Configure custom commands to run before or after tool executions. See [hooks documentation](/en/hooks) | `{"PreToolUse": {"Bash": "echo 'Running command...'"}}` |
69| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |78| `disableAllHooks` | Disable all [hooks](/en/hooks) | `true` |
70| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |79| `model` | Override the default model to use for Claude Code | `"claude-sonnet-4-5-20250929"` |
71| `statusLine` | Configure a custom status line to display context. See [statusLine documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |80| `statusLine` | Configure a custom status line to display context. See [`statusLine` documentation](/en/statusline) | `{"type": "command", "command": "~/.claude/statusline.sh"}` |
81| `fileSuggestion` | Configure a custom script for `@` file autocomplete. See [File suggestion settings](#file-suggestion-settings) | `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` |
72| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](/en/output-styles) | `"Explanatory"` |82| `outputStyle` | Configure an output style to adjust the system prompt. See [output styles documentation](/en/output-styles) | `"Explanatory"` |
73| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |83| `forceLoginMethod` | Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console (API usage billing) accounts | `claudeai` |
74| `forceLoginOrgUUID` | Specify the UUID of an organization to automatically select it during login, bypassing the organization selection step. Requires `forceLoginMethod` to be set | `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` |84| `forceLoginOrgUUID` | Specify the UUID of an organization to automatically select it during login, bypassing the organization selection step. Requires `forceLoginMethod` to be set | `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` |
77| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |87| `disabledMcpjsonServers` | List of specific MCP servers from `.mcp.json` files to reject | `["filesystem"]` |
78| `allowedMcpServers` | When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "github" }]` |88| `allowedMcpServers` | When set in managed-settings.json, allowlist of MCP servers users can configure. Undefined = no restrictions, empty array = lockdown. Applies to all scopes. Denylist takes precedence. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "github" }]` |
79| `deniedMcpServers` | When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including enterprise servers. Denylist takes precedence over allowlist. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "filesystem" }]` |89| `deniedMcpServers` | When set in managed-settings.json, denylist of MCP servers that are explicitly blocked. Applies to all scopes including enterprise servers. Denylist takes precedence over allowlist. See [Enterprise MCP configuration](/en/mcp#enterprise-mcp-configuration) | `[{ "serverName": "filesystem" }]` |
90| `strictKnownMarketplaces` | When set in managed-settings.json, allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Applies to marketplace additions only. See [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions) | `[{ "source": "github", "repo": "company/plugins" }]` |
80| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |91| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |
81| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |92| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |
93| `alwaysThinkingEnabled` | Enable [extended thinking](/en/common-workflows#use-extended-thinking) by default for all sessions. Typically configured via the `/config` command rather than editing directly | `true` |
82 94
83### Permission settings95### Permission settings
84 96
89| `deny` | Array of [permission rules](/en/iam#configuring-permissions) to deny tool use. Use this to also exclude sensitive files from Claude Code access. **Note:** Bash patterns are prefix matches and can be bypassed (see [Bash permission limitations](/en/iam#tool-specific-permission-rules)) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |101| `deny` | Array of [permission rules](/en/iam#configuring-permissions) to deny tool use. Use this to also exclude sensitive files from Claude Code access. **Note:** Bash patterns are prefix matches and can be bypassed (see [Bash permission limitations](/en/iam#tool-specific-permission-rules)) | `[ "WebFetch", "Bash(curl:*)", "Read(./.env)", "Read(./secrets/**)" ]` |
90| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |102| `additionalDirectories` | Additional [working directories](/en/iam#working-directories) that Claude has access to | `[ "../docs/" ]` |
91| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |103| `defaultMode` | Default [permission mode](/en/iam#permission-modes) when opening Claude Code | `"acceptEdits"` |
92| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed policy settings](/en/iam#enterprise-managed-policy-settings) | `"disable"` |104| `disableBypassPermissionsMode` | Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. See [managed settings](/en/iam#enterprise-managed-settings) | `"disable"` |
93 105
94### Sandbox settings106### Sandbox settings
95 107
104| `excludedCommands` | Commands that should run outside of the sandbox | `["git", "docker"]` |116| `excludedCommands` | Commands that should run outside of the sandbox | `["git", "docker"]` |
105| `allowUnsandboxedCommands` | Allow commands to run outside the sandbox via the `dangerouslyDisableSandbox` parameter. When set to `false`, the `dangerouslyDisableSandbox` escape hatch is completely disabled and all commands must run sandboxed (or be in `excludedCommands`). Useful for enterprise policies that require strict sandboxing. Default: true | `false` |117| `allowUnsandboxedCommands` | Allow commands to run outside the sandbox via the `dangerouslyDisableSandbox` parameter. When set to `false`, the `dangerouslyDisableSandbox` escape hatch is completely disabled and all commands must run sandboxed (or be in `excludedCommands`). Useful for enterprise policies that require strict sandboxing. Default: true | `false` |
106| `network.allowUnixSockets` | Unix socket paths accessible in sandbox (for SSH agents, etc.) | `["~/.ssh/agent-socket"]` |118| `network.allowUnixSockets` | Unix socket paths accessible in sandbox (for SSH agents, etc.) | `["~/.ssh/agent-socket"]` |
107| `network.allowLocalBinding` | Allow binding to localhost ports (MacOS only). Default: false | `true` |119| `network.allowLocalBinding` | Allow binding to localhost ports (macOS only). Default: false | `true` |
108| `network.httpProxyPort` | HTTP proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8080` |120| `network.httpProxyPort` | HTTP proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8080` |
109| `network.socksProxyPort` | SOCKS5 proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8081` |121| `network.socksProxyPort` | SOCKS5 proxy port used if you wish to bring your own proxy. If not specified, Claude will run its own proxy. | `8081` |
110| `enableWeakerNestedSandbox` | Enable weaker sandbox for unprivileged Docker environments (Linux only). **Reduces security.** Default: false | `true` |122| `enableWeakerNestedSandbox` | Enable weaker sandbox for unprivileged Docker environments (Linux only). **Reduces security.** Default: false | `true` |
133}145}
134```146```
135 147
136**Filesystem access** is controlled via Read/Edit permissions:148**Filesystem and network restrictions** use standard permission rules:
149
150* Use `Read` deny rules to block Claude from reading specific files or directories
151* Use `Edit` allow rules to let Claude write to directories beyond the current working directory
152* Use `Edit` deny rules to block writes to specific paths
153* Use `WebFetch` allow/deny rules to control which network domains Claude can access
154
155### Attribution settings
156
157Claude Code adds attribution to git commits and pull requests. These are configured separately:
158
159* Commits use [git trailers](https://git-scm.com/docs/git-interpret-trailers) (like `Co-Authored-By`) by default, which can be customized or disabled
160* Pull request descriptions are plain text
161
162| Keys | Description |
163| :------- | :----------------------------------------------------------------------------------------- |
164| `commit` | Attribution for git commits, including any trailers. Empty string hides commit attribution |
165| `pr` | Attribution for pull request descriptions. Empty string hides pull request attribution |
166
167**Default commit attribution:**
168
169```
170🤖 Generated with [Claude Code](https://claude.com/claude-code)
171
172 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
173```
137 174
138* Read deny rules block file reads in sandbox175**Default pull request attribution:**
139* Edit allow rules permit file writes (in addition to the defaults, e.g. the current working directory)
140* Edit deny rules block writes within allowed paths
141 176
142**Network access** is controlled via WebFetch permissions:177```
178🤖 Generated with [Claude Code](https://claude.com/claude-code)
179```
180
181**Example:**
182
183```json theme={null}
184{
185 "attribution": {
186 "commit": "Generated with AI\n\nCo-Authored-By: AI <ai@example.com>",
187 "pr": ""
188 }
189}
190```
191
192<Note>
193 The `attribution` setting takes precedence over the deprecated `includeCoAuthoredBy` setting. To hide all attribution, set `commit` and `pr` to empty strings.
194</Note>
195
196### File suggestion settings
197
198Configure a custom command for `@` file path autocomplete. The built-in file suggestion uses fast filesystem traversal, but large monorepos may benefit from project-specific indexing such as a pre-built file index or custom tooling.
199
200```json theme={null}
201{
202 "fileSuggestion": {
203 "type": "command",
204 "command": "~/.claude/file-suggestion.sh"
205 }
206}
207```
208
209The command runs with the same environment variables as [hooks](/en/hooks), including `CLAUDE_PROJECT_DIR`. It receives JSON via stdin with a `query` field:
210
211```json theme={null}
212{"query": "src/comp"}
213```
214
215Output newline-separated file paths to stdout (currently limited to 15):
216
217```
218src/components/Button.tsx
219src/components/Modal.tsx
220src/components/Form.tsx
221```
143 222
144* WebFetch allow rules permit network domains223**Example:**
145* WebFetch deny rules block network domains224
225```bash theme={null}
226#!/bin/bash
227query=$(cat | jq -r '.query')
228your-repo-file-index --query "$query" | head -20
229```
146 230
147### Settings precedence231### Settings precedence
148 232
149Settings are applied in order of precedence (highest to lowest):233Settings apply in order of precedence. From highest to lowest:
150 234
1511. **Enterprise managed policies** (`managed-settings.json`)2351. **Managed settings** (Enterprise)
152 * Deployed by IT/DevOps236 * Remote settings configured via the [Claude.ai admin console](https://claude.ai/admin-settings/claude-code)
237 * Fetched automatically when users authenticate
153 * Cannot be overridden238 * Cannot be overridden
154 239
1552. **Command line arguments**2402. **File-based managed settings** (`managed-settings.json`)
241 * Policies deployed by IT/DevOps to system directories
242 * Cannot be overridden by user or project settings
243 * Ignored when remote managed settings are configured
244
2453. **Command line arguments**
156 * Temporary overrides for a specific session246 * Temporary overrides for a specific session
157 247
1583. **Local project settings** (`.claude/settings.local.json`)2484. **Local project settings** (`.claude/settings.local.json`)
159 * Personal project-specific settings249 * Personal project-specific settings
160 250
1614. **Shared project settings** (`.claude/settings.json`)2515. **Shared project settings** (`.claude/settings.json`)
162 * Team-shared project settings in source control252 * Team-shared project settings in source control
163 253
1645. **User settings** (`~/.claude/settings.json`)2546. **User settings** (`~/.claude/settings.json`)
165 * Personal global settings255 * Personal global settings
166 256
167This hierarchy ensures that enterprise security policies are always enforced while still allowing teams and individuals to customize their experience.257This hierarchy ensures that enterprise security policies are always enforced while still allowing teams and individuals to customize their experience.
168 258
259For example, if your user settings allow `Bash(npm run:*)` but a project's shared settings deny it, the project setting takes precedence and the command is blocked.
260
169### Key points about the configuration system261### Key points about the configuration system
170 262
171* **Memory files (CLAUDE.md)**: Contain instructions and context that Claude loads at startup263* **Memory files (`CLAUDE.md`)**: Contain instructions and context that Claude loads at startup
172* **Settings files (JSON)**: Configure permissions, environment variables, and tool behavior264* **Settings files (JSON)**: Configure permissions, environment variables, and tool behavior
173* **Slash commands**: Custom commands that can be invoked during a session with `/command-name`265* **Slash commands**: Custom commands that can be invoked during a session with `/command-name`
174* **MCP servers**: Extend Claude Code with additional tools and integrations266* **MCP servers**: Extend Claude Code with additional tools and integrations
175* **Precedence**: Higher-level configurations (Enterprise) override lower-level ones (User/Project)267* **Precedence**: Higher-level configurations (Enterprise) override lower-level ones (User/Project)
176* **Inheritance**: Settings are merged, with more specific settings adding to or overriding broader ones268* **Inheritance**: Settings are merged, with more specific settings adding to or overriding broader ones
177 269
178### System prompt availability270### System prompt
179 271
180<Note>272Claude Code's internal system prompt is not published. To add custom instructions, use `CLAUDE.md` files or the `--append-system-prompt` flag.
181 Unlike for claude.ai, we do not publish Claude Code's internal system prompt on this website. Use CLAUDE.md files or `--append-system-prompt` to add custom instructions to Claude Code's behavior.
182</Note>
183 273
184### Excluding sensitive files274### Excluding sensitive files
185 275
186To prevent Claude Code from accessing files containing sensitive information (e.g., API keys, secrets, environment files), use the `permissions.deny` setting in your `.claude/settings.json` file:276To prevent Claude Code from accessing files containing sensitive information like API keys, secrets, and environment files, use the `permissions.deny` setting in your `.claude/settings.json` file:
187 277
188```json theme={null}278```json theme={null}
189{279{
294* `git`: Any git URL (uses `url`)384* `git`: Any git URL (uses `url`)
295* `directory`: Local filesystem path (uses `path`, for development only)385* `directory`: Local filesystem path (uses `path`, for development only)
296 386
387#### `strictKnownMarketplaces`
388
389**Enterprise-only setting**: Controls which plugin marketplaces users are allowed to add. This setting can only be configured in `managed-settings.json` and provides enterprise administrators with strict control over marketplace sources.
390
391**Managed settings file locations**:
392
393* **macOS**: `/Library/Application Support/ClaudeCode/managed-settings.json`
394* **Linux and WSL**: `/etc/claude-code/managed-settings.json`
395* **Windows**: `C:\ProgramData\ClaudeCode\managed-settings.json`
396
397**Key characteristics**:
398
399* Only available in enterprise managed settings (`managed-settings.json`)
400* Cannot be overridden by user or project settings (highest precedence)
401* Enforced BEFORE network/filesystem operations (blocked sources never execute)
402* Uses exact matching for source specifications (including `ref`, `path` for git sources)
403
404**Allowlist behavior**:
405
406* `undefined` (default): No restrictions - users can add any marketplace
407* Empty array `[]`: Complete lockdown - users cannot add any new marketplaces
408* List of sources: Users can only add marketplaces that match exactly
409
410**All supported source types**:
411
412The allowlist supports six marketplace source types. Each source must match exactly for a user's marketplace addition to be allowed.
413
4141. **GitHub repositories**:
415
416```json theme={null}
417{ "source": "github", "repo": "company/approved-plugins" }
418{ "source": "github", "repo": "company/security-tools", "ref": "v2.0" }
419{ "source": "github", "repo": "team/plugins", "ref": "main", "path": "marketplace" }
420```
421
422Fields: `repo` (required), `ref` (optional: branch/tag/SHA), `path` (optional: subdirectory)
423
4242. **Git repositories**:
425
426```json theme={null}
427{ "source": "git", "url": "https://gitlab.company.com/tools/plugins.git" }
428{ "source": "git", "url": "https://bitbucket.org/company/plugins.git", "ref": "production" }
429{ "source": "git", "url": "ssh://git@internal.company.com/plugins.git", "ref": "v3.1", "path": "approved" }
430```
431
432Fields: `url` (required), `ref` (optional: branch/tag/SHA), `path` (optional: subdirectory)
433
4343. **URL-based marketplaces**:
435
436```json theme={null}
437{ "source": "url", "url": "https://internal.company.com/plugins/marketplace.json" }
438{ "source": "url", "url": "https://cdn.company.com/marketplace.json", "headers": { "Authorization": "Bearer ${TOKEN}" } }
439```
440
441Fields: `url` (required), `headers` (optional: HTTP headers for authenticated access)
442
4434. **NPM packages**:
444
445```json theme={null}
446{ "source": "npm", "package": "@company/claude-plugins" }
447{ "source": "npm", "package": "@company-internal/approved-marketplace" }
448```
449
450Fields: `package` (required, supports scoped packages)
451
4525. **File paths**:
453
454```json theme={null}
455{ "source": "file", "path": "/usr/local/share/claude/company-marketplace.json" }
456{ "source": "file", "path": "/opt/company/plugins/marketplace.json" }
457```
458
459Fields: `path` (required: absolute path to marketplace.json file)
460
4616. **Directory paths**:
462
463```json theme={null}
464{ "source": "directory", "path": "/usr/local/share/claude/company-plugins" }
465{ "source": "directory", "path": "/opt/company/approved-marketplaces" }
466```
467
468Fields: `path` (required: absolute path to directory containing `.claude-plugin/marketplace.json`)
469
470**Configuration examples**:
471
472Example - Allow specific marketplaces only:
473
474```json theme={null}
475{
476 "strictKnownMarketplaces": [
477 {
478 "source": "github",
479 "repo": "company/approved-plugins"
480 },
481 {
482 "source": "github",
483 "repo": "company/security-tools",
484 "ref": "v2.0"
485 },
486 {
487 "source": "url",
488 "url": "https://internal.company.com/plugins/marketplace.json"
489 },
490 {
491 "source": "npm",
492 "package": "@company/compliance-plugins"
493 }
494 ]
495}
496```
497
498Example - Disable all marketplace additions:
499
500```json theme={null}
501{
502 "strictKnownMarketplaces": []
503}
504```
505
506**Exact matching requirements**:
507
508Marketplace sources must match **exactly** for a user's addition to be allowed. For git-based sources (`github` and `git`), this includes all optional fields:
509
510* The `repo` or `url` must match exactly
511* The `ref` field must match exactly (or both be undefined)
512* The `path` field must match exactly (or both be undefined)
513
514Examples of sources that **do NOT match**:
515
516```json theme={null}
517// These are DIFFERENT sources:
518{ "source": "github", "repo": "company/plugins" }
519{ "source": "github", "repo": "company/plugins", "ref": "main" }
520
521// These are also DIFFERENT:
522{ "source": "github", "repo": "company/plugins", "path": "marketplace" }
523{ "source": "github", "repo": "company/plugins" }
524```
525
526**Comparison with `extraKnownMarketplaces`**:
527
528| Aspect | `strictKnownMarketplaces` | `extraKnownMarketplaces` |
529| --------------------- | ------------------------------------ | ------------------------------------ |
530| **Purpose** | Enterprise policy enforcement | Team convenience |
531| **Settings file** | `managed-settings.json` only | Any settings file |
532| **Behavior** | Blocks non-allowlisted additions | Auto-installs missing marketplaces |
533| **When enforced** | Before network/filesystem operations | After user trust prompt |
534| **Can be overridden** | No (highest precedence) | Yes (by higher precedence settings) |
535| **Source format** | Direct source object | Named marketplace with nested source |
536| **Use case** | Compliance, security restrictions | Onboarding, standardization |
537
538**Format difference**:
539
540`strictKnownMarketplaces` uses direct source objects:
541
542```json theme={null}
543{
544 "strictKnownMarketplaces": [
545 { "source": "github", "repo": "company/plugins" }
546 ]
547}
548```
549
550`extraKnownMarketplaces` requires named marketplaces:
551
552```json theme={null}
553{
554 "extraKnownMarketplaces": {
555 "company-tools": {
556 "source": { "source": "github", "repo": "company/plugins" }
557 }
558 }
559}
560```
561
562**Important notes**:
563
564* Restrictions are checked BEFORE any network requests or filesystem operations
565* When blocked, users see clear error messages indicating the source is blocked by enterprise policy
566* The restriction applies only to adding NEW marketplaces; previously installed marketplaces remain accessible
567* Enterprise managed settings have the highest precedence and cannot be overridden
568
569See [Enterprise marketplace restrictions](/en/plugin-marketplaces#enterprise-marketplace-restrictions) for user-facing documentation.
570
297### Managing plugins571### Managing plugins
298 572
299Use the `/plugin` command to manage plugins interactively:573Use the `/plugin` command to manage plugins interactively:
322| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | See [Model configuration](/en/model-config#environment-variables) |596| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | See [Model configuration](/en/model-config#environment-variables) |
323| `ANTHROPIC_DEFAULT_OPUS_MODEL` | See [Model configuration](/en/model-config#environment-variables) |597| `ANTHROPIC_DEFAULT_OPUS_MODEL` | See [Model configuration](/en/model-config#environment-variables) |
324| `ANTHROPIC_DEFAULT_SONNET_MODEL` | See [Model configuration](/en/model-config#environment-variables) |598| `ANTHROPIC_DEFAULT_SONNET_MODEL` | See [Model configuration](/en/model-config#environment-variables) |
599| `ANTHROPIC_FOUNDRY_API_KEY` | API key for Microsoft Foundry authentication (see [Microsoft Foundry](/en/microsoft-foundry)) |
325| `ANTHROPIC_MODEL` | Name of the model setting to use (see [Model Configuration](/en/model-config#environment-variables)) |600| `ANTHROPIC_MODEL` | Name of the model setting to use (see [Model Configuration](/en/model-config#environment-variables)) |
326| `ANTHROPIC_SMALL_FAST_MODEL` | \[DEPRECATED] Name of [Haiku-class model for background tasks](/en/costs) |601| `ANTHROPIC_SMALL_FAST_MODEL` | \[DEPRECATED] Name of [Haiku-class model for background tasks](/en/costs) |
327| `ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION` | Override AWS region for the Haiku-class model when using Bedrock |602| `ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION` | Override AWS region for the Haiku-class model when using Bedrock |
334| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |609| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |
335| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |610| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) |
336| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |611| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |
612| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers |
337| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |613| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |
338| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |614| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |
339| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |615| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |
340| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |616| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |
341| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (e.g. when using an LLM gateway) |617| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |
342| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Skip Google authentication for Vertex (e.g. when using an LLM gateway) |618| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) |
619| `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` | Skip Azure authentication for Microsoft Foundry (for example, when using an LLM gateway) |
620| `CLAUDE_CODE_SKIP_VERTEX_AUTH` | Skip Google authentication for Vertex (for example, when using an LLM gateway) |
343| `CLAUDE_CODE_SUBAGENT_MODEL` | See [Model configuration](/en/model-config) |621| `CLAUDE_CODE_SUBAGENT_MODEL` | See [Model configuration](/en/model-config) |
344| `CLAUDE_CODE_USE_BEDROCK` | Use [Bedrock](/en/amazon-bedrock) |622| `CLAUDE_CODE_USE_BEDROCK` | Use [Bedrock](/en/amazon-bedrock) |
623| `CLAUDE_CODE_USE_FOUNDRY` | Use [Microsoft Foundry](/en/microsoft-foundry) |
345| `CLAUDE_CODE_USE_VERTEX` | Use [Vertex](/en/google-vertex-ai) |624| `CLAUDE_CODE_USE_VERTEX` | Use [Vertex](/en/google-vertex-ai) |
625| `CLAUDE_CONFIG_DIR` | Customize where Claude Code stores its configuration and data files |
346| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic updates. |626| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic updates. |
347| `DISABLE_BUG_COMMAND` | Set to `1` to disable the `/bug` command |627| `DISABLE_BUG_COMMAND` | Set to `1` to disable the `/bug` command |
348| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |628| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |
361| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |641| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |
362| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |642| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |
363| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for slash command metadata shown to [SlashCommand tool](/en/slash-commands#slashcommand-tool) (default: 15000) |643| `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Maximum number of characters for slash command metadata shown to [SlashCommand tool](/en/slash-commands#slashcommand-tool) (default: 15000) |
364| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` intead of `rg` included with Claude Code |644| `USE_BUILTIN_RIPGREP` | Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code |
365| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |645| `VERTEX_REGION_CLAUDE_3_5_HAIKU` | Override region for Claude 3.5 Haiku when using Vertex AI |
366| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |646| `VERTEX_REGION_CLAUDE_3_7_SONNET` | Override region for Claude 3.7 Sonnet when using Vertex AI |
367| `VERTEX_REGION_CLAUDE_4_0_OPUS` | Override region for Claude 4.0 Opus when using Vertex AI |647| `VERTEX_REGION_CLAUDE_4_0_OPUS` | Override region for Claude 4.0 Opus when using Vertex AI |
373Claude Code has access to a set of powerful tools that help it understand and modify your codebase:653Claude Code has access to a set of powerful tools that help it understand and modify your codebase:
374 654
375| Tool | Description | Permission Required |655| Tool | Description | Permission Required |
376| :--------------- | :------------------------------------------------------------------ | :------------------ |656| :------------------ | :------------------------------------------------------------------------------------------------ | :------------------ |
377| **Bash** | Executes shell commands in your environment | Yes |657| **AskUserQuestion** | Asks the user multiple choice questions to gather information or clarify ambiguity | No |
658| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |
659| **BashOutput** | Retrieves output from a background bash shell | No |
378| **Edit** | Makes targeted edits to specific files | Yes |660| **Edit** | Makes targeted edits to specific files | Yes |
661| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |
379| **Glob** | Finds files based on pattern matching | No |662| **Glob** | Finds files based on pattern matching | No |
380| **Grep** | Searches for patterns in file contents | No |663| **Grep** | Searches for patterns in file contents | No |
664| **KillShell** | Kills a running background bash shell by its ID | No |
381| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |665| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |
382| **NotebookRead** | Reads and displays Jupyter notebook contents | No |
383| **Read** | Reads the contents of files | No |666| **Read** | Reads the contents of files | No |
667| **Skill** | Executes a skill within the main conversation | Yes |
384| **SlashCommand** | Runs a [custom slash command](/en/slash-commands#slashcommand-tool) | Yes |668| **SlashCommand** | Runs a [custom slash command](/en/slash-commands#slashcommand-tool) | Yes |
385| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |669| **Task** | Runs a sub-agent to handle complex, multi-step tasks | No |
386| **TodoWrite** | Creates and manages structured task lists | No |670| **TodoWrite** | Creates and manages structured task lists | No |
390 674
391Permission rules can be configured using `/allowed-tools` or in [permission settings](/en/settings#available-settings). Also see [Tool-specific permission rules](/en/iam#tool-specific-permission-rules).675Permission rules can be configured using `/allowed-tools` or in [permission settings](/en/settings#available-settings). Also see [Tool-specific permission rules](/en/iam#tool-specific-permission-rules).
392 676
677### Bash tool behavior
678
679The Bash tool executes shell commands with the following persistence behavior:
680
681* **Working directory persists**: When Claude changes the working directory (for example, `cd /path/to/dir`), subsequent Bash commands will execute in that directory. You can use `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1` to reset to the project directory after each command.
682* **Environment variables do NOT persist**: Environment variables set in one Bash command (for example, `export MY_VAR=value`) are **not** available in subsequent Bash commands. Each Bash command runs in a fresh shell environment.
683
684To make environment variables available in Bash commands, you have **three options**:
685
686**Option 1: Activate environment before starting Claude Code** (simplest approach)
687
688Activate your virtual environment in your terminal before launching Claude Code:
689
690```bash theme={null}
691conda activate myenv
692# or: source /path/to/venv/bin/activate
693claude
694```
695
696This works for shell environments but environment variables set within Claude's Bash commands will not persist between commands.
697
698**Option 2: Set CLAUDE\_ENV\_FILE before starting Claude Code** (persistent environment setup)
699
700Export the path to a shell script containing your environment setup:
701
702```bash theme={null}
703export CLAUDE_ENV_FILE=/path/to/env-setup.sh
704claude
705```
706
707Where `/path/to/env-setup.sh` contains:
708
709```bash theme={null}
710conda activate myenv
711# or: source /path/to/venv/bin/activate
712# or: export MY_VAR=value
713```
714
715Claude Code will source this file before each Bash command, making the environment persistent across all commands.
716
717**Option 3: Use a SessionStart hook** (project-specific configuration)
718
719Configure in `.claude/settings.json`:
720
721```json theme={null}
722{
723 "hooks": {
724 "SessionStart": [{
725 "matcher": "startup",
726 "hooks": [{
727 "type": "command",
728 "command": "echo 'conda activate myenv' >> \"$CLAUDE_ENV_FILE\""
729 }]
730 }]
731 }
732}
733```
734
735The hook writes to `$CLAUDE_ENV_FILE`, which is then sourced before each Bash command. This is ideal for team-shared project configurations.
736
737See [SessionStart hooks](/en/hooks#persisting-environment-variables) for more details on Option 3.
738
393### Extending tools with hooks739### Extending tools with hooks
394 740
395You can run custom commands before or after any tool executes using741You can run custom commands before or after any tool executes using
402## See also748## See also
403 749
404* [Identity and Access Management](/en/iam#configuring-permissions) - Learn about Claude Code's permission system750* [Identity and Access Management](/en/iam#configuring-permissions) - Learn about Claude Code's permission system
405* [IAM and access control](/en/iam#enterprise-managed-policy-settings) - Enterprise policy management751* [IAM and access control](/en/iam#enterprise-managed-settings) - Enterprise policy management
406* [Troubleshooting](/en/troubleshooting#auto-updater-issues) - Solutions for common configuration issues752* [Troubleshooting](/en/troubleshooting#auto-updater-issues) - Solutions for common configuration issues
753
754
755---
756
757> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://code.claude.com/docs/llms.txt