We use cookies to understand how people use Depot.
CLI

Depot CLI: Agents commands reference

Reference for all depot claude commands. To install the Depot CLI, see Installation.

Other Depot product CLI references:

depot claude

Run Claude Code in remote agent sandboxes backed by Depot with automatic session & file system saving and resuming. Sessions are stored by Depot and can be resumed by session ID, allowing you to collaborate on any session in your organization across any environment.

By default, Claude Code runs in a remote sandbox environment.

Note: All flags not recognized by depot are passed directly through to the Claude CLI. This includes Claude flags like -p, --model, etc.

Example

Start a new Claude Code session with a custom ID:

depot claude --session-id feature-auth-redesign

Resume an existing session:

depot claude --resume feature-auth-redesign

Run Claude Code locally instead of in a sandbox:

Note: This will only persist the Claude Code session information up to Depot, but not execute in a remote sandbox.

depot claude --local --session-id local-development

Work with a Git repository in the sandbox:

depot claude --repository https://github.com/user/repo.git --branch main --session-id repo-work

Use a private repository with authentication:

Note: You can use the --git-secret flag to specify a secret containing your Git credentials, or use the Depot Code app installed in your GitHub organization.

depot claude secrets add GITHUB_TOKEN
depot claude --repository https://github.com/org/private-repo.git --git-secret GITHUB_TOKEN

Mix Depot flags with Claude flags:

depot claude --session-id older-claude-pr-9953 --model claude-3-opus-20240229 -p "write tests"

Use in a script with piped input:

cat code.py | depot claude -p "review this code" --session-id code-review

Flags for claude

NameDescription
helpShow help for claude command
localRun Claude locally instead of in a remote sandbox
orgOrganization ID (optional)
outputOutput format (json, csv)
repositoryGit repository URL for remote context (format: https://github.com/user/repo.git)
branchGit branch to use (defaults to main)
git-secretSecret name containing Git credentials for private repositories if not using Depot Code app
resumeResume a session by ID
session-idCustom session ID for saving
tokenDepot API token
waitWait for the remote Claude session to complete (by default exits after starting)

depot claude list-sessions

List all saved Claude sessions for the organization. In interactive mode, pressing Enter on a session will start Claude with that session.

Example

List sessions interactively:

depot claude list-sessions

List sessions in JSON format:

depot claude list-sessions --output json

Flags for claude list-sessions

NameDescription
helpShow help for list-sessions
orgOrganization ID
outputOutput format (json, csv)
tokenDepot API token

depot claude secrets

Manage secrets that can be used in Claude sandboxes. Secrets are stored securely and scoped to your organization, available as environment variables in sandbox sessions.

depot claude secrets add

Add a new secret to your organization. You'll be prompted to enter the secret value securely.

Example

# Add a secret interactively
depot claude secrets add GITHUB_TOKEN

# Add a secret with value (use with caution)
depot claude secrets add API_KEY --value "secret-value"

depot claude secrets list

List all secrets in your organization. Note that secret values are never displayed.

Example

depot claude secrets list

depot claude secrets remove

Remove a secret from your organization.

Example

depot claude secrets remove GITHUB_TOKEN

Flags for claude secrets

NameDescription
helpShow help for secrets command
orgOrganization ID
tokenDepot API token
valueSecret value (for add command only, prompted if not provided)