A self-hosted alternative to Cursor background agents

Cursor's Cloud Agents, formerly Background Agents, suit teams that live in the Cursor editor and want Cursor to run the VMs, open the pull requests and scale. Agenhood suits teams whose code and secrets must stay on their own server, and who want to pick the coding agent and the model per job.

Last updated

If you are looking for a Cursor background agents alternative, start with a name change: Cursor now calls them Cloud Agents. They work like the agent in your editor, but run in an isolated VM in Cursor's cloud, where they clone your repo, run tests and open a pull request. Agenhood is an open-source platform that runs coding agents in sandboxed containers on your own server. It runs the Claude Code, Codex and Opencode CLIs, so you pick the agent as well as the model.

The short answer

Pick Cursor if

  • You live in the Cursor editor and want to hand work to the cloud from there.
  • You want to start agents from Slack, Linear, GitHub or your phone with no servers to run.
  • You want merge-ready pull requests with screenshots and videos of the change.
  • You're fine with your code running on Cursor's cloud.

Pick Agenhood if

  • Code, secrets and agent history must stay on your own server.
  • You want to pick the agent (Claude Code, Codex, Opencode) and the model for each job.
  • You want agents that keep their workspace between tasks and run on schedules.
  • You want MIT-licensed code you can read and change.

Side by side

Topic Cursor Agenhood
Where it runs An isolated VM per agent in Cursor's AWS infrastructure. source One hardened Docker container per agent, on one VM you run. No Kubernetes.
Self-hosted option Self-Hosted Machines run checkout and tool calls on your hardware. The agent loop and inference stay in Cursor's cloud. source Self-hosted only. The agent loop, tools, files and task history all stay on your server.
Network Internet access by default. You can switch to an allowlist per user, team or environment. source No direct route out. A filtering egress proxy blocks private IP ranges and cloud metadata endpoints.
Agent and models Cursor's own agent with a curated set of models: Cursor's own, plus Claude, GPT and Gemini at API list price. source Five drivers chosen per agent, including Claude Code, Codex and Opencode. Anthropic and OpenAI models, plus Opencode's own plans.
Ways to start a task Editor, web, iOS app, Slack, Linear, an @cursor comment on GitHub or Bitbucket, and the API. source Console, REST API, schedules, workflows, a GitHub issue or PR comment, or a Slack message.
Schedules and events Automations: cron schedules, pull request, push and CI events, Slack, Linear and webhooks. source One-time or recurring schedules in your timezone, with a calendar. Workflows chain tasks across agents.
Persistence VM snapshots let an agent resume without recloning. Unused snapshots are deleted after 30 days. source A /workspace volume per agent that survives restarts, pauses and weeks of idle. Without a linked repo, it is snapshotted after every task.
Pull requests Built in. Agents open merge-ready PRs with artifacts, and the API has an autoCreatePR flag. source Not built in. An agent can push a branch and open a PR with its own git tools and credentials.
API REST API at api.cursor.com with runs, follow-ups, a run event stream and cancel. source REST API plus server-sent events for everything the console does. Named, revocable API keys.
Pricing model Paid plans only. Usage is charged at API pricing for the selected model. See their pricing page. source Free. You pay for your server and for model usage on your own keys.
License Hosted service that Cursor operates. source MIT. The full source is on GitHub.

Where your code and the agent loop run

By default, a Cursor Cloud Agent gets its own VM. Cursor's security page says your code runs inside Cursor's AWS infrastructure in isolated VMs, is stored on VM disks while the agent is accessible, and that the agent has internet access by default. You can restrict it to an allowlist, reach private services through Tailscale or a similar client, and store secrets that are redacted from the transcript. Conversation history is kept indefinitely by default, and environment snapshots are deleted after 30 days without use.

If code must not leave your network, Cursor offers Self-Hosted Machines: My Machines for one person's computer, and Team Pools for Enterprise fleets. The checkout and tool calls then run on hardware you manage, but the same page is clear that the agent loop and inference still run in Cursor's cloud.

In Agenhood, all of it runs on your server. The driver runs inside the agent's container, the tools run next to it, and task history, files and logs live in your own database and Docker volumes. Each container has a read-only root filesystem, dropped Linux capabilities and CPU and memory caps. It sits on an internal network with no gateway, and a filtering egress proxy is the only way out. Model calls to your model provider still carry your prompts and code, so the difference is where things run and where they are stored, not what the model provider sees.

Choosing the agent and the model

Cursor Cloud Agents run Cursor's own agent with a curated selection of models. That includes Cursor's own models and third-party models such as Claude, GPT and Gemini, billed at the model's API list price. If you like how Cursor's agent works, that is a strength: the same agent in the editor and in the cloud.

Agenhood picks a driver per agent, behind one API. The Claude Code driver runs the unmodified claude -p, and the Codex and Opencode drivers run those CLIs. Vanilla is Agenhood's own tool loop, and API makes a single model call per task. Anthropic and OpenAI keys are stored encrypted (AES-GCM) on your server and never sent to the browser. You can also sign in with your own Claude or ChatGPT plan, on your own server, but we recommend API keys for background work.

With make dev running and both keys added under Settings, Credentials, this creates a Claude Code agent and a Codex agent and gives one of them a task. Use the id from a create call as $AGENT_ID and the task_id from the task call as $TASK_ID.

Terminal
# A Claude Code agent and a Codex agent, side by side
curl -X POST http://localhost:5173/v1/containers \
  -H "Authorization: Bearer tk_live_seedkey" \
  -H "Content-Type: application/json" \
  -d '{"name": "reviewer", "config": {"driver": "claude-code", "model": "sonnet"}}'

