Initial commit to new repository

This commit is contained in:
2026-04-03 18:23:52 +09:00
commit deffb33cf9
5248 changed files with 267762 additions and 0 deletions

View File

@@ -0,0 +1,209 @@
> ## Documentation Index
> Fetch the complete documentation index at: https://vineetagarwal-code-claude-code.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.
# CLAUDE.md
> How to write and organize CLAUDE.md files to give Claude persistent, project-specific instructions.
`CLAUDE.md` files let you encode project knowledge that Claude loads at the start of every session. Instead of explaining your project's conventions, build system, and architecture every time, you write them once and Claude reads them automatically.
## What belongs in CLAUDE.md
Write instructions that would cause mistakes if missing. Everything else is noise.
**Include:**
* Build, test, and lint commands (exact invocations, not just tool names)
* Architecture decisions that affect how code should be written or organized
* Coding conventions specific to your project (naming patterns, file structure rules)
* Environment setup requirements (required env vars, expected services)
* Common pitfalls or patterns Claude should know to avoid
* Monorepo structure and which packages own which responsibilities
**Omit:**
* Things Claude already knows (standard TypeScript syntax, common library APIs)
* Obvious reminders ("write clean code", "add comments")
* Sensitive data — API keys, passwords, tokens, or secrets of any kind
* Information that changes frequently and will become stale
<Tip>
The test: would removing this line cause Claude to make a mistake on your codebase? If not, cut it.
</Tip>
## File locations
Claude discovers memory files by traversing from your current directory up to the filesystem root. Files closer to your current directory have higher priority (they are loaded later, so the model pays more attention to them).
| File | Type | Purpose |
| ----------------------------------- | ------- | ------------------------------------------------------------- |
| `/etc/claude-code/CLAUDE.md` | Managed | System-wide instructions for all users, set by administrators |
| `~/.claude/CLAUDE.md` | User | Your personal global instructions, applied to every project |
| `~/.claude/rules/*.md` | User | Modular global rules, each file loaded separately |
| `CLAUDE.md` (project root) | Project | Shared team instructions, checked into source control |
| `.claude/CLAUDE.md` (project root) | Project | Alternative location for shared project instructions |
| `.claude/rules/*.md` (project root) | Project | Modular project rules, organized by topic |
| `CLAUDE.local.md` (project root) | Local | Your private project-specific instructions, not checked in |
<Note>
`.claude/rules/` directories support subdirectories. All `.md` files found recursively are loaded as separate memory entries.
</Note>
## Loading order and priority
Files are loaded in the following order. Because the model attends more to content that appears later in context, later files have higher effective priority.
<Steps>
<Step title="Managed memory">
`/etc/claude-code/CLAUDE.md` and `/etc/claude-code/rules/*.md` — global policy set by administrators. Always loaded; cannot be excluded by users.
</Step>
<Step title="User memory">
`~/.claude/CLAUDE.md` and `~/.claude/rules/*.md` — your personal global instructions for all projects.
</Step>
<Step title="Project memory (root-to-CWD)">
`CLAUDE.md`, `.claude/CLAUDE.md`, and `.claude/rules/*.md` files in each directory from the filesystem root down to your current directory. Files in directories closer to your CWD are loaded later (higher priority).
</Step>
<Step title="Local memory">
`CLAUDE.local.md` in each directory from root to CWD. Same traversal order. Gitignored by default.
</Step>
</Steps>
## The @include directive
Memory files can include other files using `@` notation. Included files are processed recursively and inserted before the file that references them.
```markdown theme={null}
# CLAUDE.md
@./docs/architecture.md
@~/shared/style-guide.md
@/etc/company-standards.md
```
**Supported path formats:**
| Syntax | Resolves to |
| ------------------ | ---------------------------------------------------------------- |
| `@filename` | Relative to the current file's directory (same as `@./filename`) |
| `@./relative/path` | Relative to the current file's directory |
| `@~/path/in/home` | Path under your home directory |
| `@/absolute/path` | Absolute filesystem path |
**Behavior:**
* Paths with a fragment (`#heading`) have the fragment stripped before resolving
* Non-existent files are silently ignored
* Circular references are detected and prevented
* Includes nest up to 5 levels deep
* Only text file formats are supported — binary files (images, PDFs) are skipped
* `@include` inside code blocks is not processed
<Warning>
External includes (files outside the project directory) require explicit approval the first time they are loaded. Claude will prompt you to confirm before fetching content from outside your project.
</Warning>
## Frontmatter path targeting
Files in `.claude/rules/` can use YAML frontmatter to restrict which file paths they apply to. This lets you load rules conditionally based on the file Claude is working with.
```markdown theme={null}
---
paths:
- "src/api/**"
- "*.graphql"
---
# API conventions
All API handlers must validate input using the shared `validate()` helper.
GraphQL resolvers must not perform direct database queries — use the data layer.
```
Rules without frontmatter apply unconditionally. Rules with `paths` frontmatter only apply when Claude is working in files matching the glob patterns.
## Example CLAUDE.md for a TypeScript project
```markdown theme={null}
# Project: Payments API
## Build and test
- Build: `bun run build`
- Tests: `bun test` (uses Bun's built-in test runner — do not use Jest)
- Lint: `bun run lint` (biome, not eslint)
- Type check: `bun run typecheck`
Always run `bun run typecheck` before considering a change complete.
## Architecture
- `src/handlers/` — HTTP handlers, one file per route group
- `src/services/` — Business logic, no direct DB access
- `src/db/` — Database layer (Drizzle ORM); all queries live here
- `src/schemas/` — Zod schemas shared between handler validation and DB types
Handlers call services. Services call the DB layer. Never skip layers.
## Conventions
- Use `z.object().strict()` for all input validation schemas
- Errors propagate as `Result<T, AppError>` — never throw in service code
- All monetary values are integers in cents
- Timestamps are Unix seconds (number), not Date objects
## Environment
Required env vars: `DATABASE_URL`, `STRIPE_SECRET_KEY`, `JWT_SECRET`
Local dev: copy `.env.example` to `.env.local` and fill in values
## Common mistakes to avoid
- Do not use `new Date()` directly — use `getCurrentTimestamp()` from `src/utils/time.ts`
- Do not add `console.log` — use the `logger` from `src/utils/logger.ts`
- Do not write raw SQL — use the Drizzle query builder
```
## Generating CLAUDE.md with /init
Run `/init` in any Claude Code session to automatically generate a `CLAUDE.md` for your project. Claude analyzes your codebase and produces a file containing the commands and context most relevant to the project.
```
/init
```
The generated file is a starting point. Review it, trim anything that isn't genuinely useful, and add project-specific knowledge that Claude couldn't infer from the code.
## Editing CLAUDE.md with /memory
Run `/memory` to open the memory editor, which lists all currently loaded memory files and lets you edit them directly within the session.
```
/memory
```
Changes take effect immediately — Claude reloads the updated file and applies the new instructions to the current session.
## Excluding files
If you have CLAUDE.md files you want to prevent Claude from loading (for example, in vendored dependencies or generated code), add exclusion patterns to your settings:
```json theme={null}
{
"claudeMdExcludes": [
"/absolute/path/to/vendor/CLAUDE.md",
"**/generated/**",
"**/third-party/.claude/rules/**"
]
}
```
Patterns are matched against absolute paths using picomatch. Only User, Project, and Local memory types can be excluded — Managed (administrator) files are always loaded.
See [Settings](/configuration/settings) for full documentation on the `claudeMdExcludes` option.
Built with [Mintlify](https://mintlify.com).

View File

@@ -0,0 +1,261 @@
> ## Documentation Index
> Fetch the complete documentation index at: https://vineetagarwal-code-claude-code.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.
# Environment variables
> Environment variables that Claude Code reads to configure authentication, API access, behavior, and runtime options.
Claude Code reads environment variables at startup. These variables let you configure authentication, point to custom API endpoints, tune runtime behavior, and control which features are active — without modifying settings files.
## Authentication
<ParamField path="ANTHROPIC_API_KEY" type="string">
API key for authenticating directly with the Anthropic API. When set, Claude Code uses this key instead of (or in addition to) OAuth credentials. Takes priority over OAuth when present in most contexts.
```bash theme={null}
export ANTHROPIC_API_KEY="sk-ant-..."
```
</ParamField>
<ParamField path="ANTHROPIC_AUTH_TOKEN" type="string">
Alternative authentication token. Used in contexts where `ANTHROPIC_API_KEY` is not applicable.
</ParamField>
<ParamField path="ANTHROPIC_BASE_URL" type="string">
Override the Anthropic API base URL. Useful for pointing Claude Code at a proxy, staging environment, or compatible third-party endpoint.
```bash theme={null}
export ANTHROPIC_BASE_URL="https://my-proxy.example.com"
```
</ParamField>
<ParamField path="CLAUDE_CODE_API_BASE_URL" type="string">
Claude Code-specific API base URL override. Takes precedence over `ANTHROPIC_BASE_URL` when set.
</ParamField>
<ParamField path="ANTHROPIC_BEDROCK_BASE_URL" type="string">
Base URL for AWS Bedrock API access. Set this when routing Claude Code through a Bedrock endpoint.
</ParamField>
<ParamField path="ANTHROPIC_VERTEX_PROJECT_ID" type="string">
Google Cloud project ID for Vertex AI access. Required when using Claude Code through Google Cloud's Vertex AI platform.
</ParamField>
<ParamField path="CLAUDE_CODE_USE_BEDROCK" type="string">
Set to `1` or `true` to use AWS Bedrock as the API provider.
</ParamField>
<ParamField path="CLAUDE_CODE_USE_FOUNDRY" type="string">
Set to `1` or `true` to use Anthropic Foundry as the API provider.
</ParamField>
<ParamField path="CLAUDE_CODE_OAUTH_TOKEN" type="string">
OAuth access token to use for authentication directly, bypassing the interactive login flow. Useful for automated environments.
</ParamField>
## Configuration paths
<ParamField path="CLAUDE_CONFIG_DIR" type="string" default="~/.claude">
Override the directory where Claude Code stores its configuration, settings, and transcripts. Defaults to `~/.claude` in your home directory.
```bash theme={null}
export CLAUDE_CONFIG_DIR="/opt/claude-config"
```
</ParamField>
<ParamField path="CLAUDE_CODE_MANAGED_SETTINGS_PATH" type="string">
Override the path to the managed settings file. Useful in enterprise environments where the default platform path is not appropriate.
</ParamField>
## Model selection
<ParamField path="ANTHROPIC_MODEL" type="string">
Default model to use. Overridden by the `model` setting in settings files and by explicit `--model` flags.
</ParamField>
<ParamField path="CLAUDE_CODE_SUBAGENT_MODEL" type="string">
Model to use for sub-agent tasks spawned by the main agent. When not set, sub-agents use the same model as the main session.
</ParamField>
<ParamField path="CLAUDE_CODE_AUTO_MODE_MODEL" type="string">
Model to use when running in auto mode. Defaults to the main session model when not specified.
</ParamField>
## Behavior toggles
<ParamField path="CLAUDE_CODE_REMOTE" type="string">
Set to `1` or `true` to enable remote/container mode. In this mode, Claude Code adjusts its behavior for non-interactive environments — extended API timeouts (120s vs. 300s), suppressed interactive prompts, and adapted output formatting.
```bash theme={null}
export CLAUDE_CODE_REMOTE=1
```
</ParamField>
<ParamField path="CLAUDE_CODE_SIMPLE" type="string">
Set to `1` or `true` (or pass `--bare`) to run in bare mode. Bare mode skips hooks, LSP integration, plugin sync, skill directory walks, attribution, background prefetches, and all keychain/credential reads. Authentication must be provided via `ANTHROPIC_API_KEY` or `apiKeyHelper` in `--settings`. Useful for lightweight scripted use.
</ParamField>
<ParamField path="DISABLE_AUTO_COMPACT" type="string">
Set to `1` or `true` to disable automatic context compaction. When set, Claude Code will not compact the conversation context even when it approaches the model's context limit.
```bash theme={null}
export DISABLE_AUTO_COMPACT=1
```
</ParamField>
<ParamField path="CLAUDE_CODE_DISABLE_BACKGROUND_TASKS" type="boolean">
Set to `1` or `true` to disable background task execution. When enabled, the `run_in_background` parameter is removed from Bash and PowerShell tools, and Claude cannot run shell commands as background processes.
</ParamField>
<ParamField path="CLAUDE_CODE_DISABLE_THINKING" type="string">
Set to `1` or `true` to disable extended thinking for all API calls, regardless of model support.
</ParamField>
<ParamField path="CLAUDE_CODE_DISABLE_AUTO_MEMORY" type="string">
Set to `1` or `true` to disable automatic memory. When disabled, Claude does not read from or write to the auto-memory directory. Set to `0` or `false` to explicitly enable it (useful when other conditions would disable it, such as bare mode).
Auto-memory is also disabled automatically in bare mode (`CLAUDE_CODE_SIMPLE`) and remote mode (`CLAUDE_CODE_REMOTE`) unless explicitly enabled.
</ParamField>
<ParamField path="CLAUDE_CODE_DISABLE_CLAUDE_MDS" type="string">
Set to `1` or `true` to completely disable loading of all `CLAUDE.md` memory files. Claude will not read any CLAUDE.md, CLAUDE.local.md, or `.claude/rules/*.md` files.
</ParamField>
<ParamField path="CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" type="string">
Set to `1` or `true` to suppress analytics, telemetry, and other non-essential network requests.
</ParamField>
<ParamField path="CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD" type="string">
Set to `1` or `true` to load `CLAUDE.md` files from directories added via `--add-dir`. By default, additional directories do not have their CLAUDE.md files loaded.
</ParamField>
<ParamField path="CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR" type="string">
Set to `1` or `true` to reset the working directory back to the original project root after each Bash command. Prevents one command from changing the CWD for subsequent commands.
</ParamField>
## Resource limits
<ParamField path="CLAUDE_CODE_MAX_OUTPUT_TOKENS" type="number">
Override the maximum number of output tokens per API response. When not set, Claude Code uses the model's default maximum. Useful for controlling costs in automated workflows.
```bash theme={null}
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=4096
```
</ParamField>
<ParamField path="CLAUDE_CODE_MAX_CONTEXT_TOKENS" type="number">
Override the maximum context window size. When set, Claude Code uses this value instead of the model's reported context limit.
</ParamField>
<ParamField path="BASH_MAX_OUTPUT_LENGTH" type="number">
Maximum number of characters captured from Bash command output. Output exceeding this limit is truncated. Useful for preventing very large command outputs from consuming context.
```bash theme={null}
export BASH_MAX_OUTPUT_LENGTH=50000
```
</ParamField>
<ParamField path="API_TIMEOUT_MS" type="number">
Override the API request timeout in milliseconds. Defaults to 300,000ms (5 minutes) for standard mode and 120,000ms (2 minutes) in remote mode.
```bash theme={null}
export API_TIMEOUT_MS=60000
```
</ParamField>
## Telemetry and observability
<ParamField path="CLAUDE_CODE_ENABLE_TELEMETRY" type="string">
Set to `1` or `true` to enable OpenTelemetry export of traces, metrics, and logs. Requires additional OTEL configuration (endpoint, headers, etc.) to be set via standard OpenTelemetry environment variables.
```bash theme={null}
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.example.com"
```
</ParamField>
<ParamField path="CLAUDE_CODE_JSONL_TRANSCRIPT" type="string">
Path to a file where Claude Code writes a JSONL transcript of the session. Each line is a JSON object representing a conversation event.
```bash theme={null}
export CLAUDE_CODE_JSONL_TRANSCRIPT="/tmp/session.jsonl"
```
</ParamField>
## Node.js runtime
<ParamField path="NODE_OPTIONS" type="string">
Standard Node.js options passed to the runtime. Claude Code reads this to detect flags like `--max-old-space-size` and adjusts its behavior accordingly. Claude Code itself sets this internally to configure heap size for large sessions.
```bash theme={null}
export NODE_OPTIONS="--max-old-space-size=4096"
```
<Warning>
Avoid setting `NODE_OPTIONS` to values that include code execution flags. Claude Code validates shell environments and treats some `NODE_OPTIONS` values as requiring confirmation before running Bash commands.
</Warning>
</ParamField>
## Host platform override
<ParamField path="CLAUDE_CODE_HOST_PLATFORM" type="string">
Override the reported host platform for analytics. Accepts `"win32"`, `"darwin"`, or `"linux"`. Useful when Claude Code runs in a container (where `process.platform` reports the container OS) but the actual host platform differs.
```bash theme={null}
export CLAUDE_CODE_HOST_PLATFORM=darwin
```
</ParamField>
## Cloud provider region overrides
Claude Code supports per-model Vertex AI region overrides. Set the corresponding environment variable to route a specific model to a different region.
| Model prefix | Environment variable |
| ------------------- | --------------------------------- |
| `claude-haiku-4-5` | `VERTEX_REGION_CLAUDE_HAIKU_4_5` |
| `claude-3-5-haiku` | `VERTEX_REGION_CLAUDE_3_5_HAIKU` |
| `claude-3-5-sonnet` | `VERTEX_REGION_CLAUDE_3_5_SONNET` |
| `claude-3-7-sonnet` | `VERTEX_REGION_CLAUDE_3_7_SONNET` |
| `claude-opus-4-1` | `VERTEX_REGION_CLAUDE_4_1_OPUS` |
| `claude-opus-4` | `VERTEX_REGION_CLAUDE_4_0_OPUS` |
| `claude-sonnet-4-6` | `VERTEX_REGION_CLAUDE_4_6_SONNET` |
| `claude-sonnet-4-5` | `VERTEX_REGION_CLAUDE_4_5_SONNET` |
| `claude-sonnet-4` | `VERTEX_REGION_CLAUDE_4_0_SONNET` |
```bash theme={null}
# Route Opus 4 to a specific Vertex region
export VERTEX_REGION_CLAUDE_4_0_OPUS="us-central1"
```
The default Vertex region is controlled by `CLOUD_ML_REGION` (defaults to `us-east5`).
## AWS credentials
For Bedrock access, Claude Code respects standard AWS credential environment variables:
<ParamField path="AWS_REGION" type="string">
AWS region for Bedrock API calls. Falls back to `AWS_DEFAULT_REGION`, then defaults to `us-east-1`.
</ParamField>
<ParamField path="AWS_DEFAULT_REGION" type="string">
Fallback AWS region when `AWS_REGION` is not set.
</ParamField>
## Setting environment variables for all sessions
You can set environment variables that apply to every Claude Code session using the `env` field in your settings file, rather than setting them in your shell profile:
```json theme={null}
{
"env": {
"DISABLE_AUTO_COMPACT": "1",
"BASH_MAX_OUTPUT_LENGTH": "30000"
}
}
```
See [Settings](/configuration/settings) for documentation on the `env` field.
Built with [Mintlify](https://mintlify.com).

View File

@@ -0,0 +1,439 @@
> ## Documentation Index
> Fetch the complete documentation index at: https://vineetagarwal-code-claude-code.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.
# Settings
> Configure Claude Code behavior through JSON settings files at the user, project, and managed levels.
Claude Code reads settings from JSON files at multiple scopes. Settings merge from lowest to highest priority, so more specific scopes override broader ones.
## Settings files
<Tabs>
<Tab title="Global (user)">
**Location:** `~/.claude/settings.json`
Applies to every Claude Code session you run, across all projects. This is where you set personal preferences like your preferred model, theme, and cleanup policy.
```json theme={null}
{
"model": "claude-opus-4-5",
"cleanupPeriodDays": 30,
"permissions": {
"defaultMode": "acceptEdits"
}
}
```
</Tab>
<Tab title="Project (shared)">
**Location:** `.claude/settings.json` in your project root
Checked into source control. Use this for settings that should apply to everyone working on the project — permission rules, hook configurations, MCP servers, and environment variables.
```json theme={null}
{
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git *)"],
"deny": ["Bash(rm -rf *)"]
},
"hooks": {
"PostToolUse": [
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "npm run lint" }]
}
]
}
}
```
</Tab>
<Tab title="Local (personal project)">
**Location:** `.claude/settings.local.json` in your project root
Not checked into source control (automatically added to `.gitignore`). Use this for personal overrides within a specific project — your own permission preferences or environment variables that shouldn't be shared.
```json theme={null}
{
"permissions": {
"defaultMode": "bypassPermissions"
}
}
```
</Tab>
<Tab title="Managed (enterprise)">
**Location:** Platform-specific system path
Set by administrators via MDM, registry (Windows), plist (macOS), or a managed settings file. Managed settings take highest priority and cannot be overridden by users or projects.
See [Managed settings](#managed-settings-enterprise) below for details.
</Tab>
</Tabs>
## Opening settings
Run `/config` inside any Claude Code session to open the settings UI. This opens the **Config** tab of the settings panel, where you can browse and edit the currently active settings for each scope.
You can also edit the JSON files directly. Claude Code reloads settings automatically when it detects file changes.
## Settings precedence
Settings merge from lowest to highest priority. Later sources override earlier ones for scalar values; arrays are concatenated and deduplicated.
```
Plugin defaults → User settings → Project settings → Local settings → Managed (policy) settings
```
<Note>
Managed (policy) settings always take final precedence. An administrator setting `permissions.defaultMode` to `"default"` cannot be overridden by users or project files.
</Note>
## Settings reference
<AccordionGroup>
<Accordion title="model">
**Type:** `string` | **Scope:** Any
Override the default model used by Claude Code. Accepts any model ID supported by your configured provider.
```json theme={null}
{ "model": "claude-opus-4-5" }
```
</Accordion>
<Accordion title="permissions">
**Type:** `object` | **Scope:** Any
Controls which tools Claude can use and in what mode. See [Permissions](/concepts/permissions) for full documentation on rule syntax.
| Field | Type | Description |
| ------------------------------ | ----------- | ----------------------------------------------------------------------------------------- |
| `allow` | `string[]` | Rules for operations Claude may perform without asking |
| `deny` | `string[]` | Rules for operations Claude is always blocked from |
| `ask` | `string[]` | Rules for operations that always prompt for confirmation |
| `defaultMode` | `string` | Default permission mode: `"default"`, `"acceptEdits"`, `"plan"`, or `"bypassPermissions"` |
| `disableBypassPermissionsMode` | `"disable"` | Prevent users from entering bypass permissions mode |
| `additionalDirectories` | `string[]` | Extra directories Claude may access |
```json theme={null}
{
"permissions": {
"defaultMode": "acceptEdits",
"allow": ["Bash(npm run *)", "Bash(git log *)"],
"deny": ["Bash(curl *)"]
}
}
```
</Accordion>
<Accordion title="hooks">
**Type:** `object` | **Scope:** Any
Run custom shell commands before or after tool executions. See [Hooks](/guides/hooks) for full documentation.
Supported hook events: `PreToolUse`, `PostToolUse`, `Notification`, `UserPromptSubmit`, `SessionStart`, `SessionEnd`, `Stop`, `SubagentStop`, `PreCompact`, `PostCompact`.
```json theme={null}
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "prettier --write $CLAUDE_FILE_PATHS" }]
}
]
}
}
```
</Accordion>
<Accordion title="cleanupPeriodDays">
**Type:** `integer` (non-negative) | **Default:** `30` | **Scope:** Any
Number of days to retain chat transcripts. Setting to `0` disables session persistence entirely — no transcripts are written and existing ones are deleted at startup.
```json theme={null}
{ "cleanupPeriodDays": 7 }
```
</Accordion>
<Accordion title="env">
**Type:** `object` | **Scope:** Any
Environment variables to inject into every Claude Code session. Values are coerced to strings.
```json theme={null}
{
"env": {
"NODE_ENV": "development",
"MY_API_URL": "https://api.example.com"
}
}
```
</Accordion>
<Accordion title="availableModels">
**Type:** `string[]` | **Scope:** Managed
Enterprise allowlist of models users can select. Accepts family aliases (`"opus"` allows any Opus version), version prefixes, or full model IDs. If `undefined`, all models are available. If an empty array, only the default model is available.
```json theme={null}
{ "availableModels": ["claude-opus-4-5", "claude-sonnet-4"] }
```
</Accordion>
<Accordion title="allowedMcpServers / deniedMcpServers">
**Type:** `object[]` | **Scope:** Any
Enterprise allowlist and denylist for MCP servers. Each entry must have exactly one of `serverName`, `serverCommand`, or `serverUrl`. The denylist takes precedence — if a server matches both lists, it is blocked.
```json theme={null}
{
"allowedMcpServers": [
{ "serverName": "my-db-server" },
{ "serverUrl": "https://mcp.example.com/*" }
],
"deniedMcpServers": [
{ "serverCommand": ["npx", "malicious-server"] }
]
}
```
</Accordion>
<Accordion title="worktree">
**Type:** `object` | **Scope:** Any
Configuration for `--worktree` flag behavior.
| Field | Type | Description |
| -------------------- | ---------- | --------------------------------------------------------------------------------- |
| `symlinkDirectories` | `string[]` | Directories to symlink from the main repo into worktrees (e.g., `"node_modules"`) |
| `sparsePaths` | `string[]` | Paths to check out in sparse mode, for faster worktrees in large monorepos |
```json theme={null}
{
"worktree": {
"symlinkDirectories": ["node_modules", ".cache"],
"sparsePaths": ["src/", "packages/my-service/"]
}
}
```
</Accordion>
<Accordion title="attribution">
**Type:** `object` | **Scope:** Any
Customize the attribution text Claude appends to commits and pull request descriptions.
| Field | Type | Description |
| -------- | -------- | -------------------------------------------------------------------------------- |
| `commit` | `string` | Attribution text (including any git trailers). Empty string removes attribution. |
| `pr` | `string` | Attribution text for PR descriptions. Empty string removes attribution. |
```json theme={null}
{
"attribution": {
"commit": "Co-Authored-By: Claude <noreply@anthropic.com>",
"pr": ""
}
}
```
</Accordion>
<Accordion title="language">
**Type:** `string` | **Scope:** Any
Preferred language for Claude responses and voice dictation. Accepts plain language names.
```json theme={null}
{ "language": "japanese" }
```
</Accordion>
<Accordion title="sandbox">
**Type:** `object` | **Scope:** Any
Sandbox configuration for isolating Claude's tool executions. Contact your administrator for sandbox setup details.
</Accordion>
<Accordion title="alwaysThinkingEnabled">
**Type:** `boolean` | **Default:** `true` | **Scope:** Any
When `false`, extended thinking is disabled. When absent or `true`, thinking is enabled automatically for models that support it.
```json theme={null}
{ "alwaysThinkingEnabled": false }
```
</Accordion>
<Accordion title="effortLevel">
**Type:** `"low" | "medium" | "high"` | **Scope:** Any
Persisted effort level for models that support adjustable thinking budgets.
```json theme={null}
{ "effortLevel": "high" }
```
</Accordion>
<Accordion title="autoMemoryEnabled">
**Type:** `boolean` | **Scope:** User, local
Enable or disable auto-memory for this project. When `false`, Claude does not read from or write to the auto-memory directory.
```json theme={null}
{ "autoMemoryEnabled": false }
```
</Accordion>
<Accordion title="autoMemoryDirectory">
**Type:** `string` | **Scope:** User, local
Custom path for auto-memory storage. Supports `~/` for home directory expansion. Ignored if set in project settings (`.claude/settings.json`) for security reasons. Defaults to `~/.claude/projects/<sanitized-cwd>/memory/`.
```json theme={null}
{ "autoMemoryDirectory": "~/my-memory-store" }
```
</Accordion>
<Accordion title="claudeMdExcludes">
**Type:** `string[]` | **Scope:** Any
Glob patterns or absolute paths of `CLAUDE.md` files to exclude from loading. Patterns are matched against absolute paths using picomatch. Only applies to User, Project, and Local memory types — Managed files cannot be excluded.
```json theme={null}
{
"claudeMdExcludes": [
"/home/user/monorepo/vendor/CLAUDE.md",
"**/third-party/.claude/rules/**"
]
}
```
</Accordion>
<Accordion title="disableAllHooks">
**Type:** `boolean` | **Scope:** Any
Set to `true` to disable all hook and `statusLine` execution.
```json theme={null}
{ "disableAllHooks": true }
```
</Accordion>
<Accordion title="respectGitignore">
**Type:** `boolean` | **Default:** `true` | **Scope:** Any
Whether the file picker respects `.gitignore` files. `.ignore` files are always respected regardless of this setting.
```json theme={null}
{ "respectGitignore": false }
```
</Accordion>
<Accordion title="defaultShell">
**Type:** `"bash" | "powershell"` | **Default:** `"bash"` | **Scope:** Any
Default shell for `!` commands in the input box.
```json theme={null}
{ "defaultShell": "powershell" }
```
</Accordion>
<Accordion title="forceLoginMethod">
**Type:** `"claudeai" | "console"` | **Scope:** Managed
Force a specific login method. Use `"claudeai"` for Claude Pro/Max accounts, or `"console"` for Anthropic Console billing.
```json theme={null}
{ "forceLoginMethod": "console" }
```
</Accordion>
<Accordion title="apiKeyHelper">
**Type:** `string` | **Scope:** User, managed
Path to a script that outputs authentication values. The script is called to retrieve credentials dynamically instead of reading a static API key.
```json theme={null}
{ "apiKeyHelper": "/usr/local/bin/get-claude-key.sh" }
```
</Accordion>
<Accordion title="syntaxHighlightingDisabled">
**Type:** `boolean` | **Scope:** Any
Disable syntax highlighting in diffs.
```json theme={null}
{ "syntaxHighlightingDisabled": true }
```
</Accordion>
<Accordion title="prefersReducedMotion">
**Type:** `boolean` | **Scope:** Any
Reduce or disable animations (spinner shimmer, flash effects, etc.) for accessibility.
```json theme={null}
{ "prefersReducedMotion": true }
```
</Accordion>
</AccordionGroup>
## Managed settings (enterprise)
Administrators can push settings to all users via platform-native mechanisms. Managed settings take precedence over all user and project settings.
<Tabs>
<Tab title="macOS">
Deploy a plist file to `/Library/Preferences/` or via MDM (Jamf, Kandji, etc.) targeting `com.anthropic.claudecode`.
</Tab>
<Tab title="Windows">
Write settings to the `HKLM\Software\Anthropic\Claude Code` registry key (machine-wide) or `HKCU\Software\Anthropic\Claude Code` (per-user, lower priority than HKLM).
</Tab>
<Tab title="File-based">
Place a `managed-settings.json` file at the platform-specific managed path. For drop-in configuration fragments, create a `managed-settings.d/` directory alongside it. Files in that directory are sorted alphabetically and merged on top of the base file — later filenames win.
```
managed-settings.json # base settings (lowest precedence)
managed-settings.d/
10-security.json # merged first
20-model-policy.json # merged second (wins over 10-)
```
This convention matches systemd/sudoers drop-ins: independent teams can ship policy fragments without coordinating edits to a single file.
</Tab>
</Tabs>
The following managed-only settings lock down user customization surfaces:
| Setting | Description |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowManagedHooksOnly` | When `true`, only hooks defined in managed settings run. User, project, and local hooks are ignored. |
| `allowManagedPermissionRulesOnly` | When `true`, only permission rules from managed settings are respected. |
| `allowManagedMcpServersOnly` | When `true`, the `allowedMcpServers` allowlist is only read from managed settings. |
| `strictPluginOnlyCustomization` | Lock specific customization surfaces (`"skills"`, `"agents"`, `"hooks"`, `"mcp"`) to plugin-only sources. Pass `true` to lock all four, or an array of surface names. |
<Warning>
`allowManagedPermissionRulesOnly` ignores permission rules from user settings, project settings, local settings, and CLI arguments. Make sure your managed rules are comprehensive before enabling this.
</Warning>
## JSON schema
Add `$schema` to your settings file for editor autocompletion and validation:
```json theme={null}
{
"$schema": "https://schemas.anthropic.com/claude-code/settings.json"
}
```
Built with [Mintlify](https://mintlify.com).