FROM node:22-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
        git \
        ca-certificates \
        ripgrep \
        curl \
        less \
    && rm -rf /var/lib/apt/lists/*

RUN npm install -g @anthropic-ai/claude-code

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/

# node:22-slim already ships a `node` user at uid 1000, reuse it.
USER node
# Ensure the auth dir exists with the right ownership so `trusted-agent` can
# bind-mount a projected .credentials.json at /home/node/.claude/.
RUN mkdir -p /home/node/.claude
WORKDIR /workspace

ENTRYPOINT []
CMD ["claude"]
