claudebox

Run Claude Code in an isolated Docker container with HTTP, MCP, Telegram, and cron interfaces.

21|5|Updated Jun 14, 2025
One-click install
npx skills add https://github.com/psyb0t/docker-claudebox --skill claudebox-psyb0t
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claudebox
Source: https://github.com/psyb0t/docker-claudebox/tree/main/.agents/skills/claudebox
Command: npx skills add https://github.com/psyb0t/docker-claudebox --skill claudebox-psyb0t

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running Claude Code directly on a host machine exposes your system to unrestricted shell and file access, and integrating the CLI into scripts, APIs, or chat platforms requires manual plumbing. This Skill installs, configures, and operates claudebox, a Docker-based wrapper that isolates Claude Code in a container while exposing it through seven programmatic surfaces. ## Core Features & Use Cases - Containerized CLI execution: Run interactive sessions or one-shot prompts (claudebox -p "prompt") with automatic session resumption, workspace mounting, and SSH/git state handled by the wrapper. - Multiple server surfaces: Expose Claude Code as an HTTP REST API (POST /run, file operations), an OpenAI-compatible chat/completions endpoint, an MCP server with 5 tools, a Telegram bot with per-chat workspaces, or a cron scheduler for recurring jobs. - Use Case: A CI pipeline needs automated code review. Run claudebox -p "review this diff for security issues" --output-format json to get structured results without a TTY, or point LiteLLM at the OpenAI-compatible endpoint so every completion runs the full agentic CLI with file and shell access. ## Quick Start Ask the agent to install claudebox with the install script and then run a one-shot prompt like "inspect this workspace" from your project directory.

Frequently Asked Questions about claudebox

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Claude Code in a Docker container?

Install the claudebox wrapper with the install script, then run `claudebox` from your workspace for an interactive session or `claudebox -p "prompt"` for one-shot execution. The wrapper handles the workspace mount, SSH keys, image selection, and session resumption automatically.

How do I expose Claude Code as an HTTP API?

Set CLAUDEBOX_API_MODE=1 and CLAUDEBOX_API_MODE_TOKEN, then start the container. The FastAPI server on port 8080 accepts POST /run requests with a prompt and workspace, supports async polling via GET /run/result, and provides file operations under /files.

Does claudebox work with OpenAI SDKs and LiteLLM?

Yes, the API-mode server exposes /openai/v1/chat/completions and /openai/v1/models. Point any OpenAI-compatible client at that base URL; streaming SSE, multi-turn conversations, tool calling, and JSON-schema response formats are supported.

Can I use claudebox as an MCP server for other agents?

Yes, set CLAUDEBOX_MCP_MODE=1 with a bearer token. It mounts at /mcp on the API port when API mode is also enabled, or runs standalone on port 8081, exposing run_prompt, list_files, read_file, write_file, and delete_file tools.

What are the security risks of running claudebox?

Claude runs with --permission-mode bypassPermissions, giving full shell, file, and docker-in-docker access inside the container. API and MCP surfaces are unauthenticated if tokens are unset, and mounting /var/run/docker.sock grants host-level container control, so isolate the container itself for untrusted input.

Why does streaming not work with tool calls on the OpenAI endpoint?

Tool calling and JSON-schema responses require the full answer to be computed first, so stream:true combined with tools or response_format returns a buffered single-shot SSE stream. Only plain chat without tools or schema streams token by token.