CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG

Updated by

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.

StatusPresent in v2.1.296
AddedAdded in v2.1.295
CategoryOther
Official docsNot listed

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG=<value>
claude

To 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

Related variables

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.