This guide will help you get started with Depot's remote agent sandboxes for running Claude Code agents. With Depot, you can run your coding agents in a secure, isolated environment in the cloud, allowing you to move your coding sessions off of your local machine and into fast remote environments where you can easily launch, resume, and share coding sessions.
depot
CLIBefore you can start running remote agents, you need to install the Depot CLI. The CLI is available for Mac and Linux.
Note: Remote agent sandboxes are only available on depot
CLI version 2.96.2 or later.
For Mac, you can install the CLI with Homebrew:
brew install depot/tap/depot
For Linux, you can install the CLI with our installation script:
# Install the latest version
curl -L https://depot.dev/install-cli.sh | sh
# Install a specific version
curl -L https://depot.dev/install-cli.sh | sh -s 2.96.2
For all other platforms, you can download the binary directly from the latest release.
Claude Code agent sandboxes and sandbox secrets live under a Depot organization. So before you can launch your first agent sandbox, you need to create a Depot organization.
Create Organization
buttonCreate organization
Today Depot only supports bringing your own Anthropic subscription or API key. We do not provide our own Anthropic API key for use with Depot's remote agent sandboxes.
There are two options for configuring your Anthropic credentials to use with Depot's remote agent sandboxes.
This is our recommended method for using Claude Code with Depot's remote agent sandboxes.
If you're on the Max plan from Anthropic, you need to get your Claude Code OAuth token to use with Depot's remote agent sandboxes.
First, using the claude
CLI, you can generate a new OAuth token:
claude setup-token
This will output a token that you can copy and use in the next step.
Alternatively, you can generate an Anthropic API key by following their Developer Platform documentation.
For Depot to use your Anthropic credentials for remote Claude Code agents, you need to configure a secret in your Depot organization for your Anthropic API key or OAuth token.
If you generated a Claude Code OAuth token, you can set it as a secret in your Depot organization:
depot claude secrets add CLAUDE_CODE_OAUTH_TOKEN --value <your-token-from-step-3>
If you generated an Anthropic API key, you can set it as a secret in your Depot organization:
depot claude secrets add ANTHROPIC_API_KEY --value <your-anthropic-api-key-from-step-3>
You can work with public and private git repositories in your remote agent sandboxes. If you want to use private git repositories, you need to either install the Depot Code
app into your GitHub organization, or set your Git credentials as secrets in your Depot organization.
To grant remote agent sandboxes access to your private GitHub repositories, you can install the Depot Code
app into your GitHub organization. This will allow you to clone and push changes to your private repositories from within your remote agent sandboxes.
Settings
tab in the sidebarGitHub Code Access
sectionConnect to GitHub
If you prefer not to use the Depot Code app, you can set your Git credentials as secrets in your Depot organization. This allows you to clone and push changes to your private repositories using your Git credentials.
To set your Git credentials as secrets, run the following commands:
depot claude secrets add GIT_CREDENTIALS --value <your-key>
Once you've configured your Anthropic credentials and Git access, you can launch your first remote agent sandbox using the depot claude
command.
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: 557737f9-6274-4df0-ac78-fda2122b6180
Link: https://depot.dev/orgs/12293423849/claude/9842347238947
This command immediately tells the Depot control plane to start a new agent sandbox for Claude Code. Returning a url to the session inside of Depot where you can follow the output.
And that's it! You now have your Depot organization set up to make use of Depot agent sandboxes for Claude Code. You can pass different git repositories that your git credentials or Depot Code app have access to, you can specify different branches, you can resume a session using the --resume
flag, and you can fork new sessions from an existing file systems using the --session-id
flag and --resume
flag at the same time.