Claude Code Sandbox

A sandbox configuration for e2b workflows.

Sandbox configuratione2bMIT1 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/sandbox/e2b/claude-code-sandbox.md

# E2B Claude Code Sandbox

Execute Claude Code in an isolated E2B cloud sandbox environment.

## Description

This component sets up E2B (E2B.dev) integration to run Claude Code in a secure, isolated cloud environment. Perfect for executing code safely without affecting your local system.

## Features

- **Isolated Execution**: Run Claude Code in a secure cloud sandbox
- **Pre-configured Environment**: Ships with Claude Code already installed
- **API Integration**: Seamless connection to Anthropic's Claude API
- **Safe Code Execution**: Execute prompts without local system risks
- **Component Installation**: Automatically installs any components specified with CLI flags

## Requirements

- E2B API Key (get from https://e2b.dev/dashboard)
- Anthropic API Key
- Python 3.11+ (for E2B SDK)

## Usage

```bash
# Execute a prompt in E2B sandbox (requires API keys as environment variables or CLI parameters)
npx claude-code-templates@latest --sandbox e2b --prompt "Create a React todo app"

# Pass API keys directly as parameters
npx claude-code-templates@latest --sandbox e2b \
  --e2b-api-key your_e2b_key \
  --anthropic-api-key your_anthropic_key \
  --prompt "Create a React todo app"

# Install components and execute in sandbox
npx claude-code-templates@latest --sandbox e2b \
  --agent frontend-developer \
  --command setup-react \
  --e2b-api-key your_e2b_key \
  --anthropic-api-key your_anthropic_key \
  --prompt "Create a modern todo app with TypeScript"
```

## Environment Setup

The component will create:
- `.claude/sandbox/e2b-launcher.py` - Python script to launch E2B sandbox
- `.claude/sandbox/requirements.txt` - Python dependencies  
- `.claude/sandbox/.env.example` - Environment variables template

## API Key Configuration

You can provide API keys in two ways:

### Option 1: CLI Parameters (Recommended)
```bash
# Pass keys directly as command parameters
npx claude-code-templates@latest --sandbox e2b \
  --e2b-api-key your_e2b_api_key \
  --anthropic-api-key your_anthropic_api_key \
  --prompt "Your prompt here"
```

### Option 2: Environment Variables
Set these environment variables in your shell or `.env` file:
```bash
export E2B_API_KEY=your_e2b_api_key_here
export ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Or create .claude/sandbox/.env file:
E2B_API_KEY=your_e2b_api_key_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here
```

**Note**: CLI parameters take precedence over environment variables.

## How it Works

1. Creates E2B sandbox with `anthropic-claude-code` template
2. Installs any specified components (agents, commands, etc.)
3. Executes your prompt using Claude Code inside the sandbox
4. Returns the complete output and any generated files
5. Automatically cleans up the sandbox after execution

## Security Benefits

- **Isolation**: Code runs in a separate cloud environment
- **No Local Impact**: No risk to your local system or files
- **Temporary**: Sandbox is destroyed after execution
- **Controlled**: Only specified components and prompts are executed

## Examples

```bash
# Simple web app creation
npx claude-code-templates@latest --sandbox e2b --prompt "Create an HTML page with CSS animations"

# Full stack development
npx claude-code-templates@latest --sandbox e2b --agent fullstack-developer --prompt "Create a Node.js API with authentication"

# Data analysis
npx claude-code-templates@latest --sandbox e2b --agent data-scientist --prompt "Analyze this CSV data and create visualizations"
```

## Template Information

- **Provider**: E2B (https://e2b.dev)
- **Base Template**: anthropic-claude-code
- **Timeout**: 5 minutes (configurable)
- **Environment**: Ubuntu with Claude Code pre-installed

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: a4576346432cb473852e010f0d3baa333b58a695aa569e1d79f61130abc5dc6b. Files are served as downloads and are never executed by this page.