# Depot CLI: Agents commands reference (https://depot.dev/docs/cli/reference/agents)

Reference for all `depot claude` commands. To install the Depot CLI, see [Installation](/docs/cli/installation).

Other Depot product CLI references:

* [CLI overview and platform commands](/docs/cli/reference/overview)
* [Depot CI commands](/docs/cli/reference/depot-ci)
* [Container builds commands](/docs/cli/reference/container-builds)

## `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:

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

Resume an existing session:

```shell
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.

```shell
depot claude --local --session-id local-development
```

Work with a Git repository in the sandbox:

```shell
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.

```shell
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:

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

Use in a script with piped input:

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

### Flags for `claude`

{/* <!-- prettier-ignore-start --> */}

| Name         | Description                                                                                                          |
| ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `help`       | Show help for claude command                                                                                         |
| `local`      | Run Claude locally instead of in a remote sandbox                                                                    |
| `org`        | Organization ID (optional)                                                                                           |
| `output`     | Output format (json, csv)                                                                                            |
| `repository` | Git repository URL for remote context (format: [https://github.com/user/repo.git](https://github.com/user/repo.git)) |
| `branch`     | Git branch to use (defaults to main)                                                                                 |
| `git-secret` | Secret name containing Git credentials for private repositories if not using Depot Code app                          |
| `resume`     | Resume a session by ID                                                                                               |
| `session-id` | Custom session ID for saving                                                                                         |
| `token`      | Depot API token                                                                                                      |
| `wait`       | Wait for the remote Claude session to complete (by default exits after starting)                                     |

{/* <!-- prettier-ignore-end --> */}

## `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:

```shell
depot claude list-sessions
```

List sessions in JSON format:

```shell
depot claude list-sessions --output json
```

### Flags for `claude list-sessions`

{/* <!-- prettier-ignore-start --> */}

| Name     | Description                 |
| -------- | --------------------------- |
| `help`   | Show help for list-sessions |
| `org`    | Organization ID             |
| `output` | Output format (json, csv)   |
| `token`  | Depot API token             |

{/* <!-- prettier-ignore-end --> */}

## `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**

```shell
# 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**

```shell
depot claude secrets list
```

### `depot claude secrets remove`

Remove a secret from your organization.

**Example**

```shell
depot claude secrets remove GITHUB_TOKEN
```

### Flags for `claude secrets`

{/* <!-- prettier-ignore-start --> */}

| Name    | Description                                                   |
| ------- | ------------------------------------------------------------- |
| `help`  | Show help for secrets command                                 |
| `org`   | Organization ID                                               |
| `token` | Depot API token                                               |
| `value` | Secret value (for add command only, prompted if not provided) |

{/* <!-- prettier-ignore-end --> */}

## 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.