The command transaction layer for coding agents.
shadox wraps agent-executed shell commands with trace, diagnostics, workspace checkpoints, rollback, replay, and optional FUSE-backed I/O controls. It lets an agent run code-changing commands with an explicit transaction record instead of guessing what happened from stdout.
Coding agents do more than call APIs. They edit files, run tests, format code, generate assets, update snapshots, and sometimes leave a workspace half-changed after failure.
Shadox gives those commands a stable runtime contract:
- Observe each run with JSONL trace events and a final JSON summary.
- Recover workspace state with checkpoint, diff, rollback, replay, materialize, and commit.
- Control FUSE-backed agent workspace I/O with metrics, throttling, latency, errno injection, and bounded freeze tests.
- Integrate through a provider-neutral CLI or MCP tools.
Shadox is currently distributed as a Rust project. Build the CLI from source:
git clone https://github.com/wotchin/shadox.git
cd shadox
cargo build --release --locked
install -Dm755 target/release/shadox ~/.local/bin/shadoxEnable the optional FUSE-backed agent FS features when you want operation-level I/O tracing and control:
cargo build --release --locked --features fuseRecommended runtime target: Linux, WSL, or a Linux CI runner. For stronger isolation, run shadox inside the trusted container, VM, remote runner, or sandbox you already use.
Wrap a command that may modify the workspace:
shadox run \
--profile workspace-write \
--allow-write . \
--versioned-workspace . \
--rollback-on-failure \
--summary .shadox/last-summary.json \
--trace .shadox/last-trace.jsonl \
-- cargo testThe agent should read .shadox/last-summary.json after the command exits. The summary contains the process result, failure classification, diagnostics, and workspace transaction state.
Useful first commands:
shadox check-env --json
shadox agent-guide --format markdown
shadox capabilities --format json
shadox explain --profile workspace-write --allow-write . -- cargo testCreate a recoverable command transaction:
shadox run --versioned-workspace . --rollback-on-failure -- npm testInspect and recover workspace state:
shadox fs status .
shadox fs log .
shadox fs diff <checkpoint_a> <checkpoint_b> --workspace .
shadox fs rollback <checkpoint_id> --workspace .
shadox fs materialize <checkpoint_id> ./historical-view --workspace .Replay a run without mutating the live workspace:
shadox fs journal <run_id> --workspace .
shadox fs replay <run_id> ./replayed-view --workspace . --until-seq 3Use operation-level agent FS tracing and controls:
cargo run --features fuse -- fs mount ./workspace ./mnt --workspace ./workspace --run-id <run_id>
shadox fs op-journal <run_id> --workspace ./workspace
shadox fs op-replay <run_id> ./operation-view --workspace ./workspace --until-seq 3
shadox fs fuse-metrics <run_id> --workspace ./workspace
shadox fs fuse-control <run_id> --workspace ./workspace --op write --delay-ms 100
shadox fs fuse-control <run_id> --workspace ./workspace --op write --path-contains snapshots --error enospc
shadox fs fuse-control <run_id> --workspace ./workspace --clearThe CLI is the primary integration surface. Any agent framework that can run a command can use shadox.
| Ecosystem | Recommended use |
|---|---|
| LangGraph | Wrap shadox run in a tool node and store summary.json in graph state. |
| OpenAI Agents SDK | Use the stdio MCP server or a small function tool backed by the CLI. |
| AutoGen | Wrap code execution with shadox run. |
| IDE agents | Route risky shell commands through shadox before applying follow-up edits. |
| CI agents | Capture transaction evidence for generated changes, migrations, and tests. |
Start the MCP server:
shadox mcpCore MCP tools include shadox.run, shadox.explain, shadox.fs_status, shadox.fs_rollback, shadox.fs_replay, shadox.fs_fuse_metrics, and shadox.fs_fuse_control.
cargo fmt --all --check
cargo test --all-targets --locked
cargo test --all-targets --features fuse --locked
cargo clippy --all-targets --all-features --locked -- -D warningsRun the opt-in real FUSE mount test on Linux when /dev/fuse is available:
SHADOX_RUN_FUSE_MOUNT_TESTS=1 cargo test --features fuse --test fuse_mount -- --nocaptureApache-2.0