Coding agents that start work on a repo that is already built
Promigence gives a coding agent a sandbox forked from a verified snapshot of the repository, with dependencies installed and the build done. The agent starts at a built tree instead of a git clone, so its edit-and-check loop runs at warm speed from the first step.
Who this is for: Teams building coding-agent products and software factories that run agents against customer repositories.
warm fork
forks in six hours, zero failures
at 200 concurrent, all served
Three things that are true of almost every team doing this
Every task starts with a clone and an install
Before an agent writes a line, it waits for the repository to download, the dependencies to install and the first build to finish. On a real repository that is minutes, paid again on every task.
Each check in the loop is a cold build
An agent that edits, type-checks and edits again pays the cold price on every check. A type-check that takes 24 seconds cold sets the pace of the whole loop.
Your users watch the spinner
The wait is theirs. A task that takes nine minutes loses the person who asked for it.
With Promigence underneath
Start from a built snapshot
Build the repository once, with a verify command. Every sandbox forks from that result, so the agent's first command runs against an installed, built tree.
Warm checks at every step
The type-check that costs 24 seconds on a cold machine costs 1.5 seconds on a warm fork, so a twenty-step task finishes in about a minute instead of nine.
A sandbox per task, as many as you need
Fork one per task. Each is isolated, and one that sits idle can pause itself until it is needed again.
# Once per repo, or when the lockfile changes
promigence snapshot create --image node:22 \
--setup "git clone https://github.com/your-org/app /work/repo && git -C /work/repo checkout <40-char sha>" \
--setup "cd /work/repo && npm ci && npm run build" \
--verify "cd /work/repo && npm test" --alias app --wait --wait-timeout 10m
# Per task: a warm sandbox, then your agent's commands
promigence fork --snapshot app --count 1 --cap 1
promigence exec --sandbox "$SANDBOX" -- sh -c "cd /work/repo && npm run typecheck"
Language: bashWhat is the best sandbox for running AI coding agents?
Pick the sandbox that keeps the agent's edit-then-check loop short, because a coding agent checks its work dozens of times in one task and starts only once. Four things decide that: the repository already installed and built when the agent arrives, checks that run where the code lives, a separate sandbox for every task, and a spend limit agreed before the work begins. On Promigence, each task gets all four from a snapshot of your repository that passed your own test command.
How it works
- 01
Build the repository once
Pin a commit, list the install and the build as setup steps, and give the snapshot your test command as its verify step, the way the example above does. A build that fails its verify step is never stored, so no agent opens on a broken tree. That build costs at most $0.17 at the default small size, charged by the second for as long as it runs.
- 02
Start an agent in its own sandbox
Any of Claude Code, Codex or OpenCode starts with one command.
--key-from-envsaves the model key as a Promigence secret before anything runs, so the value never lands in shell history or a process listing, and--capis the most that sandbox may spend in US dollars. To open the agent in your built tree, start it from the snapshot's alias instead; the Claude Code guide shows that form.
Language: bashexport ANTHROPIC_API_KEY=... # already set in most setups promigence agent start claude --key-from-env ANTHROPIC_API_KEY --cap 2From the guide Run Claude Code, Codex or OpenCode in a sandbox
- 03
Try several approaches at once
Some tasks deserve more than one attempt. Install once in one sandbox, take a snapshot of it while it runs, then start copies from that snapshot: each begins with the dependencies in place and writes only to its own files.
promigence runhands every copy its own index and prints a report of which attempts passed, with any environment failure kept apart from the attempt's.
Language: bashSID=$(promigence fork --count 1 --cap 1 --timeout 30m --fresh --json | jq -r '.sandboxes[0].sandbox_id') promigence exec --sandbox "$SID" --timeout 15m -- \ sh -c "git clone --depth 1 https://github.com/your-org/your-app /work/app && cd /work/app && npm install" promigence sandbox snapshot "$SID" --alias app-installed --move-alias promigence sandbox kill "$SID" promigence run --snapshot app-installed --count 10 --cap 3 --timeout 20m \ -- sh -c 'cd /work/app && ATTEMPT=$PROMIGENCE_INDEX node agent.js && npm test'From the guide Snapshot after npm install, then fork 10 copies
- 04
Let the agent on your laptop drive sandboxes
Going the other way, Claude Code on a developer's machine can start sandboxes, run commands in them and read their files once the CLI is registered as its MCP server. The
--capafterpromigence mcplimits what each sandbox it starts may spend. When the server stops, so do the sandboxes that session started.
Language: bashclaude mcp add promigence -- promigence mcp --cap 1From the guide Run Claude Code, Codex or OpenCode in a sandbox
What you get, in numbers
| Result | What | Conditions |
|---|---|---|
| 0.66 s | Agent step on a warm repository | An edit, then a type-check, on 4 vCPU; median of 30 runs, 0.80 s under load Source |
| 43.7 s | Whole coding-agent task | 20 steps on a 3 GB repository; median of 30 runs, 58.0 s under load Source |
| 8 ms | Sandbox ready to run a command | From create to the first command at 2 vCPU / 4 GiB; median of 100 runs Source |
| 1.41 s | 20 copies of a warm workspace | All 20 usable; median of 3 rounds Source |
What it costs
One agent task in a medium sandbox (4 vCPU, 16 GiB, the size the agent-step figure was measured on), given a 30-minute timeout and a $0.50 cap.
1,800 s × $0.000128 per second = $0.2304. That figure is the quote: what the task would cost if the sandbox ran for its whole timeout.
Total: at most $0.23 for the task, and under eight cents (600 s × $0.000128) if the agent finishes in ten minutes.
A start quoted above its cap is refused before anything runs, and a sandbox that hits its cap pauses with its files intact. Your model provider bills the agent's tokens separately.
Security and limits
- A secret enters the sandbox only at run time, and the snapshots you build never hold one unless you force it.
- Your code, your agent's outputs and your test results are not used to train models.
- You can delete a snapshot of your repository whenever you like, and what a task changes is discarded unless you keep it.
Questions
Does sandbox start time matter for a coding agent?
Start time matters far less than the time each check takes. A task starts once and runs its edit-then-check step dozens of times, so a slow check costs more over a whole task than any start. Time the step first.
Which coding agents can run in a Promigence sandbox?
promigence agent start launches Claude Code, Codex or OpenCode, and installs the agent in the sandbox if the snapshot does not already have it. Any other agent can work there through the CLI, the TypeScript and Python SDKs or the REST API.
How does an agent work on a private repository?
Through a GitHub connection you make once, with promigence github connect. The snapshot is built from the private repository with its dependencies installed and a check that must pass, and every agent started from it opens in the same verified tree.
How do you keep the model key safe?
Store it as a secret and never type it on a command line. --key-from-env reads the key from an environment variable and saves it for later runs. Secret values are removed from logs and outputs.
Can an agent try several fixes for the same task?
Yes. Snapshot a sandbox after the install, start as many copies as the task is worth, and keep whichever one passes its tests. No copy can touch another's files.
What stops a runaway agent?
Its spend cap and its timeout, whichever comes first. Both are set when the sandbox starts; without --cap, your organization's default cap applies. A sandbox stopped by its cap keeps its files, so you can inspect what the agent did.
Can my coding-agent product give each of its users a separate sandbox?
Yes, one per user, found again on that user's next message and paused when they go quiet. The guide on giving every user their own sandbox has the code in TypeScript and Python.
Run your own workload on it, free
Send a repo and the command you run against it, whatever that is: an eval suite, an RL rollout, a CI job, a queue of coding tasks. We build the environment once, run it a thousand times, and send back the timings, the failures and an exact price. Free, once, on your real workload.
- 1,000 runs of your own command, on your own repo
- What each one cost in wall clock, and anything that failed
- Whether a failure was your code or the environment
- An exact price for your real volume
Not ready to hand over a repo? Read the quickstart or check the numbers first.