|
3379 | 3379 | "path": "statusline/context-monitor.json", |
3380 | 3380 | "category": "statusline", |
3381 | 3381 | "type": "setting", |
3382 | | - "content": "{\n \"description\": \"Real-time Claude Code context usage monitor with visual progress bars, color-coded alerts, session analytics (cost, duration, lines changed), and auto-compact warnings. Tracks conversation context consumption and provides visual feedback to prevent session interruptions.\",\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"python3 ~/.claude/scripts/context-monitor.py\"\n }\n}", |
| 3382 | + "content": "{\n \"description\": \"Real-time Claude Code context usage monitor with visual progress bars, color-coded alerts, session analytics (cost, duration, lines changed), and auto-compact warnings. Tracks conversation context consumption and provides visual feedback to prevent session interruptions.\",\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"python3 .claude/scripts/context-monitor.py\"\n }\n}", |
3383 | 3383 | "description": "Real-time Claude Code context usage monitor with visual progress bars, color-coded alerts, session analytics (cost, duration, lines changed), and auto-compact warnings. Tracks conversation context consumption and provides visual feedback to prevent session interruptions." |
3384 | 3384 | }, |
3385 | 3385 | { |
|
3825 | 3825 | "description": "Automatically run relevant tests after code changes. Detects test files and runs appropriate test commands based on file extensions and project structure." |
3826 | 3826 | } |
3827 | 3827 | ], |
| 3828 | + "sandbox": [ |
| 3829 | + { |
| 3830 | + "name": "SANDBOX_DEBUGGING", |
| 3831 | + "path": "e2b/SANDBOX_DEBUGGING.md", |
| 3832 | + "category": "e2b", |
| 3833 | + "type": "sandbo", |
| 3834 | + "content": "# E2B Sandbox Debugging Guide\n\n## 🔍 Herramientas de Monitoreo Disponibles\n\n### 1. Launcher Principal con Logging Mejorado\n**Archivo**: `e2b-launcher.py`\n- Logging detallado de cada paso\n- Verificación de instalación de Claude Code\n- Monitoreo de permisos y ambiente\n- Timeouts extendidos para operaciones largas\n- Descarga automática de archivos generados\n\n### 2. Monitor de Sandbox en Tiempo Real\n**Archivo**: `e2b-monitor.py` \n- Monitoreo de recursos del sistema\n- Tracking de file system en tiempo real\n- Análisis de performance y memory usage\n- Logging con timestamps detallados\n\n### 3. Simulador Demo\nPara testing sin API keys válidos, crea un archivo demo que simule el flujo completo.\n\n## 🚨 Troubleshooting Común\n\n### Problema: \"Sandbox timeout\"\n**Síntomas**:\n```\n❌ Error: The sandbox was not found: This error is likely due to sandbox timeout\n```\n\n**Soluciones**:\n1. **Aumentar timeout del sandbox**:\n ```python\n sbx = Sandbox.create(timeout=600) # 10 minutos\n sbx.set_timeout(900) # Extender a 15 minutos\n ```\n\n2. **Usar el monitor para ver qué consume tiempo**:\n ```bash\n python e2b-monitor.py \"Your prompt here\" \"\" your_e2b_key your_anthropic_key\n ```\n\n### Problema: \"Claude not found\"\n**Síntomas**:\n```\n❌ Claude not found, checking PATH...\n```\n\n**Debugging Steps**:\n1. **Verificar template correcto**:\n ```python\n template=\"anthropic-claude-code\" # Debe ser exactamente este\n ```\n\n2. **Verificar instalación en sandbox**:\n ```bash\n # El launcher ejecuta automáticamente:\n which claude\n claude --version\n echo $PATH\n ```\n\n### Problema: \"Permission denied\"\n**Síntomas**:\n```\n❌ Write permission issue\n```\n\n**Soluciones**:\n1. **Verificar directorio de trabajo**:\n ```bash\n pwd\n whoami\n ls -la\n ```\n\n2. **Cambiar a directorio con permisos**:\n ```python\n sbx.commands.run(\"cd /home/user && mkdir workspace && cd workspace\")\n ```\n\n### Problema: API Key Issues\n**Síntomas**:\n```\n❌ Error: 401: Invalid API key\n```\n\n**Debugging**:\n1. **Verificar formato de API key**:\n - E2B keys: formato específico de E2B\n - Anthropic keys: empiezan con \"sk-ant-\"\n\n2. **Verificar permisos**:\n - Verificar que la key tenga permisos de sandbox\n - Verificar quota/límites de la cuenta\n\n## 📊 Usando el Monitor para Debugging\n\n### Comando Básico:\n```bash\npython e2b-monitor.py \"Create a React app\" \"\" your_e2b_key your_anthropic_key\n```\n\n### Output del Monitor:\n```\n[14:32:15] INFO: 🚀 Starting enhanced E2B sandbox with monitoring\n[14:32:16] INFO: ✅ Sandbox created: abc123xyz\n[14:32:17] INFO: 🔍 System resources check\n[14:32:17] INFO: Memory usage:\n[14:32:17] INFO: total used free\n[14:32:17] INFO: Mem: 2.0Gi 512Mi 1.5Gi\n[14:32:18] INFO: 📁 Initial file system state\n[14:32:18] INFO: Current directory: /home/user\n[14:32:19] INFO: 🤖 Executing Claude Code with monitoring\n[14:32:19] INFO: Starting monitored execution: echo 'Create a React app'...\n[14:32:22] INFO: Command completed in 3.45 seconds\n[14:32:22] INFO: Exit code: 0\n[14:32:22] INFO: STDOUT length: 2847 characters\n```\n\n## 🎯 Casos de Uso Específicos\n\n### 1. **Debugging Timeouts**\n```bash\n# Usar el monitor para ver exactamente dónde se cuelga\npython e2b-monitor.py \"Complex prompt that times out\"\n```\n\n### 2. **Verificar Generación de Archivos**\nEl launcher automáticamente descarga archivos generados:\n```\n💾 DOWNLOADING FILES TO LOCAL MACHINE:\n✅ Downloaded: ./index.html → ./e2b-output/index.html\n✅ Downloaded: ./styles.css → ./e2b-output/styles.css\n\n📁 All files downloaded to: /path/to/project/e2b-output\n```\n\n### 3. **Monitoreo de Performance**\n```\n[14:33:20] INFO: Top processes:\n[14:33:20] INFO: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\n[14:33:20] INFO: user 1234 5.2 2.1 98765 43210 pts/0 S+ 14:32 0:01 claude\n```\n\n## 🛠 Configuración Avanzada\n\n### Variables de Ambiente Útiles:\n```bash\nexport E2B_DEBUG=1 # Debug mode\nexport ANTHROPIC_API_KEY=your_key # Claude API key \nexport E2B_API_KEY=your_key # E2B API key\n```\n\n### Configuración de Timeout Personalizada:\n```python\n# Para operaciones muy largas (ej: compilación completa)\nsbx = Sandbox.create(timeout=1800) # 30 minutos\nsbx.set_timeout(3600) # 1 hora máximo\n```\n\n## 📋 Checklist de Debugging\n\n### Antes de Reportar un Issue:\n- [ ] API keys válidos y con permisos correctos\n- [ ] Template correcto: \"anthropic-claude-code\"\n- [ ] Timeout suficiente para la operación\n- [ ] Ejecutar con el monitor para logs detallados\n- [ ] Verificar que Claude Code esté instalado en sandbox\n- [ ] Revisar permisos de escritura en directorio\n- [ ] Comprobar memoria/recursos disponibles\n\n### Información a Incluir en Reports:\n- Output completo del launcher o monitor\n- Sandbox ID si está disponible\n- Prompt exacto que causa el problema\n- Componentes instalados (si aplica)\n- Tiempo de ejecución antes del fallo\n\n## 🚀 Funcionalidades del Sistema\n\n### Descarga Automática de Archivos\nEl launcher descarga automáticamente todos los archivos generados:\n- HTML, CSS, JS, TS, TSX, Python, JSON, Markdown\n- Se guardan en directorio local `./e2b-output/`\n- Excluye archivos internos de Claude Code\n- Preserva nombres de archivo originales\n\n### Logging Detallado\n- Verificación de instalación de Claude Code\n- Monitoreo de permisos y ambiente del sandbox\n- Tracking de exit codes y output length\n- Timestamps para análisis de performance\n\n### Timeouts Inteligentes\n- 10 minutos timeout inicial para creación\n- 15 minutos total extendido automáticamente\n- 5 minutos timeout para ejecución de Claude Code\n- Timeouts cortos para verificaciones (5-10 segundos)\n\n---\n\n**Con estas herramientas puedes monitorear exactamente qué está pasando dentro del sandbox E2B y debuggear cualquier problema que surja.**", |
| 3835 | + "description": "" |
| 3836 | + }, |
| 3837 | + { |
| 3838 | + "name": "claude-code-sandbox", |
| 3839 | + "path": "e2b/claude-code-sandbox.md", |
| 3840 | + "category": "e2b", |
| 3841 | + "type": "sandbo", |
| 3842 | + "content": "# E2B Claude Code Sandbox\n\nExecute Claude Code in an isolated E2B cloud sandbox environment.\n\n## Description\n\nThis 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.\n\n## Features\n\n- **Isolated Execution**: Run Claude Code in a secure cloud sandbox\n- **Pre-configured Environment**: Ships with Claude Code already installed\n- **API Integration**: Seamless connection to Anthropic's Claude API\n- **Safe Code Execution**: Execute prompts without local system risks\n- **Component Installation**: Automatically installs any components specified with CLI flags\n\n## Requirements\n\n- E2B API Key (get from https://e2b.dev/dashboard)\n- Anthropic API Key\n- Python 3.11+ (for E2B SDK)\n\n## Usage\n\n```bash\n# Execute a prompt in E2B sandbox (requires API keys as environment variables or CLI parameters)\nnpx claude-code-templates@latest --sandbox e2b --prompt \"Create a React todo app\"\n\n# Pass API keys directly as parameters\nnpx claude-code-templates@latest --sandbox e2b \\\n --e2b-api-key your_e2b_key \\\n --anthropic-api-key your_anthropic_key \\\n --prompt \"Create a React todo app\"\n\n# Install components and execute in sandbox\nnpx claude-code-templates@latest --sandbox e2b \\\n --agent frontend-developer \\\n --command setup-react \\\n --e2b-api-key your_e2b_key \\\n --anthropic-api-key your_anthropic_key \\\n --prompt \"Create a modern todo app with TypeScript\"\n```\n\n## Environment Setup\n\nThe component will create:\n- `.claude/sandbox/e2b-launcher.py` - Python script to launch E2B sandbox\n- `.claude/sandbox/requirements.txt` - Python dependencies \n- `.claude/sandbox/.env.example` - Environment variables template\n\n## API Key Configuration\n\nYou can provide API keys in two ways:\n\n### Option 1: CLI Parameters (Recommended)\n```bash\n# Pass keys directly as command parameters\nnpx claude-code-templates@latest --sandbox e2b \\\n --e2b-api-key your_e2b_api_key \\\n --anthropic-api-key your_anthropic_api_key \\\n --prompt \"Your prompt here\"\n```\n\n### Option 2: Environment Variables\nSet these environment variables in your shell or `.env` file:\n```bash\nexport E2B_API_KEY=your_e2b_api_key_here\nexport ANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Or create .claude/sandbox/.env file:\nE2B_API_KEY=your_e2b_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n```\n\n**Note**: CLI parameters take precedence over environment variables.\n\n## How it Works\n\n1. Creates E2B sandbox with `anthropic-claude-code` template\n2. Installs any specified components (agents, commands, etc.)\n3. Executes your prompt using Claude Code inside the sandbox\n4. Returns the complete output and any generated files\n5. Automatically cleans up the sandbox after execution\n\n## Security Benefits\n\n- **Isolation**: Code runs in a separate cloud environment\n- **No Local Impact**: No risk to your local system or files\n- **Temporary**: Sandbox is destroyed after execution\n- **Controlled**: Only specified components and prompts are executed\n\n## Examples\n\n```bash\n# Simple web app creation\nnpx claude-code-templates@latest --sandbox e2b --prompt \"Create an HTML page with CSS animations\"\n\n# Full stack development\nnpx claude-code-templates@latest --sandbox e2b --agent fullstack-developer --prompt \"Create a Node.js API with authentication\"\n\n# Data analysis\nnpx claude-code-templates@latest --sandbox e2b --agent data-scientist --prompt \"Analyze this CSV data and create visualizations\"\n```\n\n## Template Information\n\n- **Provider**: E2B (https://e2b.dev)\n- **Base Template**: anthropic-claude-code\n- **Timeout**: 5 minutes (configurable)\n- **Environment**: Ubuntu with Claude Code pre-installed", |
| 3843 | + "description": "" |
| 3844 | + } |
| 3845 | + ], |
3828 | 3846 | "templates": [ |
3829 | 3847 | { |
3830 | 3848 | "name": "angular-app", |
|
0 commit comments