Cloud coding agents need a full Linux workspace with the repository, toolchain and tests; scoped, short-lived Git credentials; a strong model with a large context; and limits on steps and spend. Model tokens dominate cost: a 40-step task can read over a million input tokens, so prefix caching or a private GPU matters.
- Typical task
- 20–60 steps, 0.5–2 M input tokens
- Biggest cost
- Input tokens re-read every step
- Workspace
- Full Linux, repo, toolchain, test runner
- Git access
- Per-task token, one repository, expiring
- One-click coding model
- Qwen2.5 Coder 14B AWQ on 24 GB
- H100 for larger coding models
- $4.99/hr, billed by the minute
Coding agents are the most demanding agents most teams will run. They read whole files and long test logs, take dozens of steps, need a real development environment, and produce changes that go into production code. They are also the agents with the clearest payoff, which is why so many teams want them running in the background on their own repositories. This guide covers the infrastructure a cloud coding agent needs, how to control what it can touch, and what each task really costs.
What is a cloud coding agent?
A cloud coding agent is an autonomous agent that takes a software task (fix this bug, add this endpoint, update this dependency), works on it in a remote development environment by reading code, editing files and running tests, and returns the result, usually as a branch and a pull request. It runs without an engineer's laptop and often several at once.
Hosted examples include OpenAI's Codex, which runs tasks in cloud containers, and GitHub's Copilot coding agent, which works in GitHub Actions-powered environments and opens pull requests. Terminal agents such as Claude Code and Aider can run the same way on a remote machine. Open-source platforms such as OpenHands run agents in Docker-based sandboxes you host. They share one architecture, the subject of the rest of this page, and it is a specialised case of the general stack in the AI agent infrastructure guide.
What does a coding agent's environment need?
A coding agent needs what a new engineer needs on their first day, minus the credentials they shouldn't have yet.
| Need | Detail | Why it matters |
|---|---|---|
| Repository | A checkout at the right commit, on a fresh branch | The agent's whole world |
| Toolchain | Language runtimes, package manager, build tools, linters | So it can build and test, not just edit |
| Dependencies | Installed and cached | Installing per task is slow and flaky |
| Test runner | Fast, deterministic tests it can run | Tests are the agent's main source of truth |
| Search tools | ripgrep, a language server or code index | Cheaper than reading files into the context |
| Resources | Typically 2–8 vCPU, 4–16 GB RAM, 10–50 GB disk | Builds and test suites are CPU-heavy |
| Network | Package registries and Git host only | Blocks exfiltration and surprise downloads |
| GPU | Only if the code itself needs one | ML code, CUDA, model evaluation |
The test runner deserves emphasis. An agent with fast, reliable tests converges in fewer steps, and steps are what cost money. Investing in a test suite that runs in under a minute often cuts agent cost more than any model change.
Sandbox or persistent workspace?
For coding agents, use a persistent prepared workspace per repository, reset at the start of each task, and rebuilt from scratch on a schedule. Pure per-task sandboxes are cleaner but pay the full clone-install-build cost every time.
On a medium-sized repository where cloning, installing and building takes 8 minutes, 30 tasks a day spend 4 hours just on setup in a per-task design. A prepared workspace pays that once. The persistent vs ephemeral guide has the full trade-off.
Git worktrees let several tasks share one prepared workspace safely, each in its own directory and branch:
#!/usr/bin/env bash
# new-task.sh TASK_ID : create an isolated worktree for one agent task
set -euo pipefail
TASK_ID="$1"
cd /home/agent/repo
git fetch origin main
git worktree add -b "agent/${TASK_ID}" "/home/agent/tasks/${TASK_ID}" origin/main
echo "/home/agent/tasks/${TASK_ID}"# cleanup after the branch is pushed
git -C /home/agent/repo worktree remove --force "/home/agent/tasks/${TASK_ID}"Worktrees share the object store, so creating one is near-instant. Each language has its own story for sharing installed dependencies across worktrees (a shared package cache works for most); the rest of the build cache can sit outside the worktree directory.
Where the code is untrusted (open-source contributions, customer repositories) or tasks come from many tenants, run each task in a stronger boundary: a gVisor container or microVM built from an image with dependencies pre-installed. The agent sandbox guide compares the options, including hosted sandboxes from E2B, Daytona and Modal.
How do you control what a coding agent can do?
Treat a coding agent like a contractor with a guest badge: it can work on one repository, on its own branch, and everything it produces is reviewed before it ships.
- Short-lived, scoped Git credentials. A GitHub App installation token expires after an hour and can be limited to one repository and specific permissions. Issue one per task.
- Branch-only pushes. Protect
main; the agent pushesagent/<task-id>and opens a pull request. - No production secrets in the workspace. If tests need secrets, they belong in CI, which runs on the pull request, not in the agent's shell.
- Network allowlist. Package registries and the Git host. Nothing else unless the task needs it.
- Hard limits. Maximum steps, maximum tokens, maximum wall-clock time, and a timeout on every command (test suites hang).
- Human review. A person approves every merge. The agent's job is a good pull request, not a deployment.
Prompt injection is a real risk for coding agents: issue text, code comments, README files and dependency source can all contain instructions. The controls above are what make that survivable.
Which model should power a coding agent?
Use the strongest model your budget and data rules allow for planning and hard debugging, and consider a private open model for the high-volume routine work. Coding agents are where model quality differences show most, because errors compound over many steps.
Open models that handle coding-agent work well, with the GPU each needs:
| Model | Weights | Fits on | Price |
|---|---|---|---|
| Qwen2.5 Coder 14B AWQ | 14 × 0.55 ≈ 8 GB | RTX 4090 (24 GB) | $1.59/hr |
| Qwen3-Coder-30B-A3B-Instruct (FP8) | 30 × 1 ≈ 30 GB | H100 (80 GB) with room for long contexts | $4.99/hr |
| gpt-oss 120B | Fits one 80 GB GPU (published) | H100 (80 GB) or RTX PRO 6000 (96 GB) | $4.99/hr |
| Qwen3 235B-A22B FP8 | 235 × 1 ≈ 235 GB | B300 (288 GB) | $18.09/hr |
Context length matters as much as parameters: coding agents routinely carry 30,000–100,000 tokens. Budget VRAM for the KV cache, not just the weights, and prefer models with an efficient attention layout. See the Qwen model cards on Hugging Face for each model's context limits and tool-call format.
Pointing an existing coding agent at a private endpoint is usually configuration, not code. For example, Aider accepts any OpenAI-compatible API (Aider docs):
export OPENAI_API_BASE="https://your-endpoint/v1"
export OPENAI_API_KEY="your-key"
aider --model openai/Qwen/Qwen3-Coder-30B-A3B-InstructUse the model ID your endpoint's /v1/models route reports.
What does a coding agent task cost?
Model tokens dominate. A coding agent re-reads its whole context on every step, and coding contexts are large, so input tokens add up quickly. Here is a worked example with stated assumptions.
Task profile (assumption): 40 steps; context grows from 15,000 to 60,000 tokens, averaging 35,000; 500 output tokens per step.
| Quantity | Formula | Result |
|---|---|---|
| Input tokens | 40 × 35,000 | 1,400,000 |
| Output tokens | 40 × 500 | 20,000 |
| Hosted frontier API, no caching | 1.4 M × $3 + 0.02 M × $15 | $4.20 + $0.30 = $4.50 |
| Same, 85% of input served from cache at 10% of the price | 1.4 M × (0.15 × $3 + 0.85 × $0.30) + $0.30 | ≈ $0.99 + $0.30 = $1.29 |
The $3 and $15 per million tokens are an illustrative frontier-tier price, not a quote; check your provider's page. Caching rules and discounts vary by provider, and the cache only helps if the prompt prefix stays stable, which is a reason to append to the history rather than rewriting it.
On your own GPU, with Qwen3-Coder-30B-A3B (about 3B active parameters per token) on an H100 and vLLM prefix caching, the GPU mostly processes fresh tokens:
| Quantity | Assumption (estimate) | GPU-seconds per task |
|---|---|---|
| Fresh prefill | ~100,000 tokens (final context plus cache misses) at 5,000–10,000 tokens/s | 10–20 s |
| Decode share | 20,000 tokens at 1,000–2,000 tokens/s aggregate across concurrent tasks | 10–20 s |
| Total model time | ≈ 20–40 s | |
| GPU time per 100 tasks | 100 × 20–40 s ÷ 3,600 | ≈ 0.56–1.1 GPU-hours at $4.99/hr = $2.77–$5.54 |
The throughput figures are estimates for a mixture-of-experts model on an H100, not measurements; prompts, concurrency and vLLM version move them substantially. The comparison holds only while the GPU is busy: one H100 left running all day costs 24 × $4.99/hr ≈ $119.76 whether it serves 50 tasks or 2,000. The H100 cost per million tokens guide covers the utilisation maths.
The workspace adds less than you might expect. A 4 vCPU, 8 GB environment for a 20-minute task is 1.33 vCPU-hours, typically cents on a CPU cloud. Test suites that run for many minutes, or GPU workspaces for ML code, change that.
How do you know a coding agent is worth what it costs?
Measure cost per merged pull request, not cost per task. A task that produces a pull request nobody merges cost money and reviewer time for nothing. Track, per task type: tasks started, pull requests opened, pull requests merged without major rework, tokens and GPU time per merged pull request, and reviewer minutes per pull request.
Those numbers usually show that agents are excellent at a few task types (test coverage, dependency bumps, lint fixes, small well-specified bugs) and poor at others. Route the good types to agents, and keep the rest with people. The step logs from the tutorial on running agents in the cloud give you the token side of the sum; your Git host gives you the merge side.
When does a coding agent need a GPU workspace?
A coding agent needs a GPU in its own workspace when the code it is writing needs one to run: training loops, data pipelines on GPU, CUDA or Triton kernels, inference servers, model evaluations. Without a GPU there, the agent can write such code but can't test it, and untested agent code is where most bad pull requests come from.
That is the case for a whole machine. A Root machine on Wandering Giants Compute gives the agent SSH, Ubuntu, CUDA, PyTorch and a persistent disk for the repository, dependencies and model weights; pause it between sessions and it costs about 3¢ an hour per 50 GB of disk. The guide on why agents need their own computers covers how to set such a machine up so it is safe to lose.
When does Wandering Giants fit a coding agent setup?
It fits two places. An API GPU gives your coding agents a private model, such as Qwen2.5 Coder 14B on an RTX 4090 or gpt-oss 120B on an H100, behind an OpenAI-compatible endpoint, so your source code goes to your own machine rather than a shared AI API. A Root machine gives an agent working on ML or GPU code a real GPU workspace. Wandering Giants also builds agent systems for businesses, coding agents included. We don't offer sandbox fleets or autoscaling; pair us with a sandbox provider or your own container hosts for per-task isolation. See GPUs and prices.
Frequently asked questions
What infrastructure does a coding agent need?
A Linux environment with the repository checked out, its dependencies installed and its tests runnable; a model with good tool calling and a long context; a way to return work (a branch and pull request); and controls: scoped Git credentials, network rules, step and cost limits, and logs.
How much does a coding agent task cost?
Mostly model tokens. A 40-step task averaging 35,000 tokens of context reads about 1.4 million input tokens. On a frontier API that is a few dollars before caching discounts and around a dollar with heavy caching; on a busy private GPU it is tens of GPU-seconds. Sandbox compute is usually cents.
Can open models run coding agents?
Yes, for well-scoped tasks: tests, small features, refactors, dependency updates and bug fixes with a clear reproduction. Open coding models such as Qwen2.5 Coder and Qwen3-Coder, and general models such as gpt-oss 120B, do this well. The strongest closed models are still ahead on long, ambiguous, multi-file work.
Should each coding task get a fresh environment?
Fresh is safest, but cloning and installing a large repository can take many minutes. Most teams keep a persistent, prepared workspace per repository, reset the working tree at the start of each task, and rebuild the workspace from scratch on a schedule.
Is it safe to give a coding agent Git push access?
Give it push access to a branch, never to main, using a short-lived token scoped to one repository. Require human review on the pull request, and let CI rather than the agent run anything that touches production secrets.
Do coding agents need a GPU in their workspace?
Only when the code they work on needs one: training scripts, CUDA code, model evaluation or GPU-accelerated tests. For ordinary web and backend code, the workspace is CPU-only and the model runs elsewhere.
Rent the GPU for this, by the minute.
Run a private coding model for your team's agents: launch an H100 with an OpenAI-compatible endpoint, or a Root machine your agent can build and test on.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is AI Agent Infrastructure? A Complete Guide
- GuideWhy AI Agents Need Their Own Computers and Execution Environments
- GuidePersistent vs Ephemeral Environments for AI Agents
- GuideWhat Is a Sandbox Environment for AI Agents?
- Cost breakdownH100 Cost Per Hour vs Cost Per Million Tokens
- TutorialHow to Run Autonomous AI Agents on Cloud Infrastructure
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.