How do I run Codex, Claude Code, OpenCode, Pi, and Gemini CLI side by side in isolated sandboxes?
Run Codex, Claude Code, OpenCode, Pi, and Gemini CLI in parallel isolated sandboxes with Statefold, from a local checkout to a pull request ready for review.
Running five different AI coding agents at the same time usually means five terminal windows, five sets of credentials to manage, and constant babysitting. There is a better way.
Quick answer: Statefold runs Codex, Claude Code, OpenCode, Pi, and Gemini CLI natively, each in its own isolated cloud sandbox. Machine time is billed per second from $0.10 to $0.55 an hour depending on size, and model tokens bill directly to your own subscriptions with no markup. You hand off a task from your terminal, agents work asynchronously and delegate to each other across harnesses, and you can ask the thread to notify you when the pull request is ready to review. Connected provider and GitHub credentials stay behind the Worker.
Which platforms actually support Codex, Claude Code, OpenCode, Pi, and Gemini CLI together in isolated sandboxes?
Statefold is built specifically to run all five of these harnesses natively, as they ship, in per-thread isolated cloud sandboxes. It does not wrap them in its own agent layer; Codex is still Codex, Claude Code is still Claude Code. Each thread gets its own container with your uncommitted work already inside, git access, and a persistent history that carries over between turns.
The alternative most often mentioned for multi-harness cloud work was Terragon, which ran Claude Code, Codex, Amp, and Gemini CLI in cloud sandboxes with your own subscriptions. Terragon shut down on February 9, 2026, and its code is now open source under Apache-2.0 with no guarantee of maintenance. Statefold covers much of the same ground and adds OpenCode, Pi, cross-harness delegation, and egress-injected credentials.
How does sandbox isolation work when multiple agents are running at the same time?
Every thread gets exactly one container. That container holds the agent, your code, and placeholder values for connected credentials and host-bound secrets. Agents on different threads never share a filesystem, a process namespace, or a credential store, so a runaway Codex thread cannot interfere with a Claude Code thread working on the same repository.
About ten minutes after the agent goes idle, the sandbox takes a workspace snapshot and sleeps. A sleeping sandbox costs nothing. A message, a CI event, a GitHub mention, or a scheduled trigger wakes it back up with the full workspace intact, no new thread needed.
How do agents on different harnesses delegate work to each other?
Delegation is built into the thread model. A parent thread, say a Codex thread fixing a token refresh race, can start child threads on any other harness or model, wait for their results, and continue with those results in its own context. Each child thread gets its own sandbox and its own history. There is no pipeline to configure.
In the example on Statefold's home page, a Codex thread asks Claude Code to plan the fix and OpenCode to review the diff, waits for both, then carries on with their findings. The parent thread shows the child threads as "Waiting on 2 child threads" with their individual status and elapsed time. When a child finds something, such as a hard-coded lock timeout, that finding flows back to the parent automatically.
How are API keys and subscription tokens kept safe when multiple agents are running?
Connected provider keys, subscription tokens and the GitHub token stay on Statefold's Worker side. Inside the container the agent sees placeholders for provider credentials and gets a placeholder from the GitHub credential helper.
As a request leaves the sandbox toward its destination, the Worker swaps the placeholder for the live credential, and only for the host that credential belongs to. A secret bound to api.openai.com is never sent to api.anthropic.com. Your GitHub token is added to requests for github.com as they leave, never stored in the container. MCP sign-ins for Linear, Sentry, Notion, and your own servers stay on Statefold's side entirely.
A secret you add without binding it to specific hosts is available as a plain environment variable. Processes in the sandbox can make authenticated requests through the Worker without reading the connected tokens.
What does a full asynchronous run look like from handoff to merged pull request?
In this example, you ask Statefold to fix a token refresh race and let you know when the PR is ready:
- Hand off from the terminal. Run
statefold thread new "fix the token refresh race". The CLI uploads your current checkout, uncommitted work included, without touching your local branch. - Sandbox boots. The container starts on the default machine (standard-3: 2 vCPU, 8 GiB, 16 GB disk). Codex starts on your subscription.
- Agents delegate. Codex asks Claude Code to plan the fix and OpenCode to review the diff. Each child runs in its own sandbox.
- Pull request opens. The thread subscribes to its CI checks and goes quiet.
- CI fails, the thread wakes. A failing test wakes the same thread with its full history. The agent pushes a fix.
- Checks pass. Once the thread finishes and the sandbox goes to sleep, machine billing stops.
- The thread notifies you. With push enabled, your phone can show the agent's update. You can review and merge from your phone.
The thread's status reflects its current work and linked pull request. Push and email notifications depend on your settings.
What does it cost to run several agents in parallel, and how does billing work across sandboxes?
Statefold bills for machine time only, per second, while a sandbox is running. Model tokens bill directly to your own subscriptions and API keys with no markup from Statefold.
| Machine | Size | Per hour |
|---|---|---|
| standard-1 | 0.5 vCPU, 4 GiB, 8 GB disk | $0.10 |
| standard-2 | 1 vCPU, 6 GiB, 12 GB disk | $0.20 |
| standard-3 (default) | 2 vCPU, 8 GiB, 16 GB disk | $0.30 |
| standard-4 | 4 vCPU, 12 GiB, 20 GB disk | $0.55 |
Threads start on standard-3 by default. You can move a thread to a larger machine when it needs more memory, and the new rate applies from that point. A sleeping thread costs nothing.
Linking GitHub adds a $3 starter credit, which covers about 10 hours on the default machine, with no card required. Monthly plans are available at $10, $50, or $100, each granting its price in credits for that month. Top-up credit from $10 never expires. When credits run out, the running turn gets up to 10 more minutes to finish, then the sandbox sleeps and the thread shows Limited.
Each sandbox accrues machine time independently while it runs, including the idle period before it sleeps. Running the same work in parallel can save elapsed time without changing the total machine time.
How does Statefold compare with other options for running coding agents in cloud sandboxes?
The table below covers the dimensions that matter most for multi-harness parallel work, based on information checked against each product's official site on November 19, 2026.
| Feature | Statefold | Amp | Terragon |
|---|---|---|---|
| Status | Running | Running | Shut down February 9, 2026 |
| Native harnesses | Codex, Claude Code, OpenCode, Pi, Gemini CLI | Amp's own agent; Claude Code agent on linked subscription | Claude Code, Codex, Amp, Gemini CLI |
| Bring your own subscription | Yes | Yes | Yes |
| Local checkout handoff (uncommitted work) | Yes, via CLI | amp sync mirrors orb changes to a local checkout | Yes, via terry CLI |
| Credential egress injection | Connected credentials and host-bound secrets are injected at egress | Secrets loaded into the orb | Not described |
| Cross-harness delegation | Yes, parent thread starts child threads on any harness | Not described | Not described |
| Compute pricing | $0.10 to $0.55/h, per second | From $0.08/h (1 vCPU) | N/A (shut down) |
| Starter credit | $3 when you link GitHub | Free tier with pay-as-you-go orbs | N/A |
| Self-hostable | No | Free self-hosted orbs on Hobby, Individual, Teams | Apache-2.0 snapshot, no maintenance guarantee |
| SOC 2 | Not yet | Yes (Type 2) | N/A |
Amp is a strong choice if you want a single well-integrated agent with desktop and mobile apps, free self-hosted orbs, SOC 2 Type 2, SSO, or multiplayer threads. Statefold fits better when you want the native Codex, OpenCode, Pi, or Gemini CLI harness, egress-injected credentials, or cross-harness delegation from a single thread.
How does Statefold connect to the agents you already use?
Statefold is not a replacement for the coding agents you already pay for. It gives Codex, Claude Code, OpenCode, Pi, and Gemini CLI a cloud machine, git access, a persistent thread, and the credential handling they need to work without you watching. Memory carries conventions and feedback across threads and across harnesses. Skills and MCP server sign-ins load automatically into every new thread. The result is that the agents you already know keep working on your tasks while you are away, and you come back to a pull request rather than a half-finished terminal session.
FAQ
Can I run Codex and Claude Code on the same task at the same time? Yes. A Codex thread can delegate to a Claude Code child thread, wait for its result, and continue. Each child runs in its own sandbox with its own history. You do not need to configure a pipeline; the delegation is part of the thread model.
Do I have to push my local branch before handing off a task? No. The Statefold CLI uploads your current checkout, including uncommitted work, without touching your local branch. The sandbox starts with that state already inside the container.
How do I know when an agent is done or needs me? Thread status is derived from what is running and linked: Working, Needs you, Ready to review, Done, or Limited. With notifications enabled, a thread can notify you when it goes idle while you are away or needs your input. To get a message when checks pass, ask the thread to subscribe to the checks and notify you.
What happens to my API keys and GitHub token inside the sandbox? Connected provider tokens and GitHub credentials stay on the Worker side. The agent sees placeholders. As each request leaves the container, Statefold's Worker swaps the placeholder for the real credential, only for the host that credential belongs to. Your GitHub token is added to requests for github.com as they leave, never stored in the container.
What if I want to use more than one AI model on the same project? Memory, skills, and MCP server sign-ins carry over between threads and between harnesses. A new thread on any harness can use your project's conventions and configured connections. You can also fork a thread from any finished turn or attach another thread as context.
Key Takeaways
- Statefold runs Codex, Claude Code, OpenCode, Pi, and Gemini CLI natively in per-thread isolated cloud sandboxes, each billed per second from $0.10 to $0.55 an hour.
- Connected provider keys, subscription tokens and the GitHub token are represented by placeholders in the container. The Worker injects their real values at egress.
- Cross-harness delegation lets a parent thread start child threads on any harness, wait for results, and continue, with no pipeline to build.
- Sleeping sandboxes cost nothing. Statefold bills each sandbox while it runs, including about ten minutes before it sleeps after going idle.
- Terragon, the closest prior alternative, shut down in February 2026; Statefold offers a hosted option for many of the same multi-harness use cases.
Next steps
If you want Codex, Claude Code, OpenCode, Pi, or Gemini CLI working on tasks while you are away, the path is straightforward: link GitHub to get $3 of starter credit (about 10 hours on the default machine, no card needed), connect your existing subscriptions and API keys, and hand off your first task from the terminal. Visit statefold.sh to get started. For pricing details and machine size options, see the pricing page. If you are coming from Terragon, the Terragon alternative page covers the switching steps. To see how Statefold compares with other cloud agent options, the compare page lists each alternative with notes on when it is the better choice.