CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG
Updated by Alex Sorokoletov
CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG is a Claude Code environment variable: Limits what a session's own Claude Code files may do. With it set, a user's own agents cannot define their own MCP servers or widen their permission mode, the user's own hooks must succeed, and launching a cloud agent is refused because a cloud session would not carry the limits (it points to isolation worktree…. Added in v2.1.295 and still present in v2.1.296. It is not in the official reference.
| Status | Present in v2.1.296 |
|---|---|
| Added | Added in v2.1.295 |
| Category | Other |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG": "<value>"
}
}Release notes that mention it
- Claude Code Version Tracker: Undocumented Env Vars, Feature Gates & Models
- claude-code-env-vars-v2-1-295
Related variables
CLAUDE_CODE_MANAGED_CONFIG_PREFETCH: Turns on a hedged prefetch of the organization's managed settings during startup, so the first managed-settings fetch runs earlier in the launch sequence.CLAUDE_CONFIG_DIR: Custom config directory.GIT_CONFIG_COUNTCLAUDE_CODE_CONFIG_PROBECLAUDE_CODE_CONFIG_WATCH_EVENTSCLAUDE_SECURESTORAGE_CONFIG_DIRANTHROPIC_BETAS: Comma-separated beta feature headers.ANTHROPIC_CUSTOM_HEADERS: Custom HTTP headers (newline-separated Key: Value).
Frequently asked questions
What does CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG do?
Limits what a session's own Claude Code files may do. With it set, a user's own agents cannot define their own MCP servers or widen their permission mode, the user's own hooks must succeed, and launching a cloud agent is refused because a cloud session would not carry the limits (it points to isolation worktree…
Which Claude Code version has CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG?
Added in v2.1.295 and still present in v2.1.296.
How do I set CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG?
Export it before starting Claude Code (export CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.