#claude #nix #automation #dagger

app ai-yolo

Run Claude Code in YOLO mode inside a sandboxed Dagger container with Nix support

1 unstable release

Uses new Rust 2024

0.1.0 Mar 17, 2026

#2492 in Development tools

MIT license

24KB
277 lines

ai-yolo

Run Claude Code in YOLO mode inside a sandboxed Dagger container with full Nix support.

What it does

ai-yolo builds an Alpine-based container with Nix and Claude Code pre-installed, mounts your project directory, and runs Claude Code with --dangerously-skip-permissions so the AI agent can freely modify files, run commands, and iterate on your codebase — all inside an isolated container.

Key features:

  • Sandboxed execution — Claude runs inside a Dagger container, not on your host
  • Nix support — full nix-command and flakes enabled inside the container
  • Branch isolation — automatically creates a new git branch for AI changes
  • Credential forwarding — mounts your ~/.claude credentials into the container

Installation

cargo install ai-yolo

Usage

Run Claude Code against your project

# Use a prompt file (default: prompt.md in project root)
ai-yolo run

# Use an inline prompt
ai-yolo run --prompt "Fix all clippy warnings and add tests"

# Specify a project directory and prompt file
ai-yolo run --project /path/to/project --prompt-file tasks/refactor.md

# Pass extra environment variables
ai-yolo run --env ANTHROPIC_API_KEY=sk-...

# Skip branch isolation
ai-yolo run --no-branch --prompt "Update dependencies"

Build the container image

ai-yolo build
ai-yolo build --output my-image.tar

Prerequisites

  • Dagger CLI installed and running
  • Claude Code credentials configured (claude /login on the host)
  • Git repository (for branch isolation features)

How branch isolation works

By default, ai-yolo run will:

  1. Verify the working tree is clean
  2. Create a new branch ai-yolo/<timestamp> from the current branch
  3. Run Claude Code inside the container
  4. Commit any changes Claude made
  5. Switch back to your original branch

You can then review and merge the changes at your leisure. Use --no-branch to skip this and run directly on the current branch.

License

MIT

Dependencies

~20–39MB
~517K SLoC