Skip to main content
Claude Code is Anthropic’s agentic coding CLI. Gravix Layer gives it a dedicated microVM: filesystem, terminal, git, and outbound network you control — without running the agent on your laptop. This guide series shows how to use Claude Code as:
  • A day-to-day coding sandbox (interactive claude in a runtime shell)
  • A headless worker you drive from Python or the Gravix CLI (-p, JSON, session resume)
  • A platform building block for repo work, parallel agents, and scheduled jobs

Why Gravix Layer for Claude Code?

Claude Code still talks to Anthropic’s API. Gravix Layer is the execution environment — not a replacement for Anthropic auth or model access.

Architecture

Template

Build (or use) a template from agent-claude.Dockerfile. It extends the Gravix base image and installs Claude Code via Anthropic’s official installer. Throughout these guides, set:
See Templates for base sizes and how to build custom images. Prefer ≥ 8 GB disk so the Claude CLI and toolchain fit comfortably.

What you can do

Claude Code features → Gravix primitives

Anthropic continues to ship product features (dynamic workflows, agent view, routines, Dispatch / computer use). On Gravix Layer you map them like this:

Prerequisites (all guides)

  • Gravix Layer API key
  • Anthropic API key (ANTHROPIC_API_KEY) with Claude Code access
  • Python 3.10+ with pip install gravixlayer, or the Gravix CLI
  • A built Claude template (GRAVIXLAYER_CLAUDE_TEMPLATE)
Every runnable example in this series is written against:

Safety model

--dangerously-skip-permissions auto-approves tool calls inside the sandbox. That is intentional for headless agents. It does not protect outbound network — Claude can still call any host you allow. Keep egress on an allowlist when the agent handles untrusted input or secrets.
If claude prints Failed to connect to api.anthropic.com: ETIMEDOUT, the runtime has no working egress to Anthropic. Start with Get started — that is almost always a missing network policy, not a Claude install problem.