Skip to content

Commit 9510d47

Browse files
davila7claude
andcommitted
Move E2B sandbox outputs to project root with organized folders
Changes: - E2B outputs now save to ./e2b-outputs/{timestamp}_{prompt}/ in project root - No longer creates files inside .claude directory - Added timestamp and sanitized prompt name for unique folder organization - Improved find command to exclude .claude and node_modules directories - Enhanced file filtering and organization for better user experience Structure: ./e2b-outputs/ └── 20250106_143025_Create-React-app/ ├── index.html ├── app.js └── styles.css This keeps E2B sandbox outputs separate from Claude Code configuration and makes it easier for users to find and manage their generated files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 39b8b1f commit 9510d47

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

cli-tool/components/sandbox/e2b/e2b-launcher.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import os
88
import sys
99
import json
10+
import datetime
11+
import re
1012

1113
# Debug: Print Python path information
1214
print(f"Python executable: {sys.executable}")
@@ -218,7 +220,7 @@ def main():
218220
print("📁 GENERATED FILES:")
219221
print("=" * 60)
220222

221-
files_result = sbx.commands.run("find . -type f -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.py' -o -name '*.json' -o -name '*.md' -o -name '*.tsx' -o -name '*.ts' | head -20")
223+
files_result = sbx.commands.run("find . -type f \\( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.py' -o -name '*.json' -o -name '*.md' -o -name '*.tsx' -o -name '*.ts' \\) ! -path '*/.claude/*' ! -path '*/node_modules/*' | head -20")
222224
if files_result.stdout.strip():
223225
print(files_result.stdout)
224226

@@ -227,13 +229,22 @@ def main():
227229
print("💾 DOWNLOADING FILES TO LOCAL MACHINE:")
228230
print("=" * 60)
229231

230-
local_output_dir = "./e2b-output"
232+
# Create unique folder for this execution in project root
233+
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
234+
clean_prompt = re.sub(r'[^\w\s-]', '', prompt).strip()
235+
clean_prompt = re.sub(r'[-\s]+', '-', clean_prompt)[:30]
236+
folder_name = f"{timestamp}_{clean_prompt}"
237+
238+
# Create output directory in project root (not inside .claude)
239+
local_output_dir = f"./e2b-outputs/{folder_name}"
231240
os.makedirs(local_output_dir, exist_ok=True)
232241

242+
print(f"📂 Output folder: {local_output_dir}")
243+
233244
files_to_download = files_result.stdout.strip().split('\n')
234245
for file_path in files_to_download:
235246
file_path = file_path.strip()
236-
if file_path and not file_path.startswith('./.claude'): # Skip Claude internal files
247+
if file_path: # Already filtered out .claude and node_modules in find command
237248
try:
238249
# Read file content from sandbox
239250
file_content = sbx.commands.run(f"cat '{file_path}'", timeout=30)

0 commit comments

Comments
 (0)