curl -X POST http://localhost:5173/v1/containers \
  -H "Authorization: Bearer tk_live_seedkey" \
  -H "Content-Type: application/json" \
  -d '{"name": "test-fixer", "config": {"driver": "codex", "model": "gpt-5.5"}}'

# Both take tasks the same way
curl -X POST http://localhost:5173/v1/containers/$AGENT_ID/tasks \
  -H "Authorization: Bearer tk_live_seedkey" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Run the test suite, fix the failing tests and list every file you changed"}'

# Stream messages, tool calls and file changes as they happen
curl -N http://localhost:5173/v1/containers/$AGENT_ID/tasks/$TASK_ID/events \
  -H "Authorization: Bearer tk_live_seedkey"

Workspaces that stay, and work that runs on its own

A Cursor Cloud Agent starts from an environment you set up once, with a Dockerfile or a saved snapshot, and works on a separate branch that it pushes for handoff. You can send it follow-up runs through the API. Automations start cloud agents on a cron schedule or on events such as a pull request being opened, CI finishing, a Slack message or a webhook, and they can keep notes between runs in a memory file.

An Agenhood agent is long-lived. Link a repository and Agenhood generates an SSH deploy key, clones the branch into the agent's /workspace, and keeps it there across tasks, restarts and weeks of idle. Idle agents pause and wake on the next task. Schedules run a saved prompt or a whole workflow once or on a recurring cadence in your timezone. A comment on a GitHub issue or pull request can start a task too: the connector posts a reply and edits it in place as the agent works.

What Cursor does better

  • It is part of your editor. You hand off work from the same agent input you already use, and pick up the result there. Agenhood has no IDE plugin.
  • Pull requests come ready to merge. Agents open pull requests with screenshots, videos and logs, sign their commits, and let you take over the VM's desktop to try the change. Agenhood leaves pull requests to the agent's own tools.
  • More ways in. An iOS app, Linear, Bitbucket and a long list of source control events, from a label change to CI finishing. Agenhood's connectors only react to new GitHub issue or PR comments and Slack messages.
  • Nothing to run. Cursor manages VM provisioning, isolation, snapshots and capacity, and you can run as many agents as you want in parallel. With Agenhood, the server and its upkeep are yours.

Moving over, or using both

You don't have to give up Cursor. A common split is to keep Cursor in the editor and move the background jobs that touch sensitive code, or that should run on a schedule, to Agenhood. Each Cursor environment becomes an Agenhood agent with a linked repo. An @cursor comment becomes a GitHub routing rule, optionally with a keyword such as /fix. An automation on a cron schedule becomes an Agenhood schedule on that agent. When the agent pushes a branch, you pull it and review it in Cursor like any other.

Agenhood is self-hosted on one server. The self-hosted AI agents guide shows what that takes.

What it doesn't do

  • It doesn't open pull requests by itself. The agent can push a branch with its deploy key and open a pull request with its own tools and credentials, but there is no built-in step.
  • It is a hardened container, not a VM. Agents share the host's kernel. For a stronger boundary, give Agenhood its own VM and keep other workloads off it.
  • You run it. There is no hosted version, so updates, backups and capacity are on you. It is built for a trusted team, not as a public, multi-tenant service.

Questions people ask

Are Cursor background agents and Cloud Agents the same thing?

Yes. Cursor renamed Background Agents to Cloud Agents, and its docs now use the new name. They are agents that run in a VM in Cursor's cloud instead of on your laptop, and you can start them from the editor, the web, the iOS app, Slack, Linear, GitHub or the API.

Doesn't Cursor's Self-Hosted Machines option keep my code on my servers?

Partly. With My Machines or Team Pools, the checkout and the tool calls run on hardware you manage, but Cursor's docs say the agent loop and inference stay in Cursor's cloud. With Agenhood, the loop, the tools, the files and the task history all stay on your server. Each model call still goes to your model provider.

Does Agenhood open pull requests like Cursor does?

No. Agenhood has no built-in pull request step. An agent can push a branch with git and the deploy key you gave it, and open a pull request with its own tools and credentials if your prompt asks for it. The GitHub connector replies in issue and pull request comments.

Can I keep using the Cursor editor?

Yes. Agenhood doesn't replace your editor and has no IDE plugin. Agents work in their own containers and push to a branch, and you pull that branch and review it in Cursor or anywhere else.

Which models can Agenhood use?

Anthropic and OpenAI models, plus Opencode's own model plans through the Opencode driver. You pick a driver per agent: Claude Code, Codex, Opencode, Vanilla (Agenhood's own tool loop) or API. Cursor's own models are not available on Agenhood.

What does each one cost?

Cursor Cloud Agents need a paid plan and are charged at API pricing for the model you pick. Their pricing page has the current plans. Agenhood is free and MIT licensed: you pay for the server you run it on and for model usage on your own keys.

Run it locally in one command

You need Docker and Python 3.12 or newer. make dev builds the agent image, starts the stack, runs migrations, creates a login and prints the console URL.

Terminal
git clone https://github.com/appssemble/agenhood.git
cd agenhood
make dev

Sources

  1. Cloud Agents overview
  2. Choose where Cloud Agents run
  3. Cloud Agents secrets and network
  4. Automations
  5. Cloud Agents API
  6. GitHub integration
  7. Models and pricing
  8. Cursor pricing