box
Sandboxed git workspaces for development. Clone, branch, break things — your repo stays untouched.

Why box?
Box gives you isolated git workspaces with session tracking — so you can freely experiment without touching your original repository.
Each session gets its own workspace. By default, git clone --local creates a fully independent repo with hardlinks — fast even for large repos, and nothing you do can affect the original. Alternatively, --strategy worktree uses git worktree for even faster, space-efficient workspaces that share the object store.
Features
- Isolated git workspaces —
git clone --local(default) orgit worktreefor per-session workspaces; host files are never modified - Session tracking — metadata tracks project directory, command, strategy, and creation time
- Multi-repo workspaces — register repos and create workspaces spanning multiple repos
- Shell integration —
cdinto workspaces automatically
Requirements
Install
Quick install
|
From crates.io
From source
Nix
Binary download
Pre-built binaries are available on the GitHub Releases page.
Quick Start
# Creates an isolated git workspace and cd's into it
Box must be run inside a git repository. It clones the current repo into ~/.box/workspaces/<name>/.
# Work in the isolated workspace...
# Done? Clean up
Running box with no arguments launches the interactive TUI. If sessions exist, you can select one to resume; otherwise it prompts to create one.
Session Naming
Each session gets a simple name:
Usage
)
)
|
Create a session
# Interactive prompt (asks for name, command)
# With a specific command
# Multi-repo workspace (select specific repos)
# Use git worktree instead of clone (faster, shares object store)
BOX_STRATEGY=worktree
Edit session repos
List and manage sessions
Navigate between workspaces
Options
box new
| Option | Description |
|---|---|
--strategy <strategy> |
Workspace strategy: clone (default) or worktree. Overrides $BOX_STRATEGY |
--repo <name> |
Select specific repos (repeatable). Only with registered repos |
-- cmd... |
Command to run (default: $BOX_DEFAULT_CMD if set) |
box list
| Option | Description |
|---|---|
--project, -p |
Show only sessions for the current project directory |
--quiet, -q |
Only print session names (useful for scripting) |
Environment Variables
| Variable | Description |
|---|---|
BOX_DEFAULT_CMD |
Default command for new sessions, used when no -- cmd is provided |
BOX_STRATEGY |
Workspace strategy: clone (default) or worktree |
Shell Completions
# Zsh (~/.zshrc)
# Bash (~/.bashrc)
How It Works
your-repo/ box new my-feature ~/.box/workspaces/my-feature/
.git/ ──── git clone --local ────> .git/ (independent)
src/ src/ (hardlinked)
... ...
By default, git clone --local creates a fully independent git repo using hardlinks for file objects. The clone has its own .git directory — commits, branches, resets, and destructive operations in the workspace cannot affect your original repository.
With --strategy worktree, box uses git worktree add --detach instead. This shares the object store with the parent repo, making workspace creation faster and more space-efficient. The tradeoff is that worktrees share refs with the parent — use this when you want lightweight workspaces and don't need full git isolation.
| Aspect | Detail |
|---|---|
| Workspace location | ~/.box/workspaces/<name>/ |
| Session metadata | ~/.box/sessions/<name>/ |
| Git isolation | Full with clone (default); shared object store with worktree |
| Cleanup | box remove deletes workspace and session |
Design Decisions
| Strategy | Trade-off |
|---|---|
| Bind-mount the host repo | No isolation at all; modifications affect your actual files |
| git worktree | Shares the .git directory with the host; checkout, reset, and rebase can affect host branches and refs |
| Bare-git mount | Still shares state; branch creates/deletes affect the host |
| Branch-only isolation | Nothing stops destructive git commands on shared refs |
Full copy (cp -r) |
Truly isolated but slow for large repos |
git clone --local is fully independent (own .git), fast (hardlinks), complete (full history), and simple (no wrapper scripts).
That said, git worktree is available via --strategy worktree for cases where speed and disk savings matter more than full isolation.
Claude Code Integration
Box works well with Claude Code for running AI agents in isolated workspaces:
Everything the agent does stays in the workspace. Delete the session when you're done.
License
MIT