In short.
This guide helps developers and platform teams configure Claude Code in development containers, with the catch that containers still expose mounted project files and credentials available inside them. It provides concrete settings for installation, persistent authentication, managed policy and optional network restrictions. The feature installs the latest Claude Code rather than a pinned CLI release, and the reference container is an example rather than a maintained base image. No configuration or runtime behavior was tested.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete selected page at [https://code.claude.com/docs/en/devcontainer.md], including installation, editor behavior, authentication persistence, organization policy, network restrictions, permission bypass, the reference-container instructions and associated warnings. Linked pages, repositories, scripts, images and licence files are excluded. Runtime behavior, compatibility, security effectiveness, performance and costs remain untested or unknown where the page supplies no evidence.
The overview
Identity
Development containers is a Claude Code documentation guide at [https://code.claude.com/docs/en/devcontainer.md]. It explains how to install and configure the coding assistant inside a container that holds a project's development tools.
The page links to the Claude Code Dev Container Feature and an example configuration in the anthropics/claude-code repository. Those linked resources are distinct from the guide, and their contents were not assessed.
Assessment
The guide is useful for teams that want engineers to share a defined toolchain while keeping Claude Code's command execution inside a container. It addresses practical problems beyond installation, including repeated login after rebuilds and the difference between a feature version and a CLI version.
Its security guidance is consequential: isolation does not protect everything accessible inside the container, and edits to the mounted workspace affect the host repository. The page supports configuration decisions, but does not establish security effectiveness or reliable operation through test results.
Users
Developers already using development containers can add Claude Code through a feature in their existing configuration. Platform engineers and team administrators can use the policy, credential and network sections to plan a shared setup.
Beginners receive a minimal configuration and rebuild instructions, although the fuller introduction to Docker and development containers is on a linked tutorial outside this page. The documented editor workflow requires Dev Containers support; the page explicitly excludes plain Vim from that workflow.
Capabilities
The page explains feature-based installation, authentication through Anthropic or supported cloud providers, persistent configuration volumes, managed settings, environment variables and outbound network restrictions. It also describes making project-scoped MCP servers available inside the container.
It covers unattended operation through --dangerously-skip-permissions, its non-root requirement and its risks. For a combined example, it points to a reference configuration containing the CLI, a firewall, persistent volumes and a Zsh-based shell.
Using it
Requirements
The workflow requires a Docker-based development container, running locally or on a cloud host, and a tool that supports the Dev Containers specification. The page names VS Code, GitHub Codespaces, JetBrains IDEs and Cursor. Authentication requires a Claude or Anthropic Console account, or credentials for a supported cloud provider.
The installation feature supplies Node.js when the base image lacks it. The reference firewall additionally requires NET_ADMIN and NET_RAW container capabilities; these are optional for Claude Code itself. Minimum hardware, storage needs and a complete compatibility matrix are not specified.
Mechanism
The editor connects to the container while the repository is mounted into it as the workspace. Claude Code, terminals, language servers and build tools run inside the container. This gives Claude Code the project's containerized tools, while workspace edits appear directly in the repository.
Authentication, settings and session history normally live under ~/.claude, while account details and other configuration also use ~/.claude.json outside that directory. The documented persistence method mounts a named volume at ~/.claude and sets CLAUDE_CONFIG_DIR to that path so the separate configuration file is stored in the volume too.
For Linux organization policy, Claude Code reads /etc/claude-code/managed-settings.json at the highest settings precedence. The page cautions that repository writers can remove the Dockerfile step that installs it, and points to server-managed settings or MDM for policy delivery outside repository control.
Setup
Create or update .devcontainer/devcontainer.json with the feature ghcr.io/anthropics/devcontainer-features/claude-code:1.0. The minimal example uses mcr.microsoft.com/devcontainers/base:ubuntu; an existing project should retain its appropriate image or Dockerfile. Rebuild the container, open its terminal and run claude to authenticate.
For persistent state, add a named volume at the actual container user's ~/.claude directory and set CLAUDE_CONFIG_DIR to that same path in containerEnv. Merge settings into an existing containerEnv object. For cloud authentication, the page recommends environment variables, Codespaces secrets or workload identity instead of mounted host credential files.
The :1.0 feature tag pins the installation script, not Claude Code. To pin the CLI, the page instead documents installing @anthropic-ai/claude-code@X.Y.Z with npm in a Dockerfile and setting DISABLE_AUTOUPDATER to 1. X.Y.Z is a placeholder; the page specifies no release to choose.
Example
For a project whose container user is node, the persistence example mounts source=claude-code-config,target=/home/node/.claude,type=volume and sets CLAUDE_CONFIG_DIR to /home/node/.claude. Both paths must change if the container user has a different home directory.
The page also describes using claude-code-config-${devcontainerId} as the volume source name to separate state by container identifier. This is a documented configuration pattern; successful login persistence after a rebuild was not demonstrated or tested here.
Assessment & evidence
Limitations
A malicious repository can exfiltrate material accessible inside the container, including Claude Code credentials, when permissions are bypassed. The page advises using trusted repositories, monitoring activity and avoiding mounts of host SSH or cloud credential files.
Skipping permission prompts removes review before tool calls. Claude Code can still change mounted workspace files and reach destinations allowed by the network policy. The reference firewall needs extra container capabilities, and its actual implementation was not included in the evidence.
Reproducibility needs additional care because the feature installs the latest CLI and automatic updates are enabled by default. Disabling nonessential traffic also disables feature-flag evaluation required by Remote Control and some other features. The reference configuration is explicitly an example rather than a maintained base image.
Reasoning
The guide's practical value comes from combining a shared toolchain with explicit control over credentials, updates and network access. A development container provides a place to apply those controls, but the mounted workspace remains a direct connection to project files.
The documented choices involve trade-offs: persistent authentication reduces repeated setup while retaining sensitive state, and version pinning requires a different installation path from the feature. Teams also need to distinguish configuration checked into a writable repository from policy delivered independently of that repository.
Alternatives
The page offers two starting points: add the Claude Code feature to an existing development container, or adapt the complete reference .devcontainer directory. It also describes Dockerfile installation for a fixed CLI release and using existing network controls instead of the reference firewall.
For fewer permission prompts, it points to auto mode, which it describes as using a classifier to review actions. It names the built-in Bash sandbox, custom containers and virtual machines as other environments to compare, but their linked documentation and comparative effectiveness are outside the evidence.
Evidence
The evidence is the complete Development containers page at [https://code.claude.com/docs/en/devcontainer.md]. It contains configuration examples, installation steps, security warnings and descriptions of intended behavior.
The linked feature implementation, reference Dockerfile, firewall script, provider documentation and other pages were not included. No commands were executed, and installation, authentication, rebuild persistence, policy enforcement and network isolation were not tested. The page supplies no benchmark results or independent security assessment.
Access & freshness
Costs
The page gives no Claude subscription prices, API rates, cloud-provider charges or hosted-container prices. Total cost is unknown from this evidence.
It describes local containers, cloud-hosted containers and several authentication providers, but does not quantify their infrastructure requirements or usage costs. It also provides no evidence of performance gains or financial savings.
Rights
The captured page does not state a licence or redistribution terms for its prose, configuration examples, installation feature or reference files. Their applicable rights are unknown from this evidence.
Links to GitHub repositories do not establish the licences of those repositories. The relevant licence files and product terms would need to be consulted before redistributing material.
Freshness
The page was captured on 25 November 2026 at 09:48:09 UTC. The supplied text gives no publication date, last-updated date or specific Claude Code release against which its instructions were verified.
Because the feature installs the latest release and the CLI updates itself by default, resulting behavior can vary over time. The capture does not establish which CLI version a later build will install.
Actions
Start with the project's base image and actual container user, then choose feature installation or an explicitly pinned Dockerfile installation. Configure authentication without mounting broad host credentials, and decide whether state should persist separately for each project.
After configuration, verify login and settings survive a rebuild, confirm the installed CLI version, and check that intended policy and network restrictions take effect. These are suggested validation steps, not completed tests.
Keep permission bypass an explicit decision tied to repository trust and accessible credentials. Before adopting the full reference configuration, inspect its Dockerfile and firewall script and review the linked provider-specific network requirements.
