Tools for running Claude Code autonomously in a sandboxed environment. The main use case is letting Claude work through a list of tasks iteratively, with each iteration running in isolation to limit potential damage from mistakes.
An autonomous loop runner that executes Claude iteratively until tasks are complete. Each iteration runs in a sandbox and outputs are logged for review.
Usage: loop [-f <prompt-file> | -s <file>...] [-n <max-iterations>]
-f <prompt-file> Use prompt from file
-s <file> Study file(s) and work on tasks (can be repeated)
-n <max-iterations> Maximum number of iterations (default: 20)
The loop exits when:
- Claude creates
target/loop/stop(signaling completion) - Maximum iterations are reached
- Claude exits with an error
Output files (in target/loop/):
stop- Signal file to halt the loopprogress.txt- Log of iteration start/end timesiter-N.json- JSON stream output from each iterationprev/- Previous run's iteration files (moved on new run)
Sandboxing scripts for different operating systems. Each script takes a command to run inside the sandbox.
Available implementations:
bubblewrap- Linux sandbox using bubblewrap- Read-only system directories
- Read-write access only to the current git repository
- Works with git worktrees
- Isolated PID namespace and resource limits
-
Install dependencies:
- clox - Claude output formatter
- bubblewrap - Linux sandboxing (if on Linux)
-
Create a
sandboxsymlink on your PATH pointing to the appropriate sandbox script for your OS:ln -s /path/to/claude-tools/sandbox/bubblewrap ~/bin/sandbox -
Add
bin/to your PATH or symlinkbin/loop:ln -s /path/to/claude-tools/bin/loop ~/bin/loop
Work through tasks in a plan file:
loop -s PLAN.mdUse multiple study files:
loop -s PLAN.md -s SPEC.mdCustom prompt from file:
loop -f my-prompt.txtLimit iterations:
loop -s PLAN.md -n 5Stop early:
touch target/loop/stop- The loop script builds a prompt (from file or by combining study files)
- Each iteration runs
sandbox claudewith the prompt - Claude works on tasks, commits changes, and marks progress
- When all tasks are done, Claude creates
target/loop/stop - The loop detects the stop file and exits
The sandbox ensures Claude can only modify files within the current git repository, protecting the rest of your system.