Run your tests on sandboxes
Your agent runs your test suite on sandboxes instead of your laptop. It sets up one sandbox the way your CI sets up its tests and keeps it as a snapshot. Then each QA pass starts from that snapshot, copies in your local changes, and splits the tests across copies of it. Your machine stays free, and the suite takes about as long as its slowest share.
We tried it on two open source repos, with 4 copies of an 8 vCPU snapshot. On saleor (Django and Postgres, about 18,000 tests) a pass took about 3 minutes, start to cleanup; the same tests take about 14 minutes in its own CI. On vite (unit and Playwright tests) a pass took about a minute, against about 2 minutes 20 seconds in its CI.
Hand it to your agent
Paste this into Claude Code, Cursor or Codex in your repo. The agent reads how in llms.txt. In the dashboard, a CI job's page has the same prompt for that job: open the job and press Run these tests on sandboxes.
Run this repo's tests on Groundbox sandboxes (groundbox.dev), so QA of my local changes runs on its own VMs instead of this machine. Read https://groundbox.dev/llms.txt first; it says how. Use the groundbox CLI (npx @groundbox/cli@latest).
1. Build a ready-to-test snapshot: this repo at main in an 8 vCPU sandbox, set up the way CI sets up the test jobs (runtime, dependencies, and any services, test database or build step it needs). Prove it with one test file, then keep it.
2. Write bin/qa-groundbox: it starts a sandbox from the snapshot, copies in my working-tree changes, forks it into 4 copies that each run a quarter of the tests, prints the failures (marking any that fail without my changes too), and deletes the sandboxes after.
3. Run it once on my current branch and tell me how long it took next to the same tests here or in CI.
Don't put secrets in the snapshot. If the tests need any, use groundbox secrets.What it builds
- A snapshot set up like CI.
groundbox sandbox create --cpus 8, the repo at the commit your local main is on, then what the CI test job does: the runtime and dependencies, the build, theservices:containers (withsudo docker run), the test database. One test file proves it, thengroundbox snapshot keep <sandbox_id>. Running services come back with every sandbox started from it. - A script,
bin/qa-groundbox. It starts a sandbox from the snapshot (--snapshot <snap_id>), copies in your changes as one patch (committed, uncommitted and new files), builds, and runsgroundbox sandbox fork <id> --count 4 --size source. Each copy hasFORK_INDEXset, from 0 to 3, and runs its share of the tests with CI's own test command, split by the test runner's own--shardwhere it has one. - The report. The failures, from each copy's JUnit report. A copy with failures takes your changes out and runs the same test files again, so a test that fails either way is marked as not yours. Then the script deletes every sandbox it made, also on Ctrl-C.
Secrets
Nothing secret goes into the snapshot. Tests that need a token get it when they run: groundbox secrets set NAME once, then --secret NAME on the sandbox. For an API key the tests send to one host, a secret binding adds it to those requests and the value never enters the sandbox.
Good to know
groundbox sandbox execstops a command after 60 seconds unless you give--timeout SECONDS. Installs and test runs need it.- A split suite runs tests in a different order than one long run. Tests that depend on what ran before them can fail in a share; the rerun without your changes marks those.
- A pass is 5 sandboxes of 8 vCPU for a few minutes, billed by the second at $0.04 per vCPU-hour. The snapshot is billed at $0.05 per GB-month, and is deleted after a month with no sandbox started from it. When your dependencies change, build it again.
- More on the parts: Snapshots, Fork, Commands.