Skip to content

Claude Code

Version: 1.4.3 | 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
bun → this 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 target_version is latest, which the role resolves against the npm registry to a concrete version before installing — so the install is always pinned, the version is asserted exactly, and a rebuild genuinely picks up a newer release. You can also pin target_version to a specific version yourself.

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.