# docker-claudebox - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for docker-claudebox. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0004` supported 0.86
- **Users who want to bring professional workflows into a host AI**: The repo contains Skill documents. Evidence: `.agents/skills/claudebox/SKILL.md` Claim: `clm_0005` supported 0.86

## What It Can Do

- **AI Skill / Agent Instruction Asset Library** (Previewable before install): The project contains Skill or Agent instruction files that a host AI can read, useful for bringing professional workflows into hosts like Claude, Codex, or Cursor. Evidence: `.agents/skills/claudebox/SKILL.md` Claim: `clm_0001` supported 0.86
- **Multi-Host Install and Distribution** (Verify after install): The project contains plugin or marketplace configuration, indicating it targets install and distribution across one or more AI hosts. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json` Claim: `clm_0002` supported 0.86
- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `README.md` Claim: `clm_0003` supported 0.86

## How to Start

- `curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-claudebox/master/install.sh | bash` Evidence: `README.md` Claim: `clm_0006` supported 0.86, `clm_0007` supported 0.86
- `curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-claudebox/master/install.sh | bash -s -- claude` Evidence: `README.md` Claim: `clm_0007` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Needs admin / security approval
- **Why**: Continuing may involve secrets, accounts, external services, or sensitive context; get admin or security approval first.

### 30-Second Read

- **What to do now**: Needs admin / security approval
- **Minimum safe next step**: Run Prompt Preview first; if credentials or an enterprise environment are involved, get approval before trialing
- **Do not trust yet**: Tool permission boundaries cannot be trusted before install.
- **Continuing will touch**: Command execution, Host AI configuration, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0004` supported 0.86
- **Target-audience signal: Users who want to bring professional workflows into a host AI** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `.agents/skills/claudebox/SKILL.md` Claim: `clm_0005` supported 0.86
- **Capability exists: AI Skill / Agent Instruction Asset Library** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `.agents/skills/claudebox/SKILL.md` Claim: `clm_0001` supported 0.86
- **Capability exists: Multi-Host Install and Distribution** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json` Claim: `clm_0002` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `README.md` Claim: `clm_0003` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0006` supported 0.86, `clm_0007` supported 0.86

### What You Cannot Trust Yet

- **Tool permission boundaries cannot be trusted before install.** (unverified): MCP/tool projects usually touch files, the network, the browser, or external APIs, so permissions and logs must be checked for real.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json`, `.agents/skills/claudebox/SKILL.md`
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json`
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **Do the install commands require network access, permissions, or global writes?** (unverified): This affects install risk in both enterprise and personal environments. Evidence: `README.md`

### What Continuing Will Touch

- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `README.md`
- **Host AI configuration**: The plugin, Skill, or rule-loading config of hosts like Claude/Codex/Cursor/Gemini/OpenCode. Why: Host configuration changes how the AI works afterward and may conflict with the user's existing rules. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json`, `.agents/skills/claudebox/SKILL.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json`, `README.md`
- **Environment variables / API keys**: Project entry docs explicitly showing API key, token, secret, or account credential configuration. Why: If a real install needs credentials, use test credentials first and go through a permission/compliance review. Evidence: `.agents/skills/claudebox/SKILL.md`, `.agents/skills/claudebox/references/setup.md`, `CHANGELOG.md`, `README.md` et al.
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **Back up your host AI configuration first**: Skill, plugin, and rule files may change the default behavior of Claude/Cursor/Codex. (applies when: When there is a plugin manifest, a Skill, or a host rule entrypoint.)
- **Do not use real production credentials**: Once an environment variable / API key enters the host or toolchain, it can create account and compliance risk. (applies when: When environment signals like API, TOKEN, KEY, or SECRET appear.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Be ready to remove the host plugin / Skill / rule entrypoint**: If behavior is off after the trial install, you can restore the host AI to its pre-trial state.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **Be ready to revoke test API keys or tokens**: If test credentials leak or are misused, you can cut losses quickly.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0008` inferred 0.45
- **Host AI plugin or Skill rule conflicts**: New rules may change how the user's existing host AI behaves. Mitigation: Inspect the plugin manifest and Skill files before installing, and test in isolation if needed. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json` Claim: `clm_0009` supported 0.86
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `README.md` Claim: `clm_0010` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **AI Skill / Agent Instruction Asset Library**: Use role_skill_index / evidence_index to help the user pick a usable role, Skill, or workflow first. Boundary: Can be experienced via a pre-install Prompt. Evidence: `.agents/skills/claudebox/SKILL.md` Claim: `clm_0001` supported 0.86
- **Multi-Host Install and Distribution**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `.agents/.claude-plugin/plugin.json`, `.agents/.codex-plugin/plugin.json`, `.agents/plugins/claudebox/openclaw.plugin.json` Claim: `clm_0002` supported 0.86
- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `README.md` Claim: `clm_0003` supported 0.86

### Context Scale

- Total files: 45
- Important-file coverage: 40/45
- Evidence index entries: 42
- Role / Skill entries: 1

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for docker-claudebox, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat docker-claudebox as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for docker-claudebox, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 1 role / Skill / project-doc entries.

- **claudebox** (skill): Claude Code running on the network inside a Docker container aicodebox-based , managed via the claudebox wrapper/CLI. Exposes seven ways to drive it — interactive shell claudebox , one-shot exec claudebox "prompt" , an HTTP REST API /run , async run-id polling, /files CRUD , an OpenAI-compatible /openai/v1/chat/completions adapter streaming SSE, multi-turn, multimodal , an MCP server streamable HTTP, gated by CLAUDE… Activation hint: When the user's task is highly relevant to the workflow described by “claudebox”, use it for a pre-install experience first, then decide whether to install. Evidence: `.agents/skills/claudebox/SKILL.md`

## Evidence Index

- Indexed 42 evidence entries.

- **claudebox** (documentation): ! CI https://github.com/psyb0t/docker-claudebox/actions/workflows/pipeline.yml/badge.svg?branch=master https://github.com/psyb0t/docker-claudebox/actions/workflows/pipeline.yml ! version https://raw.githubusercontent.com/psyb0t/docker-claudebox/badges/version.svg https://github.com/psyb0t/docker-claudebox/releases ! license https://raw.githubusercontent.com/psyb0t/docker-claudebox/badges/license.svg LICENSE ! Docker Pulls https://img.shields.io/docker/pulls/psyb0t/claudebox?style=flat-square https://hub.docker.com/r/psyb0t/claudebox Evidence: `README.md`
- **@psyb0t/claudebox** (documentation): An OpenClaw/MCP plugin that connects your agent to a self-hosted claudebox https://github.com/psyb0t/docker-claudebox instance — Claude Code running in a Docker container — over the Model Context Protocol https://modelcontextprotocol.io . Evidence: `.agents/plugins/claudebox/README.md`
- **Customization** (documentation): - Custom scripts ~/.claude/bin custom-scripts-claudebin - Init hooks ~/.claude/init.d init-hooks-claudeinitd - Always-active skills ~/.claude/.always-skills always-active-skills-claudealways-skills - MCP servers mcp-servers Evidence: `docs/customization.md`
- **Environment Variables** (documentation): Set these on your host e.g., in ~/.bashrc or ~/.zshrc . The wrapper script forwards them into the container automatically. These apply across all modes. Evidence: `docs/environment-variables.md`
- **API Mode** (documentation): Run the container as an HTTP API server with workspace management, file operations, and optional authentication. This is the mode that powers the OpenAI-compatible adapter and MCP server as well. Evidence: `docs/modes/api.md`
- **Interactive Mode** (documentation): Works just like the native claude CLI but runs inside a container. The container persists between runs, and --continue is applied automatically so each session picks up where you left off. Evidence: `docs/modes/interactive.md`
- **Programmatic Mode** (documentation): Pass a prompt and get a response. The -p flag is added automatically. No TTY required — works from scripts, cron jobs, CI pipelines, and anywhere else you need non-interactive output. Evidence: `docs/modes/programmatic.md`
- **Telegram Mode** (documentation): Talk to Claude Code from Telegram. Each chat gets its own isolated workspace and individually configurable settings. Send text messages, files, photos, videos, and voice messages. Run shell commands. Retrieve files. All from your phone. Evidence: `docs/modes/telegram.md`
- **Package** (package_manifest): { "name": "@psyb0t/claudebox", "version": "0.0.0", "mcpName": "io.github.psyb0t/claudebox", "description": "Connect an OpenClaw/MCP agent to a self-hosted claudebox Claude Code on the network instance over MCP.", "type": "module", "bin": { "claudebox-mcp": "bin/cli.js" }, "files": "bin", "openclaw.plugin.json", "README.md", "LICENSE" , "license": "MIT", "author": "psyb0t", "homepage": "https://github.com/psyb0t/docker-claudebox", "repository": { "type": "git", "url": "git+https://github.com/psyb0t/docker-claudebox.git" }, "bugs": { "url": "https://github.com/psyb0t/docker-claudebox/issues" }, "keywords": "mcp", "model-context-protocol", "claudebox", "claude-code", "docker", "openclaw", "ai-… Evidence: `.agents/plugins/claudebox/package.json`
- **claudebox** (skill_instruction): Claude Code — the agentic coding CLI from Anthropic — running in an isolated Docker container with dev tools, passwordless sudo, docker-in-docker, and --permission-mode bypassPermissions on by default. Built as a thin child image of psyb0t/aicodebox ; every server-mode surface API / OpenAI adapter / MCP / Telegram / Cron is inherited from that base. Evidence: `.agents/skills/claudebox/SKILL.md`
- **Plugin** (structured_config): { "name": "claudebox", "description": "Claude Code running in an isolated Docker container, driven via interactive shell, one-shot exec, an HTTP REST API, an OpenAI-compatible chat/completions adapter, an MCP server, a Telegram bot, and a YAML cron scheduler", "author": { "name": "psyb0t", "url": "https://github.com/psyb0t" }, "homepage": "https://github.com/psyb0t/docker-claudebox", "license": "WTFPL", "keywords": "claude-code", "docker", "mcp", "rest-api", "openai-compatible", "telegram-bot", "cron" , "userConfig": { "claudebox url": { "type": "string", "title": "claudebox server URL", "description": "Base URL of your running claudebox server, e.g. http://localhost:8080 CLAUDEBOX URL . Re… Evidence: `.agents/.claude-plugin/plugin.json`
- **Plugin** (structured_config): { "name": "claudebox", "version": "2.3.5", "description": "Claude Code running in an isolated Docker container, driven via interactive shell, one-shot exec, an HTTP REST API, an OpenAI-compatible chat/completions adapter, an MCP server, a Telegram bot, and a YAML cron scheduler", "author": { "name": "psyb0t", "url": "https://github.com/psyb0t" }, "homepage": "https://github.com/psyb0t/docker-claudebox", "repository": "https://github.com/psyb0t/docker-claudebox", "license": "WTFPL", "keywords": "claude-code", "docker", "mcp", "rest-api", "openai-compatible", "telegram-bot", "cron" , "skills": "./skills/" } Evidence: `.agents/.codex-plugin/plugin.json`
- **License** (source_file): DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Evidence: `LICENSE`
- **License** (source_file): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Evidence: `.agents/plugins/claudebox/LICENSE`
- **Changelog** (documentation): All notable changes to claudebox formerly docker-claude-code . Evidence: `CHANGELOG.md`
- **Cron Mode** (documentation): Run scheduled Claude jobs from a YAML cron file. Each job has a cron expression and a multiline instruction. Output streams to ~/.claude/cron/history/ / - / as activity.jsonl Claude's stream-json output alongside stderr.log and meta.json . Evidence: `docs/modes/cron.md`
- **stale pre-v2 files removed but the dockerignore hedges in case a stray** (source_file): .git/ .github/ .research files/ .prompts/ .testing/ base/ .md desc.txt git-update.sh docker-compose.dev.yaml stale pre-v2 files removed but the dockerignore hedges in case a stray copy still exists in the working tree . api server.py telegram bot.py telegram utils.py cron.py jsonpipe.py entrypoint.sh wrapper.sh install.sh .telemetry/ Evidence: `.dockerignore`
- **claudebox — example env for docker run --env-file .** (source_file): claudebox — example env for docker run --env-file . CLAUDEBOX is canonical for v2+; the entrypoint aliases each to its AICODEBOX equivalent when the target is unset. AICODEBOX wins if both are set power-user override . Legacy CLAUDE MODE names are also aliased forward for compat with pre-v2 configs. Evidence: `.env.example`
- **claudebox:latest-full — the toolchain-loaded variant.** (source_file): claudebox:latest-full — the toolchain-loaded variant. Builds on top of the minimal image Node + Python + uv + Docker + jq + curl + git and adds language toolchains, editors, DB clients, and infra CLIs that made the pre-migration full variant useful for any-language coding sessions. ARG BASE IMAGE=psyb0t/claudebox:latest FROM ${BASE IMAGE} Evidence: `Dockerfile.full`
- **Claudebox Entrypoint** (source_file): set -euo pipefail CLAUDEBOX ALIASES= API MODE API MODE PORT API MODE TOKEN TELEGRAM MODE TELEGRAM MODE TOKEN TELEGRAM MODE CONFIG TELEGRAM MODE OVERRIDES CRON MODE CRON MODE FILE CRON MODE HISTORY DIR MCP MODE MCP MODE PORT MCP MODE TOKEN WORKSPACE AVAILABLE MODELS AVAILABLE EFFORTS CONTAINER NAME for suffix in "${ CLAUDEBOX ALIASES @ }"; do cb var="CLAUDEBOX ${ suffix}" ai var="AICODEBOX ${ suffix}" cb val="$ printenv "$ cb var" 2 /dev/null true " ai val="$ printenv "$ ai var" 2 /dev/null true " if -n "$ cb val" && -z "$ ai val" ; then export "$ ai var=$ cb val" fi done LEGACY MODE MAP= "CLAUDE MODE API:AICODEBOX API MODE" "CLAUDE MODE API PORT:AICODEBOX API MODE PORT" "CLAUDE MODE API TOK… Evidence: `claudebox-entrypoint.sh`
- **Runtime deps live in the aicodebox base image aicodebox pkg + fastapi +** (source_file): project name = "claudebox" version = "2.0.6" description = "Claude Code adapter for the aicodebox base image" requires-python = " =3.12" authors = { name = "psyb0t" } license = { text = "WTFPL" } Runtime deps live in the aicodebox base image aicodebox pkg + fastapi + uvicorn + python-telegram-bot + croniter + mcp + pydantic + pyyaml — all already installed system-wide via uv pip install --system in the base's Dockerfile . The adapter itself has zero runtime deps beyond aicodebox, which is why uv pip install --system --break-system-packages --no-deps /opt/claudebox in the Dockerfile is safe. dependencies = Evidence: `claudebox/pyproject.toml`
- **v2 flipped the variants: latest IS the minimal image; latest-full layers** (source_file): BIN NAME="${1:-${CLAUDEBOX BIN NAME:-${CLAUDE BIN NAME:-claudebox}}}" INSTALL DIR="${CLAUDEBOX INSTALL DIR:-${CLAUDE INSTALL DIR:-/usr/local/bin}}" BIN PATH="$INSTALL DIR/$BIN NAME" echo "🚀 Starting Claude Code setup binary: $BIN NAME ..." if ! command -v docker & /dev/null; then echo "❌ Docker is not installed. Please install Docker first." exit 1 fi echo "📁 Creating ~/.claude directory..." mkdir -p ~/.claude echo "🔐 Creating SSH directory for Claude Code..." mkdir -p "$HOME/.ssh/claudebox" if -f "$HOME/.ssh/claudebox/id ed25519" ; then echo "🔑 SSH key already exists at $HOME/.ssh/claudebox/id ed25519" read -rp " Replace existing key? y/N " response if "$response" =~ ^ Yy $ ; then echo "🗝️… Evidence: `install.sh`
- **Wrapper** (source_file): CLAUDEBOX INSTALLED VARIANT="minimal" DEBUG="${CLAUDEBOX ENV DEBUG:-${DEBUG:-}}" dbg { "${DEBUG:-}" = "true" && echo " DEBUG $ date +%H:%M:%S.%3N $ " &2; } CLAUDE IMAGE="${CLAUDEBOX IMAGE:-${CLAUDE IMAGE:-}}" full="${CLAUDEBOX FULL:-${CLAUDE FULL:-}}" -z "$ full" && "$CLAUDEBOX INSTALLED VARIANT" = "full" && full=1 if -z "$CLAUDE IMAGE" ; then if -n "$ full" ; then CLAUDE IMAGE="psyb0t/claudebox:latest-full" else CLAUDE IMAGE="psyb0t/claudebox:latest" fi fi CLAUDE GIT NAME="${CLAUDEBOX GIT NAME:-${CLAUDE GIT NAME:-}}" CLAUDE GIT EMAIL="${CLAUDEBOX GIT EMAIL:-${CLAUDE GIT EMAIL:-}}" CLAUDE DIR="${CLAUDEBOX DATA DIR:-${CLAUDE DATA DIR:-$HOME/.claude}}" CLAUDE SSH="${CLAUDEBOX SSH DIR:-${CLAUD… Evidence: `wrapper.sh`
- **Init** (source_file): all = "ClaudecodeAdapter" Evidence: `claudebox/claudebox/__init__.py`
- **Adapter** (source_file): logger = logging.getLogger name ⋮---- DEFAULT PERMISSION MODE = "bypassPermissions" STREAM TOOL RESULT TRUNCATE = 2000 SKILLS DIR DEFAULT = "/home/aicode/.claude/.always-skills" SYSTEM HINT FILE DEFAULT = "/home/aicode/.claude/system-hint.txt" ⋮---- CLAUDE MODELS = "haiku", "sonnet", "opus", "opusplan" CLAUDE THINKING LEVELS = "off", "low", "medium", "high", "xhigh", "max" ⋮---- VALID STOP REASONS = {"end turn", "stop sequence", "max tokens", "tool use", "error"} ⋮---- JSON SCHEMA DIRECTIVE = ⋮---- def truncate value: Any, limit: int = 80 - str ⋮---- s = str value ⋮---- def read always skills skills dir: str - str ⋮---- """Concat every SKILL.md under skills dir as Skill file: path \n\n bloc… Evidence: `claudebox/claudebox/adapter.py`
- **10 Claude Json Patch** (source_file): set -euo pipefail CLAUDE JSON="${CLAUDE CONFIG DIR:-$HOME}/.claude.json" SEED JSON="/claude/.claude.json" WORKSPACE DIR="${AICODEBOX WORKSPACE:-${AICODE WORKSPACE:-/workspace}}" mkdir -p "$ dirname "$CLAUDE JSON" " if ! -f "$CLAUDE JSON" ; then if -f "$SEED JSON" ; then cp "$SEED JSON" "$CLAUDE JSON" else echo "{}" "$CLAUDE JSON" fi fi if ! command -v jq /dev/null 2 &1; then echo " 10-claude-json-patch jq missing; skipping" &2 exit 0 fi tmp="$ mktemp " jq \ --arg dir "$WORKSPACE DIR" \ '.installMethod = "global" .autoUpdates = false .autoUpdatesProtectedForNative = true .projects $dir .hasTrustDialogAccepted = true' \ "$CLAUDE JSON" "$tmp" && mv "$tmp" "$CLAUDE JSON" Evidence: `claudebox/init.d/10-claude-json-patch.sh`
- **20 Workspace Claude Md** (source_file): set -euo pipefail WORKSPACE DIR="${AICODEBOX WORKSPACE:-${AICODE WORKSPACE:-/workspace}}" VARIANT="${CLAUDEBOX IMAGE VARIANT:-minimal}" TEMPLATE="/opt/claudebox/templates/CLAUDE.md.${VARIANT}" if ! -f "$TEMPLATE" ; then TEMPLATE="/opt/claudebox/templates/CLAUDE.md.minimal" fi if ! -f "$TEMPLATE" ; then echo " 20-workspace-claude-md no template at $TEMPLATE; skipping" &2 exit 0 fi mkdir -p "$WORKSPACE DIR" if ! -f "${WORKSPACE DIR}/CLAUDE.md" ; then cp "$TEMPLATE" "${WORKSPACE DIR}/CLAUDE.md" fi Evidence: `claudebox/init.d/20-workspace-claude-md.sh`
- **30 Always Skills Seed** (source_file): set -euo pipefail SKILLS DIR="${HOME}/.claude/.always-skills" HINT FILE="${HOME}/.claude/system-hint.txt" mkdir -p "$SKILLS DIR" chmod 755 "$SKILLS DIR" if ! -f "$HINT FILE" ; then cat "$HINT FILE" <<'HINT' You are running in a Docker container with passwordless sudo access. ~/.claude/bin is in PATH — custom user scripts may be available there. Docker socket may be mounted for docker-in-docker. The workspace path inside the container matches the host path so docker volume mounts from within this container resolve correctly on the host. HINT fi Evidence: `claudebox/init.d/30-always-skills-seed.sh`
- **Third-Party Software** (documentation): claudebox's own code this repo, minus the exceptions below is WTFPL LICENSE -licensed. The published Docker images psyb0t/claudebox:latest , psyb0t/claudebox:latest-full , however, install third-party tools at build time that ship under their own licenses. This file lists everything the published images redistribute — not dev-only dependencies, not things the end user downloads themselves after the box is running. Evidence: `THIRD_PARTY.md`
- **claudebox setup** (documentation): - Docker installed and running. That's it — the wrapper handles the rest. - An Anthropic credential: CLAUDE CODE OAUTH TOKEN via claudebox setup-token or ANTHROPIC API KEY . Evidence: `.agents/skills/claudebox/references/setup.md`
- **Glama** (structured_config): { "$schema": "https://glama.ai/mcp/schemas/server.json", "maintainers": "psyb0t" } Evidence: `glama.json`
- **Server** (structured_config): { "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json", "name": "io.github.psyb0t/claudebox", "title": "Claudebox", "description": "Self-hosted MCP server exposing Claude Code as an agentic AI tool over streamable HTTP.", "version": "0.0.0", "repository": { "url": "https://github.com/psyb0t/docker-claudebox", "source": "github" }, "packages": { "registryType": "oci", "identifier": "docker.io/psyb0t/claudebox:latest", "runtimeHint": "docker", "transport": { "type": "streamable-http", "url": "http://localhost:8080/mcp/" } } } Evidence: `server.json`
- **Openclaw.Plugin** (structured_config): { "name": "@psyb0t/claudebox", "id": "@psyb0t/claudebox", "version": "0.0.0", "type": "code-plugin", "summary": "Wire an OpenClaw agent to a self-hosted claudebox Claude Code on the network instance over MCP.", "description": "A thin stdio HTTP bridge that connects an MCP client OpenClaw, Claude, Cursor, Codex, ... to a running claudebox instance's MCP endpoint /mcp , exposing its 5 tools: run prompt run a prompt through the containerized Claude Code CLI, with full file/shell/tool access to the workspace , list files, read file, write file, and delete file. claudebox is self-hosted — you run the container yourself and point this bridge at it. See https://github.com/psyb0t/docker-claudebox."… Evidence: `.agents/plugins/claudebox/openclaw.plugin.json`
- **.gitignore** (source_file): CLAUDE.md pycache .pyc .research files git-update.sh docker-compose.dev.yaml tests/.env tests/logs/ tests/.tmp- / tests/.fixtures/mounts/ !tests/.fixtures/mounts/.gitkeep tests/.fixtures/cron- / .e2e-cron-tg/ base/ desc.txt pyrightconfig.json .telemetry/ .prompts/ .testing/ tests/.smoke-fixture/ tests/.smoke-ext-fixture/ .refactor/ Evidence: `.gitignore`
- **claudebox — Claude Code on the aicodebox base.** (source_file): claudebox — Claude Code on the aicodebox base. Build base lives in ../docker-aicodebox : docker build -t aicodebox-base:local ../docker-aicodebox/ docker build --build-arg BASE IMAGE=aicodebox-base:local -t claudebox:local . Minimal variant. The toolchain-loaded full variant lives in Dockerfile.full and layers on top of the image this file produces. NOTE on hardening: the base sets aicode UID 1000 as its runtime user via setpriv inside aicodebox-entrypoint . This Dockerfile switches to root only for the install steps below; runtime drops back to aicode automatically. ARG BASE IMAGE=psyb0t/aicodebox:v0.14.0@sha256:543aec8bf85ebc8a0689c4746d4c9e2ede65599decb50827593db0b3c65bd2a5 FROM ${BASE I… Evidence: `Dockerfile`
- **Apache 2.0** (source_file): Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ Evidence: `LICENSES/Apache-2.0.txt`
- **Single-source version derivation — claudebox/pyproject.toml project version** (source_file): IMAGE NAME := psyb0t/claudebox Single-source version derivation — claudebox/pyproject.toml project version is THE truth. Override at build time: VERSION=2.0.0-rc1 make build . VERSION ?= $ shell awk -F\" '/^version = "/ {print $$2; exit}' claudebox/pyproject.toml TAG := v$ VERSION Default to the published aicodebox base, digest-pinned keep in sync with the ARG default in Dockerfile — override with make build BASE IMAGE=... to point at a locally-built base image. BASE IMAGE ?= psyb0t/aicodebox:v0.14.0@sha256:543aec8bf85ebc8a0689c4746d4c9e2ede65599decb50827593db0b3c65bd2a5 CLAUDE VERSION ?= 2.1.220 Evidence: `Makefile`
- **Update marker: the wrapper's --update touched . -update. Update first,** (source_file): set -euo pipefail readonly CLAUDE BIN="claude" readonly CFG="${CLAUDE CONFIG DIR:-$HOME/.claude}" readonly CONTAINER="${CLAUDEBOX CONTAINER NAME:-}" dbg { "${DEBUG:-}" = "true" && printf ' claudebox-agent %s\n' "$ " &2 return 0 } case "${1:-}" in setup-token -v --version doctor auth mcp dbg "passthrough subcommand: ${1}" exec "$CLAUDE BIN" "$@" ;; esac hint file="${CLAUDEBOX SYSTEM HINT FILE:-$CFG/system-hint.txt}" skills dir="${CLAUDEBOX ALWAYS SKILLS DIR:-$CFG/.always-skills}" append="" -f "$hint file" && append="$ cat "$hint file" " if -d "$skills dir" ; then while IFS= read -r -d '' skill file; do skill content="$ cat "$skill file" " -n "$skill content" continue skill block=" Skill file… Evidence: `claudebox-agent.sh`
- **Claudebox cron configuration** (source_file): Claudebox cron configuration Copy somewhere accessible e.g. ~/.claude/cron.yaml and point CLAUDEBOX CRON MODE FILE at it. Run with: CLAUDEBOX CRON MODE=1 CLAUDEBOX CRON MODE FILE=/home/aicode/.claude/cron.yaml claudebox or via docker-compose see README . Each job fires claude -p " " on schedule. Output streams to ~/.claude/cron/history/ / - /activity.jsonl alongside stderr.log and meta.json. Workspace: CLAUDEBOX WORKSPACE env var wrapper sets it to $PWD . All jobs share one workspace. Cron syntax: 5-field "min hr dom mon dow" — standard cron, minute resolution 6-field "sec min hr dom mon dow" — sub-minute resolution e.g. /30 fires every 30s Root-level fields set defaults for all jobs. Per-j… Evidence: `cron.yml.example`
- **Run E2E Cron Telegram** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "$0" " && pwd " WORKSPACE="$SCRIPT DIR/.e2e-cron-tg" CRON YAML="$WORKSPACE/cron.yaml" TELEGRAM YAML="$WORKSPACE/telegram.yml" CNAME="claudebox-cron-tg-e2e cron" if -f "$SCRIPT DIR/tests/.env" ; then set -a; . "$SCRIPT DIR/tests/.env"; set +a fi : "${CLAUDE CODE OAUTH TOKEN:?CLAUDE CODE OAUTH TOKEN not set put it in tests/.env }" : "${CLAUDEBOX TELEGRAM BOT TOKEN:?CLAUDEBOX TELEGRAM BOT TOKEN not set put it in tests/.env }" : "${TELEGRAM CHAT ID:?TELEGRAM CHAT ID not set put it in tests/.env }" OAUTH="$CLAUDE CODE OAUTH TOKEN" BOT TOKEN="$CLAUDEBOX TELEGRAM BOT TOKEN" CHAT ID="$TELEGRAM CHAT ID" mkdir -p "$WORKSPACE" cat "$CRON YAML" "$TELEGRAM Y… Evidence: `run-e2e-cron-telegram.sh`
- **Telegram bot configuration** (source_file): Telegram bot configuration Copy to ~/.claude/telegram.yml and edit Evidence: `telegram.yml.example`
- **Per-test logs: stdout+stderr of every test goes to tests/logs/ .log** (source_file): set -euo pipefail SCRIPT DIR="$ cd "$ dirname "$0" " && pwd " source "$SCRIPT DIR/tests/common.sh" for f in "$SCRIPT DIR"/tests/test .sh; do source "$f" done if "${1:-}" = "--help" "${1:-}" = "-h" ; then usage exit 0 fi TESTS TO RUN= "${@}" if ${ TESTS TO RUN= "${ALL TESTS @ }" fi for t in "${TESTS TO RUN @ }"; do if ! declare -f "$t" /dev/null 2 &1; then echo "unknown test: $t" echo "" usage exit 1 fi done trap cleanup EXIT setup Per-test logs: stdout+stderr of every test goes to tests/logs/ .log overwritten each run . The new e2e tests also dump container logs into this dir so a failure has all the evidence in one place. export TEST LOG DIR="$SCRIPT DIR/tests/logs" mkdir -p "$TEST LOG DIR… Evidence: `test.sh`

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `README.md`, `.agents/plugins/claudebox/README.md`, `docs/customization.md`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `README.md`, `.agents/plugins/claudebox/README.md`, `docs/customization.md`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Introduction and Getting Started**: importance `high`
  - source_paths: README.md, install.sh, wrapper.sh, CHANGELOG.md
- **Operating Modes and Interfaces**: importance `high`
  - source_paths: claudebox/claudebox/__init__.py, claudebox/claudebox/adapter.py, docs/modes/interactive.md, docs/modes/programmatic.md, docs/modes/api.md
- **Configuration, Customization, and Agent Integrations**: importance `high`
  - source_paths: docs/environment-variables.md, docs/customization.md, .env.example, claudebox/init.d/10-claude-json-patch.sh, claudebox/init.d/20-workspace-claude-md.sh
- **Docker Architecture and Deployment**: importance `medium`
  - source_paths: Dockerfile, Dockerfile.full, .dockerignore, claudebox-entrypoint.sh, claudebox/pyproject.toml

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `6f22142dfbc81ab06c45141a3317dfbc13e6a5df`
- inspected_files: `Dockerfile`, `README.md`, `docs/customization.md`, `docs/environment-variables.md`, `docs/modes/api.md`, `docs/modes/cron.md`, `docs/modes/interactive.md`, `docs/modes/programmatic.md`, `docs/modes/telegram.md`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: downstream_validation.risk_items | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: No sandbox install has been executed yet; downstream must verify before user use.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.safety_notes | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.scoring_risks | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 6: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/psyb0t/docker-claudebox
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
