How configuration propagates
When the app starts a Code session, it translates your Claude Desktop on 3P configuration keys into the equivalent Claude Code settings and passes them to the session. You configure one profile, and Cowork and Code both honor it. Each key reaches Claude Code through one of two mechanisms, and the distinction matters if you also deploy Claude Code’s own managed settings (see the next section).Always applied
These keys are passed directly to the Claude Code process as environment variables or launch options. They take effect on every Code session and cannot be overridden by user-level Claude Code settings or by a separately deployedmanaged-settings.json.
mcpPersistentAlwaysAllowEnabled also applies to Code sessions. When it’s false, the approval prompt for an MCP tool offers Allow for this session in place of Always allow, and the approval isn’t saved to Claude Code’s settings files. Allow rules already in those files, and hooks, keep allowing the tool until someone removes them. For scheduled tasks, see Tool approvals on scheduled tasks.
Applied as managed policy
These keys are translated into Claude Code managed settings and supplied to the session as policy. They take precedence over user and project settings, but they participate in Claude Code’s managed-settings precedence if you have also deployed a separate Claude Code policy.
The network and filesystem sandboxes apply on macOS, and on Linux devices and SSH hosts with Claude Code’s sandbox dependencies installed. Claude Code doesn’t sandbox shell commands on Windows devices, and on a Linux device or SSH host without the dependencies commands run unsandboxed. When
coworkEgressAllowedHosts contains * and allowedWorkspaceFolders is unset, Claude Desktop turns on neither sandbox. In all of these cases, blockReadsOutsideWorkingDirectories still confines Claude’s file tools but can only ask the user to approve shell commands that read outside the working directories or that Claude Code can’t verify. For what a remote session shows, see Sandbox status on the remote host.
Under blockReadsOutsideWorkingDirectories, sandboxed shell commands can still read system locations such as /usr, the session’s plugin and attachment folders (which become read-only), and the user’s git configuration files (~/.gitconfig and the config, ignore, and attributes files under ~/.config/git), which can themselves hold credentials such as tokens in remote URLs. Other files under the home folder outside the working directories are hidden from them, including ~/.ssh, stored git credentials, included git configuration files, signing keys, and the target of a symlinked git configuration file, so git operations that need those files fail in the session until the user re-opens the paths. In a local session Claude also cannot read a file attached or @-mentioned from outside the working directories, so users should move such files into the session’s folder or an allowed folder first.
An allowed root that is or contains the home directory, such as ~ or /Users, leaves the home directory readable, so list folders below it. The block guards against content a session reads steering Claude into the user’s files, not against the user, who can re-open any path, up to their whole home folder, with sandbox.filesystem.allowRead (shell commands) or permissions.additionalDirectories (file tools and shell commands) in their own Claude Code settings, while a settings file tracked in a git repository cannot.
Interaction with Claude Code’s own managed settings
Claude Code can also be configured directly by deploying amanaged-settings.json file, an OS configuration profile for Claude Code, or, with the Claude API as the inference provider, server-managed settings. If a Code session has any of these, Claude Code treats it as the administrator policy. By default, Claude Code then ignores the managed policy values that Claude Desktop supplies, except in a Code session that gets code settings from a Claude apps gateway. The Always applied keys are unaffected.
In such a session, the gateway’s code settings are the administrator policy, and parentSettingsBehavior defaults to "merge". Set it in those code settings rather than rely on the default: "merge" to keep Claude Desktop’s policy values, "first-wins" to drop them. To keep them, also set "merge" in the Claude Code managed settings on each device, because a session that starts without the gateway’s code settings follows the device’s settings instead.
To have Claude Desktop’s restrictions apply on top of your Claude Code policy, set parentSettingsBehavior to "merge" in the Claude Code managed settings you deploy:
managed-settings.json
"merge", Claude Desktop’s policy values are layered under your Claude Code policy. Your values win any conflict, deny and allow lists are unioned, and Claude Desktop’s values are filtered so they can only tighten policy, never loosen it. See parentSettingsBehavior in the Claude Code settings reference. Requires Claude Code v2.1.133 or later, which ships with Claude Desktop on 3P.
With "merge", two Claude Code policy keys weaken blockReadsOutsideWorkingDirectories. sandbox.filesystem.allowManagedReadPathsOnly limits the block to Claude’s file tools, so a shell command that reads outside the working directories asks for approval instead of failing, and allowManagedPermissionRulesOnly removes the session’s read access to its plugin and attachment folders, so skills that read their own files stop working. Leave both out of your Claude Code policy if you rely on the block.
With the Claude API as the inference provider, Code sessions ask Anthropic for the server-managed settings of the organization that owns the credential. This holds for an API key in your configuration, an API key from a credential helper, and Sign in with Claude Console. If that organization has server-managed settings, set
parentSettingsBehavior to "merge" in them to keep Claude Desktop’s policy values. While server-managed settings apply, Claude Code by default ignores most keys in a file or OS profile on the device, and a "merge" set there has no effect.Without a Claude Code managed-settings.json file, OS profile, or server-managed settings, Claude Desktop’s policy applies automatically and you don’t need to set parentSettingsBehavior.Tune the Auto mode classifier
In Auto mode, which Cowork shows as Automatically approve, a safety classifier reviews Claude’s actions and blocks the ones it judges risky. To tell it what your organization trusts, or to add block and allow rules, deploy Claude Code’sautoMode settings in Claude Code managed settings on each device. Check which of your sessions read those settings:
- Cowork sessions read the managed settings on the device, and never read server-managed settings.
- Local Code sessions read the managed settings on the device too, unless server-managed settings or a Claude apps gateway’s
codesettings take priority. They also readautoModeentries from the user’s own~/.claude/settings.json, which Cowork sessions don’t read. - For Code sessions on an SSH host, see Managed configuration on the remote host.
- For a self-hosted install, see Configuration on a self-hosted install.
managed-settings.json
- Start each list with
"$defaults"to keep the built-in rules. Without it, a list can replace its built-in rules, the block lists included. - Keep
parentSettingsBehavior. Without it, Claude Code ignores the managed policy values that Claude Desktop supplies to Cowork and Code sessions, except in a Code session that getscodesettings from a Claude apps gateway. For example, without it, Claude doesn’t ask for approval in Cowork’s Automatically approve before calling a connector tool whosetoolPolicyis"ask", and the classifier reviews the call. - Deploy to Claude Code’s policy locations, not to Claude Desktop’s configuration locations. In a macOS configuration profile for Claude Code, use the same keys as in
managed-settings.json, with nested settings as dictionaries and lists as arrays. In a Windows registry policy, put the file’s JSON in theSettingsvalue underHKLM\SOFTWARE\Policies\ClaudeCode. - If the device already has a Claude Code managed-settings file, profile, or
HKLMregistry policy, add theautoModeblock to it. By default, Claude Code reads most keys from one managed source, so a second source is either ignored or hides the first.
claude auto-mode config in a terminal to check that the CLI reads your entries. It lists your entries among the built-in rules, and any from the user’s ~/.claude/settings.json.
Run vetted connector tools without classifier review
In Cowork’s Automatically approve, the safety classifier reviews calls to a connector tool whosetoolPolicy in managedMcpServers is "allow", and can block them. To run a tool without that review, add a permissions.allow rule for it to your Claude Code managed settings, beside any autoMode block:
managed-settings.json
mcp__<server>__<tool>, from the name of the server’s managedMcpServers entry and the tool’s name. In both names, replace each character that isn’t an ASCII letter or digit, _, or - with _. For example, a server named Ticket Tracker becomes Ticket_Tracker. The rule doesn’t cover the server’s other tools.
Claude Code mods
Code sessions support Claude Code mods, code that a plugin runs inside Claude Code, and users can load their own. Cowork sessions and Chat conversations load mods from plugins users add themselves and plugins from your marketplaces. To stop users’ own mods from loading in local Code sessions, Cowork sessions, and Chat conversations, deploy this Claude Code managed-settings file on each device:managed-settings.json
- Keep
parentSettingsBehavior. Without it, Claude Code ignores the sandbox and the other managed policy values that Claude Desktop supplies, except in a Code session that getscodesettings from a Claude apps gateway. In Cowork sessions, without it, Claude doesn’t ask for approval before a tool call that matches an argument-scopedbuiltinToolPolicyrule such asRead(//**/.env)set to"ask". - Leave out
disableSideloadFlags, which a longer sample in the Claude Code docs includes. With it, Code sessions start without the skills and organization plugins that Claude Desktop delivers. - Optionally, remove the
/plugin-authoringcommand, which has Claude write a mod. Add"enabledPlugins": { "cc-plugin-plugin-authoring@builtin": false }to the file.
Remote sessions over SSH
A Code session can run its Claude Code engine on a remote host over SSH while the session’s interface stays in Claude Desktop on the user’s device. In a 3P deployment this is off until you setsshHostAllowlist, because the app forwards the session’s inference credential to the host. SSH remote sessions lists the credential kinds that work on a remote host and which of the keys above apply there.
Further reading
Disabling Code
To turn off Code, setisClaudeCodeForDesktopEnabled to false in your Claude Desktop on 3P configuration. Users can no longer open Code. Cowork is unaffected, and so is Chat if you have enabled it.
If you set desktopHome to off, keep Code on. For what desktopHome does, see Unified Claude.