claude-code-templates Documentation

CLI tool for configuring and monitoring Claude Code

30,218 stars Python Python 1 file ยท ~12,309 tokens #anthropic#anthropic-claude#claude#claude-code
RAW Doc

1. Project Overview & Quickstart (davila7/claude-code-templates)

File: README.md











Sponsored by [Bright Data](https://get.brightdata.com/lcqorc6nzp9w)

bash
# Install the Bright Data Skills + MCP for Claude Code
npx claude-code-templates@latest --skill web-data/search,web-data/scrape,web-data/data-feeds,web-data/bright-data-mcp,web-data/bright-data-best-practices,development/brightdata-local-search --mcp web-data/brightdata --yes

Claude Code Templates ([aitmpl.com](https://aitmpl.com))

Ready-to-use configurations for Anthropic's Claude Code. A comprehensive collection of AI agents, custom commands, settings, hooks, external integrations (MCPs), and project templates to enhance your development workflow.

Browse & Install Components and Templates

Browse All Templates - Interactive web interface to explore and install 100+ agents, commands, settings, hooks, and MCPs.

๐Ÿš€ Quick Installation

bash
# Install a complete development stack
npx claude-code-templates@latest --agent development-team/frontend-developer --command testing/generate-tests --mcp development/github-integration --yes

# Browse and install interactively
npx claude-code-templates@latest

# Install specific components
npx claude-code-templates@latest --agent development-tools/code-reviewer --yes
npx claude-code-templates@latest --command performance/optimize-bundle --yes
npx claude-code-templates@latest --setting performance/mcp-timeouts --yes
npx claude-code-templates@latest --hook git/pre-commit-validation --yes
npx claude-code-templates@latest --mcp database/postgresql-integration --yes

What You Get

Component Description Examples
๐Ÿค– Agents AI specialists for specific domains Security auditor, React performance optimizer, database architect
โšก Commands Custom slash commands /generate-tests, /optimize-bundle, /check-security
๐Ÿ”Œ MCPs External service integrations GitHub, PostgreSQL, Stripe, AWS, OpenAI
โš™๏ธ Settings Claude Code configurations Timeouts, memory settings, output styles
๐Ÿช Hooks Automation triggers Pre-commit validation, post-completion actions
๐ŸŽจ Skills Reusable capabilities with progressive disclosure PDF processing, Excel automation, custom workflows

๐Ÿ› ๏ธ Additional Tools

Beyond the template catalog, Claude Code Templates includes powerful development tools:

๐Ÿ“Š Claude Code Analytics

Monitor your AI-powered development sessions in real-time with live state detection and performance metrics.

bash
npx claude-code-templates@latest --analytics

๐Ÿ’ฌ Conversation Monitor

Mobile-optimized interface to view Claude responses in real-time with secure remote access.

bash
# Local access
npx claude-code-templates@latest --chats

# Secure remote access via Cloudflare Tunnel
npx claude-code-templates@latest --chats --tunnel

๐Ÿ” Health Check

Comprehensive diagnostics to ensure your Claude Code installation is optimized.

bash
npx claude-code-templates@latest --health-check

๐Ÿ”Œ Plugin Dashboard

View marketplaces, installed plugins, and manage permissions from a unified interface.

bash
npx claude-code-templates@latest --plugins

๐Ÿ“– Documentation

๐Ÿ“š docs.aitmpl.com - Complete guides, examples, and API reference for all components and tools.

Contributing

We welcome contributions! Browse existing templates to see what's available, then check our contributing guidelines to add your own agents, commands, MCPs, settings, or hooks.

Please read our Code of Conduct before contributing.

Attribution

This collection includes components from multiple sources:

Scientific Skills:

Official Anthropic:

Community Skills & Agents:

  • obra/superpowers by Jesse Obra - MIT License (14 workflow skills)
  • alirezarezvani/claude-skills by Alireza Rezvani - MIT License (36 professional role skills)
  • wshobson/agents by wshobson - MIT License (48 agents)
  • NerdyChefsAI Skills - Community contribution - MIT License (specialized enterprise skills)

Commands & Tools:

Each of these resources retains its original license and attribution, as defined by their respective authors.
We respect and credit all original creators for their work and contributions to the Claude ecosystem.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Stargazers over time


โญ Found this useful? Give us a star to support the project!


File: cli-tool/components/sandbox/docker/README.md

Docker Claude Code Sandbox

Execute Claude Code in isolated Docker containers with AI-powered code generation using the Claude Agent SDK.

Quick Start

1. Install Docker

Ensure Docker is installed and running on your system:

bash
# Check Docker installation
docker --version

# Verify Docker daemon is running
docker ps

If Docker is not installed, visit: https://docs.docker.com/get-docker/

2. Configure API Key

Set your Anthropic API key:

bash
# Set as environment variable
export ANTHROPIC_API_KEY=sk-ant-your-api-key-here

# Or pass directly when using the CLI
npx claude-code-templates@latest --sandbox docker \
  --agent development/frontend-developer \
  --prompt "Create a React component" \
  --anthropic-api-key sk-ant-your-key

3. Run Your First Sandbox

bash
# Basic execution
npx claude-code-templates@latest --sandbox docker \
  --prompt "Write a function to calculate factorial"

# With specific agent
npx claude-code-templates@latest --sandbox docker \
  --agent development/python-developer \
  --prompt "Create a data validation script"

# With multiple components
npx claude-code-templates@latest --sandbox docker \
  --agent development/fullstack-developer \
  --command development/setup-testing \
  --prompt "Set up a complete testing environment"

Architecture

This sandbox combines two powerful technologies:

  1. Claude Agent SDK - Provides programmatic access to Claude Code
  2. Docker - Provides isolated container execution
text
User Prompt โ†’ Docker Launcher โ†’ Container Build โ†’ Execute Script โ†’ Claude Agent SDK โ†’ Output Files

Components

text
docker/
โ”œโ”€โ”€ docker-launcher.js   # Node.js launcher that orchestrates Docker
โ”œโ”€โ”€ Dockerfile           # Container definition with Claude Agent SDK
โ”œโ”€โ”€ execute.js           # Script that runs inside container
โ”œโ”€โ”€ package.json         # Dependencies (Claude Agent SDK)
โ””โ”€โ”€ README.md           # This file

How It Works

1. Launcher Phase (docker-launcher.js)

  • Checks Docker installation and daemon status
  • Builds container image if it doesn't exist
  • Prepares environment variables and volume mounts
  • Launches container with user prompt

2. Container Phase (execute.js)

  • Installs requested components (agents, commands, MCPs, etc.)
  • Executes Claude Agent SDK with the user's prompt
  • Auto-allows all tool uses (no permission prompts)
  • Captures output and generated files
  • Copies results to mounted output directory

3. Output Phase

  • Generated files are saved to output/ directory
  • Files preserve directory structure
  • Accessible on host machine for inspection

Usage Examples

Simple Code Generation

bash
npx claude-code-templates@latest --sandbox docker \
  --prompt "Create a REST API server with Express.js"

With Specific Agent

bash
npx claude-code-templates@latest --sandbox docker \
  --agent security/security-auditor \
  --prompt "Audit this codebase for security vulnerabilities"

Multiple Components

bash
npx claude-code-templates@latest --sandbox docker \
  --agent development/frontend-developer \
  --command testing/setup-testing \
  --setting performance/performance-optimization \
  --prompt "Create a React app with testing setup"

Development Workflow

bash
# 1. Generate initial code
npx claude-code-templates@latest --sandbox docker \
  --agent development/fullstack-developer \
  --prompt "Create a blog API with authentication"

# 2. Check output
ls -la output/

# 3. Iterate on generated code
npx claude-code-templates@latest --sandbox docker \
  --prompt "Add pagination to the blog API"

Configuration

Environment Variables

Required:

  • ANTHROPIC_API_KEY - Your Anthropic API key

Optional:

  • DOCKER_BUILDKIT=1 - Enable BuildKit for faster builds

Docker Image Details

The Docker image (claude-sandbox) includes:

  • Base: Node.js 22 Alpine Linux (minimal, secure)
  • Runtime: Git, Bash, Python3, Pip, Curl
  • Claude SDK: @anthropic-ai/claude-agent-sdk installed globally
  • Security: Runs as non-root user (UID 10001)
  • Working Directory: /app
  • Output Directory: /output (mounted as volume)

Build Configuration

Edit Dockerfile to customize:

dockerfile
# Add additional system dependencies
RUN apk --no-cache add postgresql-client redis

# Install additional global npm packages
RUN npm install typescript tsx

# Set custom environment variables
ENV CUSTOM_VAR=value

Command Reference

Build Image Manually

bash
cd .claude/sandbox/docker
docker build -t claude-sandbox .

Run Container Directly

bash
docker run --rm \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  -v $(pwd)/output:/output \
  claude-sandbox \
  node /app/execute.js "Your prompt here" ""

Clean Up

bash
# Remove built image
docker rmi claude-sandbox

# Remove all stopped containers
docker container prune

# Remove dangling images
docker image prune

Troubleshooting

Docker Not Found

Error: Docker is not installed

Solution:

bash
# Install Docker from official site
# macOS: https://docs.docker.com/desktop/install/mac-install/
# Linux: https://docs.docker.com/engine/install/
# Windows: https://docs.docker.com/desktop/install/windows-install/

Docker Daemon Not Running

Error: Docker daemon is not running

Solution:

bash
# macOS/Windows: Start Docker Desktop application
# Linux: sudo systemctl start docker

API Key Not Set

Error: ANTHROPIC_API_KEY environment variable is required

Solution:

bash
export ANTHROPIC_API_KEY=sk-ant-your-key-here

Build Failures

Error: Failed to build Docker image

Solution:

bash
# Check Docker logs
docker logs <container-id>

# Rebuild from scratch
docker build --no-cache -t claude-sandbox .

# Check disk space
docker system df

Permission Issues

Error: Permission denied when accessing output files

Solution:

bash
# Check output directory permissions
ls -la output/

# Fix permissions (if needed)
sudo chown -R $USER:$USER output/

Container Execution Failures

Error: Container failed with code 1

Solution:

bash
# Run container interactively for debugging
docker run -it --rm \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  claude-sandbox \
  /bin/bash

# Check container logs
docker logs <container-id>

Performance Tips

  1. Image Caching: First build takes longer, subsequent builds are fast
  2. Volume Mounts: Use volumes instead of COPY for faster iteration
  3. Layer Optimization: Group RUN commands to reduce image layers
  4. BuildKit: Enable for parallel builds (DOCKER_BUILDKIT=1)
  5. Prune Regularly: Clean up unused images and containers

Security

  • Isolation: Containers are isolated from host system
  • Non-root User: Execution runs as sandboxuser (UID 10001)
  • No Network: Container has no internet access (except during build)
  • Read-only: Host filesystem is mounted read-only
  • Resource Limits: Docker enforces CPU and memory limits
  • Secret Management: API keys are passed as environment variables (not stored in image)

Cost Estimation

Docker:

  • Free and open-source
  • No cloud costs (runs locally)
  • Resource usage: ~500MB disk space, ~512MB RAM during execution

Anthropic API:

  • Claude Sonnet 4.5: ~$3 per million input tokens
  • Average request: ~200 tokens = $0.0006 per request

Example costs for 100 executions:

  • Docker: $0 (local execution)
  • Anthropic: ~$0.06 (avg 200 tokens/request)
  • Total: ~$0.06

Comparison with Other Providers

Feature Docker E2B Cloudflare
Execution Location ๐Ÿ  Local โ˜๏ธ Cloud ๐ŸŒ Edge
Setup Complexity Medium Easy Easy
Internet Required Setup only Yes Yes
Cost Free Paid Paid
Privacy Full control Third-party Third-party
Offline Support Yes No No
Best For Local dev, privacy, offline Full stack projects Serverless, global APIs

Development

Project Structure

text
docker/
โ”œโ”€โ”€ docker-launcher.js   # Orchestrates container lifecycle
โ”‚   โ”œโ”€โ”€ checkDockerInstalled()
โ”‚   โ”œโ”€โ”€ checkDockerRunning()
โ”‚   โ”œโ”€โ”€ buildDockerImage()
โ”‚   โ””โ”€โ”€ runDockerContainer()
โ”œโ”€โ”€ Dockerfile           # Container definition
โ”‚   โ”œโ”€โ”€ Base image (Node 22 Alpine)
โ”‚   โ”œโ”€โ”€ System dependencies
โ”‚   โ”œโ”€โ”€ Claude Agent SDK
โ”‚   โ””โ”€โ”€ Security (non-root user)
โ”œโ”€โ”€ execute.js           # Execution script (runs in container)
โ”‚   โ”œโ”€โ”€ installComponents()
โ”‚   โ”œโ”€โ”€ executeQuery()
โ”‚   โ””โ”€โ”€ copyGeneratedFiles()
โ”œโ”€โ”€ package.json         # NPM dependencies
โ””โ”€โ”€ README.md           # Documentation

Scripts

bash
# Build image
npm run build

# Clean image
npm run clean

Extending the Image

Add custom tools to the Dockerfile:

dockerfile
# Install Python packages
RUN pip install --no-cache-dir pandas numpy matplotlib

# Install Node.js packages globally
RUN npm install typescript eslint prettier

# Add custom scripts
COPY scripts/ /app/scripts/

Advanced Usage

Custom Dockerfile

Create a custom Dockerfile for specialized environments:

dockerfile
FROM node:22-alpine

# Install database clients
RUN apk add --no-cache postgresql-client mysql-client

# Install development tools
RUN apk add --no-cache vim nano tmux

# Install Claude Agent SDK
RUN npm install @anthropic-ai/claude-agent-sdk

# ... rest of configuration

Multi-stage Builds

Optimize image size with multi-stage builds:

dockerfile
# Build stage
FROM node:22-alpine AS builder
WORKDIR /build
COPY package*.json ./
RUN npm ci --only=production

# Runtime stage
FROM node:22-alpine
COPY --from=builder /build/node_modules ./node_modules
# ... rest of configuration

Persistent Storage

Mount additional volumes for persistent data:

bash
docker run --rm \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  -v $(pwd)/output:/output \
  -v $(pwd)/cache:/cache \
  claude-sandbox

Resources

License

MIT License - See LICENSE file for details

Support

For issues and questions:

  1. Check Docker installation: docker --version && docker ps
  2. Verify API key: echo $ANTHROPIC_API_KEY
  3. Check container logs: docker logs <container-id>
  4. Review output directory: ls -la output/
  5. Open an issue on GitHub

Built with โค๏ธ using Docker, Node.js, and Claude Agent SDK


File: cli-tool/components/sandbox/cloudflare/README.md

Cloudflare Claude Code Sandbox

Execute Claude Code in isolated Cloudflare Workers sandboxes with AI-powered code generation.

Quick Start

1. Install Dependencies

bash
npm install

2. Configure API Key

bash
# For local development, create .dev.vars:
echo "ANTHROPIC_API_KEY=your-api-key-here" > .dev.vars

# For production, use wrangler secrets:
npx wrangler secret put ANTHROPIC_API_KEY

3. Local Development

bash
# Start development server (requires Docker)
npm run dev

# In another terminal, test the endpoint:
curl -X POST http://localhost:8787/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "What is the 10th Fibonacci number?"}'

4. Deploy to Cloudflare

bash
# Deploy worker
npx wrangler deploy

# Wait 2-3 minutes for container provisioning
npx wrangler containers list

# Test production endpoint
curl -X POST https://your-worker.your-subdomain.workers.dev/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "Calculate factorial of 5"}'

Architecture

This sandbox combines three powerful technologies:

  1. Claude AI (Anthropic) - Generates executable code from natural language
  2. Cloudflare Workers - Runs at the edge for global low-latency access
  3. Sandbox SDK - Provides isolated container execution
text
User Question โ†’ Cloudflare Worker โ†’ Claude AI โ†’ Generated Code โ†’ Sandbox โ†’ Results

API Reference

POST /execute

Execute a natural language question as code.

Request:

json
{
  "question": "What is the 100th Fibonacci number?",
  "maxTokens": 2048,          // Optional: Max tokens for code generation
  "timeout": 30000,            // Optional: Execution timeout in ms
  "language": "python"         // Optional: "python" or "javascript"
}

Response:

json
{
  "success": true,
  "question": "What is the 100th Fibonacci number?",
  "code": "def fibonacci(n):\n    if n <= 1:\n        return n\n    return fibonacci(n-1) + fibonacci(n-2)\n\nprint(fibonacci(100))",
  "output": "354224848179261915075\n",
  "error": "",
  "sandboxId": "user-1234567890-abc123",
  "executionTime": 2147
}

GET /health

Check worker health status.

Response:

json
{
  "status": "healthy",
  "timestamp": "2025-10-19T12:00:00.000Z",
  "worker": "cloudflare-claude-sandbox"
}

Command Line Tools

Launcher

Execute prompts directly from command line:

bash
# Basic usage
node launcher.ts "Calculate factorial of 5"

# With custom worker URL
node launcher.ts "Fibonacci 10" "" your_api_key https://your-worker.workers.dev

# With components
node launcher.ts "Create a React app" "--agent frontend-developer" your_api_key

Monitor

Monitor execution with detailed metrics:

bash
# Monitor execution
node monitor.ts "Calculate factorial of 5" your_api_key

# Monitor production worker
node monitor.ts "Sum array" your_api_key https://your-worker.workers.dev

Examples

Mathematical Calculations

bash
curl -X POST http://localhost:8787/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "What is the factorial of 20?"}'

String Manipulation

bash
curl -X POST http://localhost:8787/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "Reverse the string Hello World"}'

Data Analysis

bash
curl -X POST http://localhost:8787/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "Calculate the mean of [10, 20, 30, 40, 50]"}'

JavaScript Execution

bash
curl -X POST http://localhost:8787/execute \
  -H "Content-Type: application/json" \
  -d '{
    "question": "Sort an array of numbers",
    "language": "javascript"
  }'

Configuration

Environment Variables

Local Development (.dev.vars):

bash
ANTHROPIC_API_KEY=sk-ant-your-key-here

Production (Wrangler Secrets):

bash
npx wrangler secret put ANTHROPIC_API_KEY

Wrangler Configuration

Edit wrangler.toml to customize:

toml
# Worker name (must be unique)
name = "my-custom-sandbox"

# Resource limits
[limits]
cpu_ms = 100  # CPU time per request

# Environment-specific configuration
[env.production]
vars = { ENVIRONMENT = "production" }

Troubleshooting

Container Not Ready

After first deployment, wait 2-3 minutes:

bash
npx wrangler containers list

Docker Issues (Local Development)

Ensure Docker is running:

bash
docker ps

API Key Not Set

For local development:

bash
echo "ANTHROPIC_API_KEY=your-key" > .dev.vars

For production:

bash
npx wrangler secret put ANTHROPIC_API_KEY

View Logs

bash
# Real-time logs
npx wrangler tail

# Pretty formatted
npx wrangler tail --format=pretty

Performance Tips

  1. Use specific prompts: More specific questions generate faster code
  2. Implement caching: Cache generated code for common questions
  3. Stream output: Use streaming for long-running operations
  4. Set appropriate timeouts: Balance between UX and resource usage
  5. Monitor metrics: Use the monitor tool to identify bottlenecks

Security

  • Sandboxes are isolated containers with no network access
  • Code execution is limited by timeout (default 30s)
  • CPU and memory limits are enforced by Cloudflare
  • API keys are stored as encrypted Wrangler secrets
  • CORS is enabled for browser access (configure as needed)

Cost Estimation

Cloudflare Workers:

  • Free tier: 100,000 requests/day (limited Durable Objects)
  • Paid plan ($5/month): 10M requests/month + unlimited Durable Objects

Anthropic API:

  • Claude Sonnet 4.5: ~$3 per million input tokens
  • Average request: ~200 tokens = $0.0006 per request

Example costs for 10,000 requests/month:

  • Cloudflare: $5/month (paid plan)
  • Anthropic: ~$6/month (avg 200 tokens/request)
  • Total: ~$11/month

Development

Project Structure

text
cloudflare-claude-sandbox/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ index.ts           # Worker source code
โ”œโ”€โ”€ launcher.ts            # CLI launcher tool
โ”œโ”€โ”€ monitor.ts             # Monitoring tool
โ”œโ”€โ”€ wrangler.toml          # Cloudflare configuration
โ”œโ”€โ”€ package.json           # Dependencies
โ”œโ”€โ”€ tsconfig.json          # TypeScript config
โ””โ”€โ”€ README.md              # This file

Scripts

  • npm run dev - Start local development server
  • npm run deploy - Deploy to Cloudflare
  • npm run tail - View real-time logs
  • npm run launch - Run launcher tool
  • npm run monitor - Run monitoring tool
  • npm run type-check - Check TypeScript types
  • npm test - Run tests

Resources

License

MIT License - See LICENSE file for details

Support

For issues and questions:

  1. Check the debugging guide
  2. Run the monitor tool for detailed metrics
  3. Check Cloudflare worker logs: npx wrangler tail
  4. Open an issue on GitHub

Built with โค๏ธ using Cloudflare Workers, Claude AI, and the Sandbox SDK


File: cli-tool/components/sandbox/README.md

Claude Code Sandbox Components

Execute Claude Code in isolated cloud environments for secure code generation and development.

Available Sandbox Providers

E2B Sandbox (`e2b`)

Run Claude Code in E2B's secure cloud environment with pre-configured development tools.

Component: e2b/claude-code-sandbox.md

Files Created:

  • .claude/sandbox/e2b-launcher.py - Python launcher script
  • .claude/sandbox/requirements.txt - Python dependencies
  • .claude/sandbox/.env.example - Environment variables template

Cloudflare Sandbox (`cloudflare`)

Execute AI-powered code in Cloudflare Workers with global edge deployment and sub-second cold starts.

Component: cloudflare/claude-code-sandbox.md

Files Created:

  • .claude/sandbox/cloudflare/src/index.ts - Cloudflare Worker source
  • .claude/sandbox/cloudflare/launcher.ts - TypeScript launcher
  • .claude/sandbox/cloudflare/monitor.ts - Monitoring tool
  • .claude/sandbox/cloudflare/wrangler.toml - Cloudflare configuration
  • .claude/sandbox/cloudflare/package.json - Dependencies
  • .claude/sandbox/cloudflare/README.md - Complete documentation

Quick Start

E2B Sandbox

bash
# Simple execution with API keys as parameters (recommended)
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"

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

# Or use environment variables (set E2B_API_KEY and ANTHROPIC_API_KEY)
npx claude-code-templates@latest --sandbox e2b --prompt "Create a React todo app"

Cloudflare Sandbox

bash
# Execute via deployed Cloudflare Worker
npx claude-code-templates@latest --sandbox cloudflare \
  --anthropic-api-key your_anthropic_key \
  --prompt "Calculate the 10th Fibonacci number"

# Local development and deployment
cd .claude/sandbox/cloudflare
npm install
npx wrangler secret put ANTHROPIC_API_KEY
npx wrangler deploy

# Test your deployment
curl -X POST https://your-worker.workers.dev/execute \
  -H "Content-Type: application/json" \
  -d '{"question": "Calculate factorial of 5"}'

Environment Setup

  1. Get API Keys:

  2. Create Environment File:

    bash
    # In your project/.claude/sandbox/.env
    E2B_API_KEY=your_e2b_api_key_here
    ANTHROPIC_API_KEY=your_anthropic_api_key_here
  3. Install Python Requirements (handled automatically):

    • Python 3.11+
    • E2B Python SDK
    • python-dotenv

How It Works

  1. Component Download: Downloads sandbox launcher and requirements
  2. Environment Check: Validates Python 3.11+ installation
  3. Dependencies: Installs E2B Python SDK automatically
  4. Sandbox Creation: Creates E2B sandbox with Claude Code template
  5. Component Installation: Installs any specified agents/commands/mcps/settings/hooks inside sandbox
  6. Prompt Execution: Runs your prompt through Claude Code in the isolated environment
  7. Result Display: Shows complete output and generated files
  8. Cleanup: Automatically destroys sandbox after execution

Usage Examples

Basic Web Development

bash
npx claude-code-templates@latest --sandbox e2b --prompt "Create an HTML page with modern CSS animations"

Full Stack with Components

bash
npx claude-code-templates@latest --sandbox e2b \
  --agent fullstack-developer \
  --command setup-node \
  --prompt "Create a Node.js API with JWT authentication"

Data Analysis

bash
npx claude-code-templates@latest --sandbox e2b \
  --agent data-scientist \
  --prompt "Analyze this CSV data and create visualizations"

Security Audit

bash
npx claude-code-templates@latest --sandbox e2b \
  --agent security-auditor \
  --command security-audit \
  --prompt "Review this codebase for security vulnerabilities"

Security Benefits

  • โœ… Complete Isolation: Code runs in separate cloud environment
  • โœ… No Local Impact: Zero risk to your local system or files
  • โœ… Temporary Environment: Sandbox destroyed after execution
  • โœ… Controlled Access: Only specified components are installed
  • โœ… API Key Security: Keys never leave your local environment

Future Sandbox Providers

โœ… Production Ready Features (v1.20.3+)

Enhanced E2B Integration

  • Automatic File Download: Generated files are automatically downloaded to local ./e2b-output/ directory
  • Extended Timeouts: 15-minute sandbox lifetime with intelligent timeout management
  • Detailed Logging: Step-by-step execution monitoring with debugging information
  • Environment Verification: Automatic checks for Claude Code installation and permissions
  • Error Recovery: Retry logic for connection issues and comprehensive error handling

Advanced Debugging Tools

  • Real-time Monitor (e2b-monitor.py): System resource monitoring and performance analysis
  • Debug Guide (SANDBOX_DEBUGGING.md): Comprehensive troubleshooting documentation
  • Sandbox State Tracking: Live monitoring of file system changes and process execution

The system is designed to support multiple sandbox providers:

  • E2B (--sandbox e2b) - โœ… Fully Implemented - Cloud-based isolated execution environment with full Linux access
  • Cloudflare (--sandbox cloudflare) - โœ… Fully Implemented - Edge-based sandbox with global deployment and AI code execution
  • Docker (--sandbox docker) - ๐Ÿ”„ Future - Local containerized execution
  • AWS CodeBuild (--sandbox aws) - ๐Ÿ”„ Future - AWS-based sandbox environment
  • GitHub Codespaces (--sandbox github) - ๐Ÿ”„ Future - GitHub's cloud development environment
  • Custom (--sandbox custom) - ๐Ÿ”„ Future - User-defined sandbox configurations

Sandbox Comparison

Feature E2B Cloudflare Best For
Cold Start 2-3 seconds ~100ms Cloudflare for speed
Max Duration Hours 30 seconds (Workers) E2B for long tasks
Environment Full Linux VM V8 isolates + containers E2B for flexibility
Languages Any (full OS) Python, Node.js E2B for variety
Global Distribution Single region Edge network Cloudflare for latency
Pricing Model Usage-based $5/month flat Depends on volume
Setup Complexity Low Medium E2B for simplicity
Local Development Cloud only Docker required E2B for quick start
Claude Integration Native template API-based E2B for turnkey
File Downloads Automatic API-based E2B for ease

Troubleshooting

Python Not Found

bash
# Install Python 3.11+
brew install python3  # macOS
# or visit https://python.org/downloads

API Keys Not Set

bash
# Create .env file in .claude/sandbox/
echo "E2B_API_KEY=your_key_here" >> .claude/sandbox/.env
echo "ANTHROPIC_API_KEY=your_key_here" >> .claude/sandbox/.env

Dependencies Installation Failed

bash
# Manual installation
cd .claude/sandbox
pip3 install -r requirements.txt

Component Architecture

text
claude-code-templates/
โ””โ”€โ”€ cli-tool/
    โ””โ”€โ”€ components/
        โ””โ”€โ”€ sandbox/
            โ”œโ”€โ”€ e2b/                              # E2B provider
            โ”‚   โ”œโ”€โ”€ claude-code-sandbox.md        # Component documentation
            โ”‚   โ”œโ”€โ”€ e2b-launcher.py               # Python launcher script
            โ”‚   โ”œโ”€โ”€ e2b-monitor.py                # Monitoring tool
            โ”‚   โ”œโ”€โ”€ requirements.txt              # Python dependencies
            โ”‚   โ”œโ”€โ”€ SANDBOX_DEBUGGING.md          # Debug guide
            โ”‚   โ””โ”€โ”€ .env.example                  # Environment template
            โ”œโ”€โ”€ cloudflare/                       # Cloudflare provider
            โ”‚   โ”œโ”€โ”€ claude-code-sandbox.md        # Component documentation
            โ”‚   โ”œโ”€โ”€ src/
            โ”‚   โ”‚   โ””โ”€โ”€ index.ts                  # Worker source code
            โ”‚   โ”œโ”€โ”€ launcher.ts                   # TypeScript launcher
            โ”‚   โ”œโ”€โ”€ monitor.ts                    # Monitoring tool
            โ”‚   โ”œโ”€โ”€ wrangler.toml                 # Cloudflare config
            โ”‚   โ”œโ”€โ”€ package.json                  # Dependencies
            โ”‚   โ”œโ”€โ”€ tsconfig.json                 # TypeScript config
            โ”‚   โ”œโ”€โ”€ README.md                     # Documentation
            โ”‚   โ”œโ”€โ”€ QUICKSTART.md                 # Quick start guide
            โ”‚   โ”œโ”€โ”€ SANDBOX_DEBUGGING.md          # Debug guide
            โ”‚   โ””โ”€โ”€ .dev.vars.example             # Environment template
            โ”œโ”€โ”€ docker/                           # Future: Docker provider
            โ”œโ”€โ”€ aws/                              # Future: AWS provider
            โ””โ”€โ”€ README.md                         # This file

The sandbox system integrates seamlessly with the existing Claude Code Templates component architecture, allowing any combination of agents, commands, MCPs, settings, and hooks to be installed and used within the secure sandbox environment.

Choosing the Right Sandbox

Use E2B when you need:

  • โœ… Long-running operations (hours)
  • โœ… Full Linux environment access
  • โœ… Quick setup with minimal configuration
  • โœ… Multiple programming languages
  • โœ… Automatic file downloads
  • โœ… Native Claude Code integration

Use Cloudflare when you need:

  • โœ… Sub-second cold starts
  • โœ… Global edge distribution
  • โœ… Predictable flat-rate pricing
  • โœ… High request volume
  • โœ… Python/Node.js execution
  • โœ… Production-grade reliability

File: cli-tool/components/commands/documentation/create-architecture-documentation.md


allowed-tools: Read, Write, Edit, Bash argument-hint: "[framework] | --c4-model | --arc42 | --adr | --plantuml | --full-suite"

Architecture Documentation Generator

Generate comprehensive architecture documentation: $ARGUMENTS

Current Architecture Context

  • Project structure: !find . -type f -name "*.json" -o -name "*.yaml" -o -name "*.toml" | head -5
  • Documentation exists: @docs/ or @README.md (if exists)
  • Architecture files: !find . -name "*architecture*" -o -name "*design*" -o -name "*.puml" | head -3
  • Services/containers: @docker-compose.yml or @k8s/ (if exists)
  • API definitions: !find . -name "*api*" -o -name "*openapi*" -o -name "*swagger*" | head -3

Task

Generate comprehensive architecture documentation with modern tooling and best practices:

  1. Architecture Analysis and Discovery

    • Analyze current system architecture and component relationships
    • Identify key architectural patterns and design decisions
    • Document system boundaries, interfaces, and dependencies
    • Assess data flow and communication patterns
    • Identify architectural debt and improvement opportunities
  2. Architecture Documentation Framework

    • Choose appropriate documentation framework and tools:
      • C4 Model: Context, Containers, Components, Code diagrams
      • Arc42: Comprehensive architecture documentation template
      • Architecture Decision Records (ADRs): Decision documentation
      • PlantUML/Mermaid: Diagram-as-code documentation
      • Structurizr: C4 model tooling and visualization
      • Draw.io/Lucidchart: Visual diagramming tools
  3. System Context Documentation

    • Create high-level system context diagrams
    • Document external systems and integrations
    • Define system boundaries and responsibilities
    • Document user personas and stakeholders
    • Create system landscape and ecosystem overview
  4. Container and Service Architecture

    • Document container/service architecture and deployment view
    • Create service dependency maps and communication patterns
    • Document deployment architecture and infrastructure
    • Define service boundaries and API contracts
    • Document data persistence and storage architecture
  5. Component and Module Documentation

    • Create detailed component architecture diagrams
    • Document internal module structure and relationships
    • Define component responsibilities and interfaces
    • Document design patterns and architectural styles
    • Create code organization and package structure documentation
  6. Data Architecture Documentation

    • Document data models and database schemas
    • Create data flow diagrams and processing pipelines
    • Document data storage strategies and technologies
    • Define data governance and lifecycle management
    • Create data integration and synchronization documentation
  7. Security and Compliance Architecture

    • Document security architecture and threat model
    • Create authentication and authorization flow diagrams
    • Document compliance requirements and controls
    • Define security boundaries and trust zones
    • Create incident response and security monitoring documentation
  8. Quality Attributes and Cross-Cutting Concerns

    • Document performance characteristics and scalability patterns
    • Create reliability and availability architecture documentation
    • Document monitoring and observability architecture
    • Define maintainability and evolution strategies
    • Create disaster recovery and business continuity documentation
  9. Architecture Decision Records (ADRs)

    • Create comprehensive ADR template and process
    • Document historical architectural decisions and rationale
    • Create decision tracking and review process
    • Document trade-offs and alternatives considered
    • Set up ADR maintenance and evolution procedures
  10. Documentation Automation and Maintenance

    • Set up automated diagram generation from code annotations
    • Configure documentation pipeline and publishing automation
    • Set up documentation validation and consistency checking
    • Create documentation review and approval process
    • Train team on architecture documentation practices and tools
    • Set up documentation versioning and change management

File: cli-tool/components/commands/documentation/create-onboarding-guide.md


allowed-tools: Read, Write, Edit, Bash argument-hint: [role-type] | --developer | --designer | --devops | --comprehensive | --interactive

Developer Onboarding Guide Generator

Create developer onboarding guide: $ARGUMENTS

Current Team Context

  • Project setup: @package.json or @requirements.txt or @Cargo.toml (detect tech stack)
  • Existing docs: @docs/ or @README.md (if exists)
  • Development tools: !find . -name ".env*" -o -name "docker-compose.yml" -o -name "Makefile" | head -3
  • Team structure: @CODEOWNERS or @.github/ (if exists)
  • CI/CD setup: !find .github/workflows -name "*.yml" 2>/dev/null | head -3

Task

Create comprehensive onboarding experience tailored to role and project needs:

  1. Onboarding Requirements Analysis

    • Analyze current team structure and skill requirements
    • Identify key knowledge areas and learning objectives
    • Assess current onboarding challenges and pain points
    • Define onboarding timeline and milestone expectations
    • Document role-specific requirements and responsibilities
  2. Development Environment Setup Guide

    • Create comprehensive development environment setup instructions
    • Document required tools, software, and system requirements
    • Provide step-by-step installation and configuration guides
    • Create environment validation and troubleshooting procedures
    • Set up automated environment setup scripts and tools
  3. Project and Codebase Overview

    • Create high-level project overview and business context
    • Document system architecture and technology stack
    • Provide codebase structure and organization guide
    • Create code navigation and exploration guidelines
    • Document key modules, libraries, and frameworks used
  4. Development Workflow Documentation

    • Document version control workflows and branching strategies
    • Create code review process and quality standards guide
    • Document testing practices and requirements
    • Provide deployment and release process overview
    • Create issue tracking and project management workflow guide
  5. Team Communication and Collaboration

    • Document team communication channels and protocols
    • Create meeting schedules and participation guidelines
    • Provide team contact information and org chart
    • Document collaboration tools and access procedures
    • Create escalation procedures and support contacts
  6. Learning Resources and Training Materials

    • Curate learning resources for project-specific technologies
    • Create hands-on tutorials and coding exercises
    • Provide links to documentation, wikis, and knowledge bases
    • Create video tutorials and screen recordings
    • Set up mentoring and buddy system procedures
  7. First Tasks and Milestones

    • Create progressive difficulty task assignments
    • Define learning milestones and checkpoints
    • Provide "good first issues" and starter projects
    • Create hands-on coding challenges and exercises
    • Set up pair programming and shadowing opportunities
  8. Security and Compliance Training

    • Document security policies and access controls
    • Create data handling and privacy guidelines
    • Provide compliance training and certification requirements
    • Document incident response and security procedures
    • Create security best practices and guidelines
  9. Tools and Resources Access

    • Document required accounts and access requests
    • Create tool-specific setup and usage guides
    • Provide license and subscription information
    • Document VPN and network access procedures
    • Create troubleshooting guides for common access issues
  10. Feedback and Continuous Improvement

    • Create onboarding feedback collection process
    • Set up regular check-ins and progress reviews
    • Document common questions and FAQ section
    • Create onboarding metrics and success tracking
    • Establish onboarding guide maintenance and update procedures
    • Set up new hire success monitoring and support systems

File: cli-tool/components/commands/documentation/docs-maintenance.md


allowed-tools: Read, Write, Edit, Bash, Grep argument-hint: [maintenance-type] | --audit | --update | --validate | --optimize | --comprehensive

Documentation Maintenance & Quality Assurance

Implement comprehensive documentation maintenance system: $ARGUMENTS

Current Documentation Health

  • Documentation files: !find . -name "*.md" -o -name "*.mdx" | wc -l files
  • Last updates: !find . -name "*.md" -exec stat -f "%m %N" {} \; | sort -n | tail -5
  • External links: !grep -r "http" --include="*.md" . | wc -l links to validate
  • Image references: !grep -r "!\[.*\]" --include="*.md" . | wc -l images to check
  • Documentation structure: @docs/ or detect documentation directories

Task

Create systematic documentation maintenance framework with automated quality assurance, comprehensive validation, content optimization, and regular update procedures.

Documentation Maintenance Framework

1. Content Quality Audit System

  • Comprehensive file discovery and categorization
  • Content freshness analysis and aging detection
  • Word count, readability, and structure assessment
  • Missing sections and incomplete documentation identification
  • TODO/FIXME marker tracking and resolution planning
  • External link health monitoring with retry logic
  • Internal link validation and broken reference detection
  • Image reference verification and missing asset identification
  • Cross-reference consistency checking
  • Automated link correction suggestions

3. Style and Consistency Checking

  • Markdown syntax validation and formatting standards
  • Heading hierarchy and structure consistency
  • List formatting and emphasis style uniformity
  • Code block formatting and language specification
  • Accessibility compliance (alt text, descriptive links)

4. Content Optimization and Enhancement

  • Table of contents generation for long documents
  • Metadata updating and frontmatter management
  • Common formatting issue correction
  • Spelling and grammar validation
  • Readability analysis and improvement suggestions

5. Automated Synchronization System

  • Git-based change tracking and documentation updates
  • Version control integration with branch management
  • Automated commit generation with detailed change logs
  • Merge conflict resolution strategies
  • Rollback procedures for failed updates

6. Quality Assurance Reporting

  • Comprehensive audit reports with severity classifications
  • Issue categorization and prioritization systems
  • Progress tracking and maintenance metrics
  • Automated notification systems for critical issues
  • Dashboard creation for ongoing monitoring

Implementation Requirements

Audit Configuration

  • Configurable quality thresholds and validation rules
  • Custom style guide integration and enforcement
  • Platform-specific optimization settings
  • Team collaboration workflow integration
  • Automated scheduling and recurring maintenance

Validation Processes

  • Multi-level validation with error categorization
  • Batch processing for large documentation sets
  • Performance optimization for comprehensive scans
  • Integration with existing CI/CD pipelines
  • Real-time monitoring and alerting systems

Reporting and Analytics

  • Detailed maintenance reports with actionable insights
  • Historical trend analysis and improvement tracking
  • Team productivity metrics and documentation health scores
  • Integration with project management tools
  • Automated stakeholder communication

Deliverables

  1. Maintenance System Architecture

    • Automated audit and validation framework
    • Content optimization and enhancement tools
    • Quality assurance reporting infrastructure
    • Version control integration and synchronization
  2. Validation and Quality Tools

    • Link checking and reference validation systems
    • Style consistency and accessibility compliance tools
    • Content freshness and completeness analyzers
    • Automated correction and enhancement utilities
  3. Reporting and Monitoring

    • Comprehensive audit reports with prioritized recommendations
    • Real-time monitoring dashboards and alert systems
    • Progress tracking and maintenance history documentation
    • Integration with team communication and project tools
  4. Documentation and Procedures

    • Implementation guidelines and configuration instructions
    • Team workflow integration and collaboration procedures
    • Troubleshooting guides and maintenance best practices
    • Automated scheduling and recurring maintenance setup

Integration Guidelines

Implement with existing documentation platforms and development workflows. Ensure scalability for large documentation sets and team collaboration while maintaining quality standards and accessibility compliance.

2. Official Technical Reference & Guides (davila7/docs)

Mintlify Starter Kit

Use the starter kit to get your docs deployed and ready to customize.

Click the green Use this template button at the top of this repo to copy the Mintlify starter kit. The starter kit contains examples with

  • Guide pages
  • Navigation
  • Customizations
  • API reference pages
  • Use of popular components

Follow the full quickstart guide

Development

Install the Mintlify CLI to preview your documentation changes locally. To install, use the following command:

text
npm i mint

Run the following command at the root of your documentation, where your docs.json is located:

text
mint dev

View your local preview at http://localhost:3000.

Publishing changes

Install our GitHub app from your dashboard to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch.

Need help?

Troubleshooting

  • If your dev environment isn't running: Run mint update to ensure you have the most recent version of the CLI.
  • If a page loads as a 404: Make sure you are running in a folder with a valid docs.json.

Resources