Skip to content

Claude Code

Version: 1.0.0 | Tests: Passing

devcontainer.json
{
    "features": {
        "ghcr.io/infrashift/trusted-devcontainer-features/claude-code:latest": {
            "target_version": "latest"
        }
    }
}
OptionTypeDefaultDescription
target_versionstringlatestSelect the Claude Code version to install
bunthis feature

This feature uses Bun to globally install the @anthropic-ai/claude-code npm package, which provides the claude CLI for AI-assisted coding directly in your terminal. Claude Code enables you to interact with Anthropic’s Claude models to edit files, run commands, and navigate codebases from within your devcontainer.

The Ansible playbook runs bun install --global @anthropic-ai/claude-code@<version>, which places the claude CLI binary in ~/.bun/bin. This directory is automatically added to PATH by the Bun feature, so the claude command is available immediately after installation. By default, the latest version is installed, but you can pin to a specific version using the target_version option.

To use Claude Code, you must set the ANTHROPIC_API_KEY environment variable. You can do this in your devcontainer.json using the containerEnv or remoteEnv properties, or by mounting a .env file. The VS Code extension anthropics.claude-code is also recommended for a richer integrated experience. Consider pairing this feature with the egress-filter feature to control network access when running Claude Code in sandboxed environments.