Prerequisites
- Python
- Node.js
Step 1: Run Claude Code on your project
The core workflow: mount your project read-only into the sandbox, let Claude Code work on a writable copy, and collect the results on your host.- Python
- Node.js
claude_code.py
./output/ on your host — Claude Code’s changes are already there via the volume mount. You can review them, diff against the original, and merge what you want:
Installing Claude Code at runtime takes 30-60 seconds. For repeated use, build a custom Docker image with Claude Code pre-installed and use it as
image="your-registry/claude-code:latest".Step 2: Chain multiple tasks
Reuse the same sandbox for a multi-step pipeline. Files persist betweenclaude --print invocations, so each step builds on the previous one.
- Python
- Node.js
claude_code_pipeline.py
./output/ on your host.
Security tips
- Read-only source mounts — Your original code is never modified. Review diffs before merging.
- Resource limits — Claude Code can be resource-intensive. 4096 MiB and 2 CPUs is a good starting point.
- Disposable sandboxes — Each sandbox is ephemeral. If Claude Code installs something dangerous, it disappears when the box stops.
What’s next?
Connect to an LLM
Build your own LLM tool-calling loop with BoxLite for custom code execution.
Execute AI-generated code
Run untrusted Python code safely with CodeBox — auto-install packages and capture output.
Upload & download files
Move source code and results in and out of your sandbox.
AI agent integration
Production patterns for running AI agents with BoxLite.

