explaingit

jiangmuran/claude-in-box

26GoAudience · developerComplexity · 4/5ActiveLicenseSetup · moderate

TLDR

A Docker container that runs Claude Code in interactive mode and exposes it as a web service over one port, so you can drive Claude Code from a browser or phone against a server you own.

Mindmap

mindmap
  root((claude-in-box))
    Inputs
      OAuth token
      API key
      Web requests
      Hook events
    Outputs
      Web UI panel
      JSON event frames
      REST and WebSocket
      SSE stream
    Use Cases
      Remote Claude Code
      Phone driven coding
      Multi session work
      Self hosted dev box
    Tech Stack
      Go
      Docker
      Node
      Python
      Nginx

Things people build with this

USE CASE 1

Run Claude Code on a home server and drive it from your phone

USE CASE 2

Host a shared Claude Code box for a small team with per session billing

USE CASE 3

Build a custom web UI on top of the typed event frame API

USE CASE 4

Route all Claude Code outbound traffic through a SOCKS5 proxy

Tech stack

GoDockerNodePythonNginxRedisPostgres

Getting it running

Difficulty · moderate Time to first run · 30min

You need Docker plus either an Anthropic OAuth token minted with claude setup-token or an API key before the container is useful.

MIT license, so you can use, modify, and ship it commercially as long as you keep the copyright notice.

In plain English

claude-in-box packages Anthropic's command-line coding assistant, Claude Code, inside a Docker container together with a small Linux development environment, and exposes the whole thing as a web service on a single network port. The idea is to stop tying Claude Code to one laptop. You run the container on a real server you already own, such as a cloud VM, a home machine, or even a Raspberry Pi, and then drive that running Claude Code from your browser, your phone, or other devices over the network. Inside the box you get a sandboxed Linux machine preloaded with Node 20, Python 3 with FastAPI and a few common libraries, Go 1.25, Rust, plus Nginx, Redis, Postgres, and the Docker CLI. Standard command-line tools like ripgrep, fd, bat, tmux, vim, htop, jq, curl, and build tools are also installed. The bundled background services do not start unless you ask for them through an environment variable. The image is multi-architecture so it boots on both x86 servers and arm64 boards. Claude Code runs in its full interactive mode rather than the one-shot print mode. The README explains that this is deliberate, because the interactive mode is the only one that draws from an Anthropic subscription quota, while the one-shot mode requires a paid API key. You can mint a long-lived OAuth token on your laptop and pass it to the container, or supply an API key, and you can choose between those two billing modes on a per-session basis. The control plane on the single open port serves a web panel and three views on each session at once: a raw terminal view that mirrors what you would see in iTerm, a chat-style structured view with a todo sidebar and tool call timeline, and an API inspector showing every event frame. Underneath, the project parses Claude Code's lifecycle into typed JSON frames covering text deltas, tool calls, todo updates, token usage, model changes, and stop reasons. You can create, attach, resume, and kill sessions over REST, WebSocket, or server-sent events. Planned adapters will also accept Anthropic-style and OpenAI-style HTTP requests so existing SDKs can target the box without changes. The project also includes a transparent SOCKS5 layer so all outbound traffic from the container can be sent through one upstream proxy, plus programmable hooks on every lifecycle event. The README marks the project as early work in progress.

Copy-paste prompts

Prompt 1
Write a docker compose file that boots claude-in-box with redis and postgres enabled and a master API key pulled from .env
Prompt 2
Add a new lifecycle hook to claude-in-box that posts every tool call frame to a Slack webhook
Prompt 3
Build a minimal React client that attaches to a claude-in-box session over WebSocket and renders the todo sidebar
Prompt 4
Explain the difference between OAuth token mode and API key mode in claude-in-box and how to switch per session
Prompt 5
Show how to mint a Claude Code OAuth token on a laptop and pass it to claude-in-box safely
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.