Skip to content

Commit 3a5d52a

Browse files
committed
Address PR review feedback: restructure templates, fix CLI commands, update naming
- Claude Code: rename template to 'claude', use JSON for resume section, update Custom System Prompt prose - Codex: document --skip-git-repo-check in prose - OpenCode: fix CLI to use 'opencode run', separate Launch Web UI and Build Custom Template sections - OpenClaw: add custom SKILLS.md example, separate Launch Gateway and Build Custom Template sections, remove from nav temporarily - Template examples: update claude-code command to use -p flag directly - docs.json: order pages alphabetically, remove openclaw temporarily - docs.mdx: remove Agents in Sandbox card from home page
1 parent c51f89d commit 3a5d52a

7 files changed

Lines changed: 218 additions & 140 deletions

File tree

docs.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@
5252
{
5353
"group": "Agents in Sandbox",
5454
"pages": [
55+
"docs/use-cases/agents/amp-code",
5556
"docs/use-cases/agents/claude-code",
56-
"docs/use-cases/agents/openclaw",
57-
"docs/use-cases/agents/opencode",
5857
"docs/use-cases/agents/codex",
59-
"docs/use-cases/agents/amp-code"
58+
"docs/use-cases/agents/opencode"
6059
]
6160
},
6261
{

docs.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ The documentation is split into three main sections:
6363
## Examples
6464

6565
<CardGroup cols={2}>
66-
<Card title="Agents in Sandbox" icon="robot" href="/docs/use-cases/agents/claude-code">
67-
Run Claude Code, OpenCode, AMP and other coding agents in secure E2B sandboxes.
68-
</Card>
69-
<Card title="Computer Use" icon="desktop" href="/docs/use-cases/computer-use">
66+
<Card title="Computer Use" icon="desktop" href="/docs/use-cases/computer-use">
7067
Build AI agents that see, understand, and control virtual Linux desktops using E2B Desktop sandboxes.
7168
</Card>
7269
<Card title="GitHub Actions CI/CD" icon="gears" href="/docs/use-cases/ci-cd">

docs/template/examples/claude-code.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Claude Code"
2+
title: "Claude"
33
description: "Claude Code Agent available in a sandbox"
44
---
55

@@ -85,7 +85,7 @@ console.log('Sandbox created', sbx.sandboxId)
8585

8686
// Run a prompt with Claude Code
8787
const result = await sbx.commands.run(
88-
`echo 'Create a hello world index.html' | claude -p --dangerously-skip-permissions`,
88+
`claude --dangerously-skip-permissions -p 'Create a hello world index.html'`,
8989
{ timeoutMs: 0 }
9090
)
9191

@@ -112,7 +112,7 @@ print("Sandbox created", sbx.sandbox_id)
112112

113113
# Run a prompt with Claude Code
114114
result = sbx.commands.run(
115-
"echo 'Create a hello world index.html' | claude -p --dangerously-skip-permissions",
115+
"claude --dangerously-skip-permissions -p 'Create a hello world index.html'",
116116
timeout=0,
117117
)
118118
print(result.stdout)

docs/use-cases/agents/claude-code.mdx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ description: "Run Claude Code in a secure E2B sandbox with full filesystem, term
44
icon: "/images/icons/claude-code.svg"
55
---
66

7-
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's agentic coding tool. E2B provides a pre-built `claude-code` template with Claude Code already installed.
7+
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's agentic coding tool. E2B provides a pre-built `claude` template with Claude Code already installed.
88

99
## CLI
1010

1111
Spin up a sandbox with the [E2B CLI](/docs/cli).
1212

1313
```bash
14-
e2b sbx create claude-code
14+
e2b sbx create claude
1515
```
1616

1717
Once inside the sandbox, start Claude Code.
@@ -28,7 +28,7 @@ Use `-p` for non-interactive mode and `--dangerously-skip-permissions` to auto-a
2828
```typescript JavaScript & TypeScript
2929
import { Sandbox } from 'e2b'
3030

31-
const sandbox = await Sandbox.create('claude-code', {
31+
const sandbox = await Sandbox.create('claude', {
3232
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
3333
})
3434

@@ -43,7 +43,7 @@ await sandbox.kill()
4343
import os
4444
from e2b import Sandbox
4545

46-
sandbox = Sandbox.create("claude-code", envs={
46+
sandbox = Sandbox.create("claude", envs={
4747
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
4848
})
4949

@@ -62,7 +62,7 @@ sandbox.kill()
6262
```typescript JavaScript & TypeScript
6363
import { Sandbox } from 'e2b'
6464

65-
const sandbox = await Sandbox.create('claude-code', {
65+
const sandbox = await Sandbox.create('claude', {
6666
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
6767
timeoutMs: 600_000,
6868
})
@@ -88,7 +88,7 @@ await sandbox.kill()
8888
import os
8989
from e2b import Sandbox
9090

91-
sandbox = Sandbox.create("claude-code", envs={
91+
sandbox = Sandbox.create("claude", envs={
9292
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
9393
}, timeout=600)
9494

@@ -119,7 +119,7 @@ Use `--output-format json` to get machine-readable responses — useful for buil
119119
```typescript JavaScript & TypeScript
120120
import { Sandbox } from 'e2b'
121121

122-
const sandbox = await Sandbox.create('claude-code', {
122+
const sandbox = await Sandbox.create('claude', {
123123
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
124124
})
125125

@@ -137,7 +137,7 @@ import os
137137
import json
138138
from e2b import Sandbox
139139

140-
sandbox = Sandbox.create("claude-code", envs={
140+
sandbox = Sandbox.create("claude", envs={
141141
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
142142
})
143143

@@ -160,7 +160,7 @@ Use `--output-format stream-json` to get a real-time JSONL event stream — incl
160160
```typescript JavaScript & TypeScript
161161
import { Sandbox } from 'e2b'
162162

163-
const sandbox = await Sandbox.create('claude-code', {
163+
const sandbox = await Sandbox.create('claude', {
164164
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
165165
})
166166

@@ -187,7 +187,7 @@ import os
187187
import json
188188
from e2b import Sandbox
189189

190-
sandbox = Sandbox.create("claude-code", envs={
190+
sandbox = Sandbox.create("claude", envs={
191191
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
192192
})
193193

@@ -218,19 +218,19 @@ Claude Code persists conversations that can be resumed with follow-up tasks usin
218218
```typescript JavaScript & TypeScript
219219
import { Sandbox } from 'e2b'
220220

221-
const sandbox = await Sandbox.create('claude-code', {
221+
const sandbox = await Sandbox.create('claude', {
222222
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
223223
timeoutMs: 600_000,
224224
})
225225

226226
// Start a new session
227227
const initial = await sandbox.commands.run(
228-
`cd /home/user/repo && claude --dangerously-skip-permissions --output-format stream-json -p "Analyze the codebase and create a refactoring plan"`
228+
`cd /home/user/repo && claude --dangerously-skip-permissions --output-format json -p "Analyze the codebase and create a refactoring plan"`
229229
)
230230

231-
// Extract session ID from the init event
232-
const initEvent = JSON.parse(initial.stdout.split('\n')[0])
233-
const sessionId = initEvent.session_id
231+
// Extract session ID from the JSON response
232+
const response = JSON.parse(initial.stdout)
233+
const sessionId = response.session_id
234234

235235
// Continue with a follow-up task
236236
const followUp = await sandbox.commands.run(
@@ -248,18 +248,18 @@ import os
248248
import json
249249
from e2b import Sandbox
250250

251-
sandbox = Sandbox.create("claude-code", envs={
251+
sandbox = Sandbox.create("claude", envs={
252252
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
253253
}, timeout=600)
254254

255255
# Start a new session
256256
initial = sandbox.commands.run(
257-
'cd /home/user/repo && claude --dangerously-skip-permissions --output-format stream-json -p "Analyze the codebase and create a refactoring plan"',
257+
'cd /home/user/repo && claude --dangerously-skip-permissions --output-format json -p "Analyze the codebase and create a refactoring plan"',
258258
)
259259

260-
# Extract session ID from the init event
261-
init_event = json.loads(initial.stdout.split("\n")[0])
262-
session_id = init_event["session_id"]
260+
# Extract session ID from the JSON response
261+
response = json.loads(initial.stdout)
262+
session_id = response["session_id"]
263263

264264
# Continue with a follow-up task
265265
follow_up = sandbox.commands.run(
@@ -276,13 +276,13 @@ sandbox.kill()
276276

277277
## Custom System Prompt
278278

279-
Use `--system-prompt` to provide task-specific instructions, or write a `CLAUDE.md` file into the sandbox for project context.
279+
Write a `CLAUDE.md` file into the sandbox for project context or use `--system-prompt` to provide task-specific instructions.
280280

281281
<CodeGroup>
282282
```typescript JavaScript & TypeScript
283283
import { Sandbox } from 'e2b'
284284

285-
const sandbox = await Sandbox.create('claude-code', {
285+
const sandbox = await Sandbox.create('claude', {
286286
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
287287
})
288288

@@ -304,7 +304,7 @@ await sandbox.kill()
304304
import os
305305
from e2b import Sandbox
306306

307-
sandbox = Sandbox.create("claude-code", envs={
307+
sandbox = Sandbox.create("claude", envs={
308308
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
309309
})
310310

@@ -332,7 +332,7 @@ Claude Code has built-in support for [MCP](https://modelcontextprotocol.io/). E2
332332
```typescript JavaScript & TypeScript
333333
import { Sandbox } from 'e2b'
334334

335-
const sandbox = await Sandbox.create('claude-code', {
335+
const sandbox = await Sandbox.create('claude', {
336336
envs: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
337337
mcp: {
338338
browserbase: {
@@ -360,7 +360,7 @@ await sandbox.kill()
360360
import os
361361
from e2b import Sandbox
362362

363-
sandbox = Sandbox.create("claude-code", envs={
363+
sandbox = Sandbox.create("claude", envs={
364364
"ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
365365
}, mcp={
366366
"browserbase": {
@@ -387,23 +387,23 @@ sandbox.kill()
387387

388388
## Build a Custom Template
389389

390-
If you need to customize the environment (e.g. pre-install dependencies, add config files), build your own template on top of the pre-built `claude-code` template.
390+
If you need to customize the environment (e.g. pre-install dependencies, add config files), build your own template on top of the pre-built `claude` template.
391391

392392
<CodeGroup>
393393
```typescript JavaScript & TypeScript
394394
// template.ts
395395
import { Template } from 'e2b'
396396

397397
export const template = Template()
398-
.fromTemplate('claude-code')
398+
.fromTemplate('claude')
399399
```
400400
```python Python
401401
# template.py
402402
from e2b import Template
403403

404404
template = (
405405
Template()
406-
.from_template("claude-code")
406+
.from_template("claude")
407407
)
408408
```
409409
</CodeGroup>
@@ -414,7 +414,7 @@ template = (
414414
import { Template, defaultBuildLogger } from 'e2b'
415415
import { template as claudeCodeTemplate } from './template'
416416

417-
await Template.build(claudeCodeTemplate, 'my-claude-code', {
417+
await Template.build(claudeCodeTemplate, 'my-claude', {
418418
cpuCount: 2,
419419
memoryMB: 2048,
420420
onBuildLogs: defaultBuildLogger(),
@@ -425,7 +425,7 @@ await Template.build(claudeCodeTemplate, 'my-claude-code', {
425425
from e2b import Template, default_build_logger
426426
from template import template as claude_code_template
427427

428-
Template.build(claude_code_template, "my-claude-code",
428+
Template.build(claude_code_template, "my-claude",
429429
cpu_count=2,
430430
memory_mb=2048,
431431
on_build_logs=default_build_logger(),

docs/use-cases/agents/codex.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ codex
2222

2323
## Run Headless
2424

25-
Use `codex exec` for non-interactive mode and `--full-auto` to auto-approve tool calls (safe inside E2B sandboxes). Pass `CODEX_API_KEY` as an environment variable.
25+
Use `codex exec` for non-interactive mode and `--full-auto` to auto-approve tool calls (safe inside E2B sandboxes). Pass `--skip-git-repo-check` to bypass git directory ownership checks inside the sandbox. Pass `CODEX_API_KEY` as an environment variable.
2626

2727
<CodeGroup>
2828
```typescript JavaScript & TypeScript

0 commit comments

Comments
 (0)