# contained/agent-claude-code — Claude Code on top of the Contained base image.
# Built automatically on the first start of a sandbox that uses it (and
# rebuilt when this file changes), or by hand:
#   docker build -t contained/agent-claude-code:latest build/agents/claude-code
FROM contained/agent-base:latest

# Root's install steps must not write into the agent's home (see HOME).
USER root
ENV HOME=/root
# Pinned like the base image; raise it here.
ARG CLAUDE_CODE_VERSION=2.1.282
RUN npm install -g @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}
# The version is the image's: Claude Code does not update itself here (it
# could not — the global folder belongs to root — and each attempt would be
# a denied connection in the audit log).
ENV DISABLE_AUTOUPDATER=1
ENV HOME=/home/node
USER node
