You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide covers authentication, configuration files, and common options for
10
13
running Claude Code in a sandboxed environment.
11
14
15
+
Official documentation: [Claude Code](https://code.claude.com/docs)
16
+
12
17
## Quick start
13
18
14
19
To create a sandbox and run Claude Code for a project directory:
@@ -17,6 +22,13 @@ To create a sandbox and run Claude Code for a project directory:
17
22
$ docker sandbox run claude ~/my-project
18
23
```
19
24
25
+
The workspace parameter is optional and defaults to the current directory:
26
+
27
+
```console
28
+
$ cd~/my-project
29
+
$ docker sandbox run claude
30
+
```
31
+
20
32
### Pass a prompt directly
21
33
22
34
Start Claude with a specific prompt:
@@ -35,7 +47,7 @@ This starts Claude and immediately processes the prompt.
35
47
36
48
## Authentication
37
49
38
-
Claude Code requires an Anthropic API key. You can authenticate using an environment variable (recommended) or through interactive login.
50
+
Claude Code requires an Anthropic API key. Credentials are scoped per sandbox.
39
51
40
52
### Environment variable (recommended)
41
53
@@ -66,15 +78,18 @@ The sandbox detects the environment variable and uses it automatically.
66
78
67
79
### Interactive authentication
68
80
69
-
If no credentials are found, Claude Code prompts you to authenticate interactively when it starts. You can also trigger the login flow manually using the `/login` command within Claude Code.
81
+
If the `ANTHROPIC_API_KEY` environment variable is not set, Claude Code prompts
82
+
you to authenticate interactively when it starts. You can also trigger the login
83
+
flow manually using the `/login` command within Claude Code.
70
84
71
85
When using interactive authentication:
72
86
73
-
- You'll need to authenticate for each workspace/sandbox separately
87
+
- You must authenticate each sandbox separately
74
88
- If the sandbox is removed or destroyed, you'll need to authenticate again when you recreate it
75
89
- Authentication sessions aren't persisted outside the sandbox
90
+
- No fallback authentication methods are used
76
91
77
-
To avoid repeated authentication, use the `ANTHROPIC_API_KEY` environment variable method described above.
92
+
To avoid repeated authentication, set the `ANTHROPIC_API_KEY` environment variable.
78
93
79
94
## Configuration
80
95
@@ -93,28 +108,13 @@ For example:
93
108
$ docker sandbox run <sandbox-name> -- --continue
94
109
```
95
110
96
-
See the [Claude Code CLI reference](https://docs.claude.com/en/docs/claude-code/cli-reference)
111
+
See the [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference)
97
112
for available options.
98
113
99
114
## Base image
100
115
101
-
The Claude Code sandbox template is a container image that runs inside the
0 commit comments