> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superserve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Run Claude Code in a Superserve sandbox.

Claude Code is Anthropic's terminal coding agent. Run it in a Superserve sandbox so its shell commands and file edits stay isolated from your machine.

## Via the console

1. On the [Secrets page](https://console.superserve.ai/secrets?utm_source=docs\&utm_medium=link), create a secret with the **Anthropic** provider and paste your API key — you only do this once, and the key never enters the sandbox.
2. Go to [console.superserve.ai](https://console.superserve.ai?utm_source=docs\&utm_medium=link) and click **Create sandbox**.
3. Pick the **`superserve/claude-code`** template (Claude Code preinstalled).
4. Under **Advanced Options → Secrets**, bind that secret to `ANTHROPIC_API_KEY`.
5. Create the sandbox, open its **Terminal**, and run `claude`.

## Via the SDK

```bash theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
npm install @superserve/sdk
export SUPERSERVE_API_KEY=ss_live_...
```

<CodeGroup>
  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  import { Sandbox, Secret } from "@superserve/sdk"

  // One-time: store your key as a secret. It never enters the sandbox.
  await Secret.create({
    name: "anthropic-key",
    value: "sk-ant-...",
    provider: "anthropic",
  })

  const sandbox = await Sandbox.create({
    name: "claude-code",
    fromTemplate: "superserve/claude-code",
    secrets: { ANTHROPIC_API_KEY: "anthropic-key" },
  })
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  from superserve import Sandbox, Secret

  # One-time: store your key as a secret. It never enters the sandbox.
  Secret.create(name="anthropic-key", value="sk-ant-...", provider="anthropic")

  sandbox = Sandbox.create(
      name="claude-code",
      from_template="superserve/claude-code",
      secrets={"ANTHROPIC_API_KEY": "anthropic-key"},
  )
  ```
</CodeGroup>

Claude Code reads `ANTHROPIC_API_KEY` as usual, but its value is a [stand-in token](/secrets/overview) — the real key is attached only on requests to Anthropic, never exposed to the agent.

Open the sandbox in the [console](https://console.superserve.ai?utm_source=docs\&utm_medium=link), launch the terminal, and run `claude`.

## Persist sessions

```typescript theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
await sandbox.pause()    // checkpoint state to disk
await sandbox.resume()   // restore exactly where you left off
```
