trailofbits/claude-code-devcontainer

Sandboxed devcontainer for running Claude Code in bypass mode safely. Built for security audits and untrusted code review.

What it solves

Running AI agents like Claude Code with bypassPermissions enabled is risky because they can execute arbitrary commands on your machine. This project provides a containerized environment that isolates the agent, ensuring it can only access your project files and the container itself, rather than your entire host system.

How it works

It uses a Docker-based devcontainer to create a secure sandbox. You use a provided CLI tool (devc) to spin up containers for specific projects or shared workspaces. The container includes pre-installed development tools, persistent volumes for your settings and history, and automated configuration to handle Claude Code's authentication and permissions, keeping your host machine protected from unintended agent actions.

Who it’s for

This is designed for developers and security researchers who need to perform security audits, explore untrusted codebases, or conduct experimental AI-assisted coding tasks without exposing their host machine to potential risks.

Highlights

  • Filesystem Isolation: Restricts the agent's reach to the project directory and a disposable container.
  • Persistent Workflows: Keeps your shell history, Claude settings, and GitHub authentication across container rebuilds using dedicated volumes.
  • Tool-Ready Environment: Comes pre-configured with Ubuntu 24.04, Node.js, Python (via uv), and common CLI tools like tmux and fzf.
  • Flexible Networking: Supports optional network isolation using iptables and ipset to restrict outbound traffic for sensitive reviews.
  • Session Syncing: Includes a devc sync command to safely export session logs to your host for use with Claude Code's /insights feature.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch