Autocoding Agents
Spin up a fleet of AI agents that read tasks from your repo’s ROADMAP.md, implement them on
branches, run your tests, and open pull requests — autonomously, overnight if you want.
The agents run on redu.cloud VMs and drive Claude Code using your own Claude Max/Pro subscription (not a metered Claude API key — no per-token charges). You connect everything through the redu.cloud MCP server, so you set it up from inside Claude Code in a few minutes.
What you’ll need (prerequisites)
- A redu.cloud account . Every account already comes with a private network — the setup auto-discovers it, along with an Ubuntu image, a flavor, and a keypair. Nothing to create.
- Claude Code installed and logged into a Claude Max or Pro subscription (the agents authenticate with your subscription).
- A redu.cloud API key — created below (Step 1).
- A GitHub Personal Access Token (PAT) for the repo you want worked on — created below (Step 2).
Windows users: run the terminal commands in this guide (the
claude mcp add, the/statuscheck, and especially the authorize step) from WSL or Git Bash — they usecurlandbash. macOS and Linux work as-is.
Step 1 — Create a redu.cloud API key
Go to Menu → Account → API Keys and click Generate New API Key.
Copy the key immediately — it’s shown only once. It’s a 64-character string and is how Claude Code authenticates to the redu.cloud MCP server.
Step 2 — Create a GitHub PAT
The agents clone your repo, push branches, and open PRs, so the token needs repo write access.
Recommended — a fine-grained token (least privilege — scoped to just this repo): GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token.
- Repository access: select only the repo you want the agents to work on.
- Permissions: set each of these — and this is the part people miss:
| Permission | Set it to |
|---|---|
| Contents | Read and write |
| Pull requests | Read and write |
| Workflows | Read and write — only if your tasks edit files under .github/workflows/ |
⚠️ Make sure each one says “Read and write”, not “Read-only”. This is the #1 setup mistake: the dropdown often defaults to Read-only, and a read-only token will clone fine but then silently fail to push branches or open PRs.
Or — a classic token (quicker, but broader): Tokens (classic) → Generate new token → check repo (and workflow if tasks touch CI). This grants access to all your repositories, which is why the fine-grained token above is preferred.
Copy the token. Keep it somewhere safe (a password manager) — never commit it.
Tip: you’ll need both your API key and your PAT in the steps below. A convenient place to keep them is a
.envfile in your project — just make sure.envis in your.gitignorefirst, so you never commit your secrets. Never paste them into the repo, an issue, or a chat.
Step 3 — Connect the MCP server in Claude Code
Connect it via the terminal or a project config file — pick whichever matches how you use Claude Code.
Terminal (Claude Code CLI)
claude mcp add --transport http redu-cloud https://mcp.redu.cloud/mcp \
--header "x-api-key: YOUR_REDU_API_KEY"(If your version uses different flags, run claude mcp add --help.)
VS Code, Cursor, or another IDE
The Claude Code extensions read a small config file from your project — and in an IDE this is
the most reliable path (the bundled claude binary often isn’t on your PATH). Just three steps:
1. In the root folder of your project (the same folder your code lives in), create a new file named exactly .mcp.json.
2. Paste this into it, and replace YOUR_REDU_API_KEY with the key you copied in Step 1:
{
"mcpServers": {
"redu-cloud": {
"type": "http",
"url": "https://mcp.redu.cloud/mcp",
"headers": { "x-api-key": "YOUR_REDU_API_KEY" }
}
}
}3. Save the file, then add a line .mcp.json to your .gitignore — it now contains your key, so you don’t want to commit it.
That’s it — no terminal, no environment variables to set.
Want to keep the key out of the file (e.g. so you can commit
.mcp.jsonand share it with teammates)? Use"x-api-key": "${REDU_API_KEY}"instead, and setREDU_API_KEYas an environment variable — the placeholder expands when Claude Code loads.
Whichever method you used, reset your Claude session so the MCP loads (reopen Claude Code, or
run /mcp to reconnect). Confirm it’s connected by asking Claude “who am I on redu.cloud?” — it
should report your account.
Step 4 — Provision the fleet
In Claude Code, just ask:
“Set up autocoding agents for
owner/my-repowith 3 workers.”
Claude will run the setup_agent_fleet tool. Have your GitHub PAT ready — it’s needed to
provision. The tool will:
- create a controller VM + the requested number of worker VMs,
- give the controller a public HTTPS URL,
- seed a starter
ROADMAP.mdinto your repo if you don’t already have one, and - return a controller URL and a trigger token — save these.
Provisioning takes ~7 minutes. You can check progress with:
curl -fsS https://YOUR-CONTROLLER-URL/status # 200 with JSON = readyStep 5 — Authorize the fleet (one command)
The agents need your Claude subscription. The setup_agent_fleet output includes a ready-to-run
authorize command — paste it into your own terminal. It looks like this:
curl -fsSL -H "Authorization: Bearer YOUR_TRIGGER_TOKEN" \
https://mcp.redu.cloud/scripts/authorize.sh -o /tmp/redu-authorize.sh \
&& bash /tmp/redu-authorize.sh https://YOUR-CONTROLLER-URL YOUR_TRIGGER_TOKENIt finds your claude binary (even if it’s not on your PATH — VS Code/Cursor bundle it), runs
claude setup-token (you authorize once in your browser), and installs a long-lived token on
the controller. This uses your Claude subscription, not an API key, and doesn’t expire
overnight — so the fleet can run unattended.
Step 6 — Add tasks to ROADMAP.md
The agents only pick up tasks in this exact format — one per line:
- [ ] **Task title** — short description *(agent-ready)*All four parts are required: the leading - [ ] checkbox, the **bold title**, the —
description, and *(agent-ready)*. Markdown headings (##) and plain bullets are ignored.
Write good tasks. The agents excel at focused, single-PR, testable units — add an endpoint, write tests for a module, fix a specific bug, add a UI page. Avoid vague or huge tasks (“rewrite the dashboard”, “make it faster”) or anything needing design decisions or external credentials. Examples:
- [ ] **Add a GET endpoint for a single record by id** — returns the record, 404 if missing, with input validation *(agent-ready)*
- [ ] **Write tests for the auth layer** — cover valid, missing, and expired credentials *(agent-ready)*Commit and push your ROADMAP.md to the default branch.
Step 7 — Start the run
In Claude Code, ask “trigger the agent batch” (runs the trigger_agent_batch tool). The
controller assigns tasks to idle workers; each worker implements its task, runs your test suite,
and opens a pull request. PRs appear on GitHub within minutes and keep coming until the queue is
empty. Review and merge them like any other PR.
Troubleshooting
| Symptom | Fix |
|---|---|
trigger_agent_batch says “No agent-ready tasks” | Your tasks aren’t in the required format — they must be - [ ] checkbox lines containing *(agent-ready)*, not ## headings. |
| Controller URL returns 502 / 500 for a few minutes | It’s still booting. Wait and re-check /status until it returns 200. |
claude: command not found in the authorize step | The authorize script auto-detects it; if it can’t, run claude setup-token yourself from a terminal where claude works and paste the token when prompted. |
| Agents produce weak/failed PRs | Tighten the task scope and add clear acceptance criteria. Smaller, well-defined tasks land far more reliably. |
Costs & teardown
- The controller and workers are standard redu.cloud VMs and are billed like any instance. Delete them when you’re done (ask Claude to “tear down the fleet”, or delete the instances in the console) so they stop billing.
- The agents use your Claude subscription — there are no Claude API charges.