# Quickstart for remote Claude Code agents on Depot (https://depot.dev/docs/agents/claude-code/quickstart)

Run Claude Code agents in Depot's remote agent sandboxes: a secure, isolated environment in the cloud, where you can launch, resume, and share coding sessions.

## Prerequisites

You'll need a [Depot account](https://depot.dev/sign-up).

## Install the Depot CLI

Install the [Depot CLI](/docs/cli/reference) on your machine to configure and launch remote sandboxes.

* **macOS**

  Install the Depot CLI with Homebrew:

  ```shell
  brew install depot/tap/depot
  ```

* **Linux**

  Install the Depot CLI with the installation script:

  ```shell
  curl -L https://depot.dev/install-cli.sh | sh
  ```

* **All platforms**

  Download the binary file for your platform from the [Depot CLI releases page](https://github.com/depot/cli/releases) in GitHub.

## Get and set your Anthropic credentials

To run Claude Code in remote agent sandboxes, configure your Anthropic credentials. You have two options:

* Claude Code token (Max plan)
* Anthropic API key

### Use your Claude Code token with Anthropic Max plan (recommended)

1. Use the `claude` CLI to generate a new OAuth token:

   ```shell
   claude setup-token
   ```

   This will output a token that you can copy to use in the next step.

   <img alt="Claude Code OAuth token" src="/images/docs/claude-code-setup-token.png" width="1862" height="364" />

2. Set the token as a secret in your Depot organization:

   ```shell
   depot claude secrets add CLAUDE_CODE_OAUTH_TOKEN --value <"claude-code-token">
   ```

### Use your Anthropic API key

1. Generate an API key in the Anthropic web console. Learn how to get an API key in the [Claude Docs](https://docs.claude.com/en/api/overview).

2. Set the API key as a secret in your Depot organization:

   ```shell
   depot claude secrets add ANTHROPIC_API_KEY --value <"anthropic-api-key">
   ```

## Access your Git repositories

You can work with public and private Git repositories in your remote agent sandboxes. To use private Git repositories, either install the Depot Code app into your GitHub organization or set your Git credentials as secrets in your Depot organization.

### Install the Depot Code app into your GitHub organization

To grant remote agent sandboxes access to clone and push changes to your private GitHub repositories, install the Depot Code app into your GitHub organization:

1. Log in to your [Depot dashboard](/orgs).
2. Click **Settings**.
3. In the **GitHub Code Access** section, click **Connect to GitHub**.
4. Follow the prompts to add Depot Code to your GitHub organization.

<img alt="Install Depot Code app" src="/images/docs/depot-code-github-app.webp" width="641" height="274" />

### Grant access outside of GitHub

If you don't want to use the Depot Code app, you can set your Git credentials as secrets in your Depot organization to allow changes to your private repositories. The value of `GIT_CREDENTIALS` must be one of the following:

* A token, such as a personal access token. Depot uses `x-token` as the username and the token you specify as the password.
* A user name and password in the format: username\@password.

To set your Git credentials as secrets, run the following command:

```shell
depot claude secrets add GIT_CREDENTIALS --value <"your-credentials">
```

## Launch your first remote agent sandbox

To create a remote agent sandbox, run the `depot claude` command. For example:

```shell
depot claude \
  --session-id feature-auth \
  --repository https://github.com/foo/bar \
  --branch main \
  "Give me a general summary of this repository"

✓ Claude sandbox started!
  Session ID: feature-auth
  Link: https://depot.dev/orgs/12345678911/claude/feature-auth
```

This command tells the Depot control plane to start a new agent sandbox for Claude Code. The command returns a URL to the session inside of Depot where you can follow the output.

<img alt="Remote Claude Code session inside of Depot" src="/images/docs/remote-claude-code-session-ui.webp" width="2175" height="1313" />

And that's it! Your Depot organization is set up to use remote agent sandboxes for Claude Code.

## Manage sessions using the Depot dashboard

In addition to using the CLI, you can also manage your remote agent sandboxes directly from the Depot dashboard:

1. Log in to your [Depot dashboard](/orgs).
2. To view all your sessions, click **Claude Code**.
3. From this view, you can:
   * **Resume existing sessions**: Click on any session to view its details, then use the prompt input at the bottom to resume the session with a new message.
   * **Start new sessions**: Click the **New sandbox** button to launch a fresh Claude Code session in a new remote agent sandbox. You can select a repository, branch, and provide an initial prompt.

## Next steps

Try the following with your remote agent sandbox:

* Work with different Git repositories that your Git credentials or Depot Code app have access to.
* Switch between branches using the `--branch` flag.
* Resume a session using the `--resume` flag or via the Depot dashboard.
* Fork a new session from an existing session using the `--resume` and `--fork-session` flags together.

Run `depot claude --help` or check the [CLI reference](/docs/cli/reference/agents) to see all the available command options.

## For AI Agents

The full site index is at [llms.txt](https://depot.dev/llms.txt). Append `.md` to any documentation, blog, changelog, or customer URL to fetch its markdown source directly.