npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aurbi/codebox

v0.2.0

Published

Sandbox coding agents inside Docker containers

Readme

Codebox

Sandbox coding agents inside Docker containers. Run agents like Claude Code in their most permissive mode without risking your host system.

Codebox is a thin wrapper around Docker — it builds the right docker run command from config and flags, manages container lifecycle, and forwards stdio.

Quick Start

# Build and install
npm install
npm run build
npm link

# Build the Docker image
docker build -t codebox/claude-code:latest images/claude-code/

# Create config (optional)
mkdir -p ~/.config/codebox
cat > ~/.config/codebox/codebox.json << 'EOF'
{
  "extra-binds": {
    "~/.claude": "~/.claude"
  },
  "environment": {
    "ANTHROPIC_API_KEY": "$ANTHROPIC_API_KEY"
  }
}
EOF

# Launch a sandbox
cd your-project/
codebox

Commands

| Command | Description | |---------|-------------| | codebox / codebox start | Launch a sandbox in the current directory | | codebox list / codebox ls | Show all codebox containers (running + stopped) | | codebox attach <name> | Re-attach to an existing container | | codebox stop <name> | Stop a running container | | codebox rm <name> | Remove a stopped container |

Start Flags

--no-tty              Headless mode — stdin/stdout piped, no pseudo-TTY
--existing <behavior> Conflict behavior when a container already exists:
                        reattach — attach to existing (start if stopped)
                        replace  — stop & remove old, launch fresh
                        new      — launch additional container
-- <docker-args...>   Passthrough args for docker run

If --existing is omitted and a container already exists for the workspace, codebox prompts interactively. In headless mode (--no-tty), it errors instead of prompting.

Configuration

Codebox loads configuration from two optional files, merged together:

  1. System: ~/.config/codebox/codebox.json
  2. Project: .codebox.json in the current working directory (overrides system config)

For object fields (extra-binds, environment), project values are merged with system values. For scalar fields (image, user) and arrays (extra-args), project values replace system values.

{
  "image": "codebox/claude-code:latest",
  "user": "1000:1000",
  "extra-binds": {
    "~/.claude": "~/.claude"
  },
  "environment": {
    "ANTHROPIC_API_KEY": "$ANTHROPIC_API_KEY"
  },
  "extra-args": ["--cpus=2", "--memory=4g"]
}

| Key | Description | Default | |-----|-------------|---------| | image | Docker image to use | codebox/claude-code:latest | | user | Container user (UID:GID or "root"). If omitted, uses host UID:GID | Host UID:GID | | extra-binds | Host:container path pairs (~ expanded on both sides) | {} | | environment | Env vars for the container (values starting with $ resolve from host env) | {} | | extra-args | Additional arguments passed to docker run | [] |

The workspace bind ($PWD:/workspace) is always applied implicitly. CLI passthrough args (-- <args>) take precedence over extra-args from config.

How It Works

When you run codebox, it:

  1. Checks Docker is available
  2. Loads config from ~/.config/codebox/codebox.json and .codebox.json (if they exist)
  3. Checks for existing containers for this workspace (via Docker labels)
  4. Pulls the image if not available locally
  5. Runs docker run with the right flags: workspace mount, network host, env vars, bind mounts
  6. Forwards stdio and signals (Ctrl+C works naturally)

Containers are named codebox-<dirname> where the directory name is lowercased and non-alphanumeric characters are replaced with hyphens (e.g., My_Projectcodebox-my-project). When using --existing=new, a suffix is appended (-2, -3, etc.). Containers persist after exit — use codebox list, codebox stop, and codebox rm to manage them.

Headless / Programmatic Mode

codebox start --no-tty --existing=replace

Runs without a pseudo-TTY — stdin/stdout are piped for programmatic control. Combine with --existing=replace for fully non-interactive automation. The outer process talks directly to the inner agent over stdio.

Development

npm install
npm run build          # Compile TypeScript
npm test               # Run tests
npm run test:watch     # Watch mode

Requirements

  • Node.js 18+
  • Docker