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. On Linux devices and Linux SSH hosts, they need Claude Code’s sandbox dependencies, the
bubblewrap and socat packages. 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. For shell commands, the key can only ask the user to approve those that Claude Code recognizes as reading outside the working directories, or whose command lines it can’t analyze. On a device whose only configuration is the local configuration file, an unset coworkEgressAllowedHosts can also leave both sandboxes off. See Unset allowlist in Code sessions. For what a remote session shows, see Sandbox status on the remote host.
On Ubuntu 24.04 and later, AppArmor can block the sandbox even when bubblewrap and socat are installed, and shell commands then fail or run unsandboxed.
- Ubuntu 24.04: to allow the sandbox, see Add an AppArmor profile for bubblewrap.
- Ubuntu 26.04: if you add that profile, Ubuntu’s own AppArmor profile for bubblewrap can replace it after any reboot or AppArmor reload, and shell commands then fail again.
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.
While blockReadsOutsideWorkingDirectories is on and Claude Code’s sandbox.autoAllowBashIfSandboxed is off, a sandboxed command that reads outside the working directories can ask for approval first, even in bypass permissions mode. Claude Code managed settings can replace the sandbox and other policy values that Claude Desktop supplies. Before you set sandbox.autoAllowBashIfSandboxed in those settings, read Interaction with Claude Code’s own managed settings.
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.
Plugin files under allowedWorkspaceFolders
A skill can tell Claude to read reference files from its plugin’s install folder. When that folder is outside the folders that allowedWorkspaceFolders lists, Claude’s Read, Grep, and Glob tools can still read it for these plugins:
- Local session,
disableSideloadFlagsunset orfalse: plugins and skills that Claude Desktop delivers, plugins that users install from marketplaces, and plugins that the Claude Code managed settings on the device turn on - Local session,
disableSideloadFlagsset totrue: plugins that the Claude Code managed settings on the device turn on, each set totrueunderenabledPlugins - Session over SSH: plugins that Claude Desktop copies to the host
HKLM registry policy turns on, they require Claude Desktop 5.1231.0 or later.
Claude can report Path is outside the workspace folders allowed by your administrator in a local session when it tries to read a plugin’s files under ~/.claude/plugins/cache. If the Claude Code managed settings on the device set disableSideloadFlags to true, turn that plugin on for the device:
- In the managed-settings file, profile, or
HKLMregistry policy that setsdisableSideloadFlags, add the plugin underenabledPluginsasplugin-name@marketplace-name, set totrue. The marketplace’s name is thenamein itsmarketplace.jsonfile. Claude Code then installs the plugin and keeps it on for everyone who receives those settings. Review the plugin first, because its hooks then run for those users even whereallowManagedHooksOnlyistrue. - If those settings don’t register the plugin’s marketplace yet, add it under
extraKnownMarketplaces. For an example of both keys, and for what to add if you restrict marketplaces, see Turn off user hooks. The example also setsallowManagedHooksOnly, which stops users’ own hooks; these steps don’t need it. - After the settings reach a device, ask the user to restart Claude Desktop and start a new session. If the first session still shows the message, start another.
allowedWorkspaceFolders, which is for the folders that Claude works in. A plugin’s folder holds hooks and commands that Claude Code runs.
File path rules and shell commands
ARead(…) rule in disabledBuiltinTools applies to Claude’s file tools, and only in part to shell commands. Where the sandbox that Claude Desktop turns on runs, it hides a folder that the rule lists by its full path, such as Read(//srv/keys/**). Elsewhere, some commands read a denied file without a prompt. Don’t rely on the rule, blockReadsOutsideWorkingDirectories, or the sandbox alone, and keep files that must stay secret where the user’s OS account can’t read them.
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. For how Claude Code combines the two policies, see Let an embedding host add policy in the Claude Code documentation. 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 Claude Code recognizes as reading 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.Policy status on the device
Claude Desktop checks whether Claude Code managed settings replace your policy on the device. Each time it starts Claude Code on the device for a Code, Cowork, or Chat session, it asks Claude Code whether it applies the managed policy values that Claude Desktop sent. A session over SSH has its own check, and a WSL session has none. Requires Claude Desktop 5.1231.0 or later. If Claude Code answers no, the session continues. Cowork and Chat sessions show no message. A Code session shows a message that begins with these words:- On the device: Claude Desktop writes a warning that names the affected session types and the fix to
main.login the logs directory and to the diagnostic report. - On your collector: if you set
otlpEndpoint, you receive adesktop_local_policy_check_failedevent under theservice.namevalueclaude-desktop, unless you setotlpDesktopLogLeveltooff.
- A
managed-settings.jsonfile, a configuration profile, a registry policy, or server-managed settings: setparentSettingsBehaviorto"merge"in each one that holds your Claude Code policy. Claude Code reads the key only from the highest-priority one that the session uses. See Interaction with Claude Code’s own managed settings. - A
policyHelper: put the limits from your Claude Desktop policy in what the helper returns. Claude Code never merges Claude Desktop’s values with a helper’s output. It still answers no, and the message, the warning, and the event keep appearing.
managed-config.txt in the report no longer lists the warning. main.log and your collector don’t show the recovery.
The event carries these attributes:
tab:codefor a Code session, orcoworkfor a Cowork or Chat sessionsession_id: Claude Desktop’s ID for the session that got the answer
Start Code sessions through a corporate launcher
If your organization starts Claude Code through a corporate launcher, Code sessions in Claude Desktop can go through it too. This takes two settings:- In Claude Desktop’s configuration, set
claudeCodeProcessWrapperEnabledtotrue. Without it, Claude Desktop starts Claude Code directly. - In Claude Code’s managed settings, name the launcher with
processWrapper, or withCLAUDE_CODE_PROCESS_WRAPPERin theenvblock. If these are the first Claude Code managed settings on the device or host, also setparentSettingsBehaviorto"merge"in them, or Claude Code ignores the managed policy values that Claude Desktop supplies.
- On a macOS or Linux device: in that device’s Claude Code managed settings, not in server-managed settings or the user’s own settings
- On a macOS or Linux host over SSH, from any device, Windows included: in the host’s Claude Code
managed-settings.jsonfile ormanaged-settings.dfolder, not in a configuration profile - On a Windows device itself, in WSL, and on a Windows host over SSH: sessions start without a launcher
inferenceCustomHeaders to Claude Code when the launcher starts it. The launcher must set a credential in Claude Code’s environment, such as ANTHROPIC_AUTH_TOKEN for a gateway or the variable that your provider’s credential uses. It must also pass on the ANTHROPIC_BASE_URL that it receives, or set your gateway’s address in its place. With no credential, the session still starts, and each reply fails with a message that Claude Code has no working credentials. Cowork, the connection test, and session titles don’t go through the launcher. They use the credential in Claude Desktop’s configuration, so a passing connection test doesn’t show that the launcher supplies one.
A session doesn’t start if Claude Desktop can’t use the launcher you named: for example, if the file is missing or isn’t executable, or the value doesn’t follow Claude Code’s launcher value format.
To keep users from turning the launcher off, set claudeCodeProcessWrapperEnabled in the device’s managed profile, which users can’t change. The key is an app-behavior key, so add every other app-behavior key you use, such as the update keys, to the same profile. If the profile sets any other kind of key, also keep the device on its managed profile.
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.
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. - Leaving
"$defaults"out removes the built-in rules from some lists only. In Cowork sessions and local Code sessions, Claude Code combines your lists with theenvironment,allow, andsoft_denylists that Claude Desktop sends, which start with"$defaults". If youralloworenvironmentlist has entries but leaves out"$defaults", Claude Desktop’s list doesn’t restore the built-in entries for that list. Claude Desktop’s own entries in that list still apply. Before Claude Desktop 6.6395.0, Claude Desktop’s list restored the built-inenvironmententries. Asoft_denylist without"$defaults"keeps the built-insoft_denyrules, because Claude Desktop’s list restores them. Ahard_denylist without"$defaults"can replace the built-inhard_denyrules. - 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. - 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. It doesn’t list the entries that Claude Desktop adds to Cowork sessions and local Code sessions.
Choose the Auto mode classifier model
In Auto mode, which Cowork shows as Automatically approve, a safety classifier reviews Claude’s actions. Except on a gateway, sessions ask your model provider for a review first, and Claude Code’s built-in safety check takes over when the provider doesn’t review the session. The built-in safety check uses Claude Sonnet 5 by default, and some sessions use a different model. The model you choose for it doesn’t affect your provider’s reviews. Requires Claude Desktop 5.11492.0 or later. To choose the model for Cowork and Code sessions, setautoModeClassifierModel where your devices get their configuration:
- MDM profile: add the key
- Bootstrap server: return the key in the response
- In-app configuration window: enter the model’s ID in the Auto mode classifier model field under Capabilities
- Enterprise Admin Console: open Organization settings, go to the Capabilities page under Desktop 3P, enter the model’s ID in the Auto mode classifier model field, and click Save changes. A device on the console’s configuration ignores the key from the other sources.
- Use your provider’s ID for an Anthropic model that it serves. Claude Desktop ignores a value that it can tell is something else, such as the Claude API’s ID on Amazon Bedrock. If the provider refuses the ID, every action that the built-in safety check reviews is blocked.
- If you set
inferenceModels, also list the ID there and in any permission policy that narrows the model list. A model that isn’t listed doesn’t take effect. - Don’t use Claude Opus 5, Sonnet 5.5, or Opus 5.5. These models can’t do the review.
- A weaker model may allow actions that the default would block
autoModeClassifierModel even if your devices already set CLAUDE_CODE_AUTO_MODE_MODEL, Claude Code’s environment variable for this model:
- In Claude Code managed settings on the device, or in a user’s
~/.claude/settings.json: Cowork and Code sessions ignore the value - In a user’s shell profile, the device’s environment variables, or the variables that a user saves in Code: Cowork and Code sessions ignore the value. Before Claude Desktop 5.11492.0, Code sessions could use it.
- Quit and reopen Claude Desktop
- Start a session in Auto mode on a model other than the one you set
- Have Claude call a connector tool
- Check your provider’s or gateway’s logs for requests to the model you set
Run vetted connector tools without classifier review
In Cowork’s Automatically approve, the safety classifier reviews Claude’s 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. In Auto mode and bypass permissions mode, Claude Code can load a mod that Claude writes during a Code session without asking the user. Cowork sessions and Chat conversations load mods from plugins users add themselves and plugins from your marketplaces.What a mod can do without approval
A mod is code that a plugin runs inside Claude Code. That code runs as the user, outside the sandbox. It can read and write files, run programs, and make network requests itself, and your tool policies don’t apply to those actions. For example, in a Code session it can reach hosts that aren’t incoworkEgressAllowedHosts.
A mod can also call the session’s tools, such as the shell tool (Bash) or a connector tool. Claude Code doesn’t ask the user to approve a call that a mod makes, and treats the call according to your policy for the tool:
- No policy: the mod’s call can run with no prompt
"allow"intoolPolicy: the mod’s call can run with no prompt, even in Code sessions, where"allow"doesn’t pre-approve Claude’s own calls"ask"intoolPolicy: under thepermissions.askrule that Claude Desktop supplies, Claude Code refuses the mod’s call, and the user sees no prompt. In a Code session, the same holds for a built-in tool set to"ask"inbuiltinToolPolicy. Claude’s own calls to the tool still prompt the user each time.- Blocked, by
"blocked"intoolPolicyor by the tool’s name indisabledBuiltinTools: a mod can’t call the tool
permissions.ask rule. For a tool that a mod must never call, block the tool, which removes it from the session.
In Auto mode and in Cowork’s Automatically approve, the safety classifier doesn’t review a mod’s calls, so your autoMode rules don’t apply to them.
Your tool policies don’t cover what a mod or a hook does without calling a tool. To control that, limit which mods and hooks run: see Stop user-installed mods from loading and Turn off user hooks. To limit which plugins users can add, see Controlling user extensions.
Stop user-installed mods from loading
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
- Deploy it to Claude Code’s policy locations, not to Claude Desktop’s configuration locations. If you set these keys in server-managed settings or in a Claude apps gateway’s
codesettings instead, they don’t reach Cowork sessions or Chat conversations, and users’ mods still load there. If the device already has Claude Code managed settings, such as anautoModeblock, add these keys to them and leave theirparentSettingsBehavioras it is. - 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, organization plugins, and uploaded 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. It forwards none where a launcher on the host starts Claude Code. SSH remote sessions lists the credential kinds that work on a remote host and which keys apply there.
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 set desktopHome to off, keep Code on. For what desktopHome does, see Unified Claude.