# Claudebox
<!--
ref: @integrations/claudebox
tags: [Docker, development, protocols, automation]
triggers: [need to isolate development environment, iterating on project goals, fixing bugs in a safe space, managing multiple projects]
trigger_prompt: When a developer wants to create a safe, isolated environment for goal-oriented tasks or needs to iterate on project objectives without affecting the main system.
category: integration
last_reviewed: 2026-04-30
complements: [@protocol/devloop, @protocol/loop]
audience: [claude-code-user, agent-author, terminal-only]
version: 9
updated_at: 2026-07-14T21:18:41.248Z
-->

`claudebox [protocol] "goal"` runs Claude in a Docker sandbox with permissions skipped — host networking so localhost works both ways, `--with` sibling mounts, `.env`/cloud-DB safety checks, and a protocol (devloop, looping, pmloop) layered on the bootstrap.

## Usage

```bash
claudebox [protocol] "goal" [options]
```

### Examples

```bash
claudebox devloop "fix the login bug"        # Development with looping
claudebox devloop "complex refactor" -i      # Interactive goal setting
claudebox devloop "feature" -f kickoff.md    # File-based goal
claudebox looping "iterate on design"        # Generic looping
claudebox "quick task"                       # No protocol, bootstrap only
```

## Protocols

| Protocol | What It Does |
|----------|--------------|
| `devloop` | Session + looping + dev practices (see `@protocol/devloop`) |
| `looping` | Session + reflect cycle (see `@protocol/loop`) |
| `pmloop` | Session + looping + product practices |
| `marketloop` | Session + looping + marketing practices |
| (none) | No protocol, loads `/bootstrap.md` only |

## Options

| Flag | Purpose |
|------|---------|
| `-i` | Interactive goal setting (build spec.md via conversation) |
| `-f FILE` | File-based goal ingestion (build spec.md from file) |
| `--with PATH` | Mount sibling directory read-write (can repeat) |
| `--with-ro PATH` | Mount sibling directory read-only (can repeat) |
| `--no-web` | Disable internet access |
| `--no-local-db` | Disable host network (isolate container networking) |
| `--no-symlinks` | Don't mount symlink targets |

## What It Does

1. Creates Docker sandbox with dangerous mode enabled
2. Mounts your project at `/$PROJECT_NAME`
3. Uses host network so `localhost` works bidirectionally
4. Fetches and loads specified protocol
5. Protocol creates session and begins work

## Networking

By default, claudebox uses `--network=host` so the container shares your host's network:

- **localhost inside container** → reaches host services (databases, APIs, etc.)
- **Services started in container** → accessible at localhost on host
- **Full internet access** → same as running natively

Use `--no-local-db` to isolate container networking (uses bridge network instead).
Use `--no-web` to disable all network access.

## Session Structure

When using a protocol (devloop, looping, etc.), claudebox creates:

```
project/workspace/YYYY-MM-DD-HHMM-goal-slug/
├── spec.md    # Goal, vision, ideas
├── log.md     # Timestamped actions
```

See session.md (see session protocol) for the full convention.

## Safety Checks

| Check | Behavior |
|-------|----------|
| `.env` → non-local symlink | **FAIL** - must link to `.local.env` |
| Cloud DATABASE_URL | **WARN** - prompts for confirmation |
| `.main.env` exists | **NOTE** - informational |

## Multi-Project Work

```bash
claudebox devloop "cross-project refactor" --with ~/other-repo
claudebox devloop "port feature" --with-ro ~/reference
```

Siblings are mounted at `/$BASENAME`.

## Session Resume

Same goal slug resumes existing session:

```bash
claudebox devloop "fix bugs"    # Creates session
claudebox devloop "fix bugs"    # Resumes same session
```

## Install

```bash
cd protocol/protocol/claudebox && ./install-claudebox.sh
```

Installs to `~/.protocol/` and builds Docker image.

## Requirements

- Docker installed and running
- Claude login (prompts on first run if needed)

## Cloud Claude Mapping

Same paradigm works for cloud Claude (future):

```bash
# Local
claudebox devloop "fix bugs"

# Cloud (conceptual)
POST /claudebox {
  repo: "github.com/user/repo",
  protocol: "devloop",
  goal: "fix bugs"
}
```

Both create sandbox, load protocol, execute goal.

---

*Related: `@integrations/linkedin` · `@integrations/agent-browser` · `@protocol/groom-protocols` · `@protocol/protocol-api` · `@content/youtube/dan-martell/it-s-actually-pretty-easy-to-get-ahead-of-99-of-people-with-ai`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*