Skip to content
UseAgent

Engineering · Architecture · Devin

An open source Devin alternative, and how it's built

UseAgent is an open source Devin alternative: Claude Code, Codex and OpenCode on their own cloud computers, self-hostable. The design, and where Devin leads.

Abhishek8 min read
On this page

We wanted to hand an agent a task, close the laptop and come back to a pull request. Devin does that with one agent of its own, and we were already running Claude Code and Codex all day on plans we paid for, so we built UseAgent: an open source Devin alternative that puts the agents you already use on a cloud computer each, with the control plane in a repo you can read and run.

This is the map: the four decisions everything else hangs off, then where Devin is still ahead.

Four engines, one thread, a computer per thread

The hosted app at app.useagent.org runs four engines. Claude Code, Codex and OpenCode each get a Linux sandbox per thread: cloned repos, a terminal, a browser, a desktop you can watch. Chat has no computer and answers from your knowledge base, wiki and team memory. You can switch engine between turns in the same thread and the conversation carries over.

Work comes in from the web app, Slack, the REST API or a schedule. All four go through the same run door, so a Slack mention and a button click produce the same kind of run with the same retries and limits. What comes back is a pull request, a document, a spreadsheet, a deck, a deployed page. GitHub, Slack and Gmail are among the things you can connect.

The core is AGPL-3.0 at github.com/useagenthq/useagent. It is alpha software and says so in the README.

Credentials stay outside the sandbox

The sandbox is where an agent runs whatever code it decides to run, including code a prompt injection talked it into. We treat it as a stranger's laptop. No provider key, OAuth token or database password goes in.

What goes in instead is a capability minted for one run. Claude Code thinks it is talking to Anthropic and Codex thinks it is talking to OpenAI. Both are talking to our provider gateway, which checks that the run is live, that the model is the one the run started with and that the request is inside its limits, then attaches the real credential on the way out. Knowledge, memory, skills, GitHub, web search and artifact publishing are typed tools the backend serves the same way. Anything destructive, like merging a PR or deleting an automation, stops on an approval card in the web app or Slack and resumes with a one-shot capability bound to the exact arguments you approved.

It costs us. Every engine has to be taught to talk to a gateway, and every engine fails in its own way when the gateway says no. Claude Code reads a 403 as "authentication failed" and retries ten times; that week is in How to run Claude Code in the cloud without patching it. I still think it's the only defensible shape when the agent executes arbitrary code with your GitHub org one hop away. The full split is in AI agent sandbox architecture.

Postgres holds the run, the UI reads the log

A run is an append-only sequence of events in Postgres: commands, steps, tool calls, approvals, outputs. The UI renders that log and never attaches to a live engine process. We tried the other way first, embedding each engine's own session UI, and threw it out in August.

What the log buys:

  • Reload mid-run and you see exactly where the agent is, not a reconstruction.
  • The backend can restart under a running agent. On boot, recovery re-probes live sessions and adopts work that finished while it was down instead of failing it.
  • A Codex turn and a Claude Code turn in the same thread render through one session grammar.

The browser holds one SSE stream per thread, not one per run, which fixed a reply flash we had chased through several releases (why one SSE stream per thread). The storage side is in event-sourced agent runs.

One backend per database, on purpose

We support exactly one backend process per database. Production runs a single replica, takes a Postgres advisory lock at boot, and a second backend refuses to start.

Two things are process-local and would need a shared bus to split: the step that seals a run's canonical events, and the SSE fan-out to browsers. The Codex relay that serves ChatGPT logins keeps its grants in process memory too. We found out what that means when an operator tool minted relay grants from its own process and every run it touched died waiting for a first event, because the backend that answered the sandbox had never seen those grants.

The worse lesson was in dev. Boot recovery reconciles every in-flight run in the database, not only the ones its own process started. So booting a second backend against a shared dev database, just to test a UI change, would reconcile and sometimes fail runs another process was driving. Tests use throwaway databases now and the rule is written into the repo's CLAUDE.md. Could we shard it? Yes, with a Postgres-backed bus. In our load test one backend carried 50 concurrent coding runs at about a quarter of one core, so it hasn't been the bottleneck.

Bring the plan you already pay for

This was the decision that made the product make sense to us.

Codex runs on your own ChatGPT plan. You sign in once under Settings, the login stays on the control plane, and Codex's shell and file tools reach the sandbox through a relay that only opens while your run is live. Any model your login lists is available. How that works without the login ever touching the sandbox is in running Codex in the cloud with your ChatGPT plan.

Claude Code is different. Anthropic allows a hosted product to run Claude Code on a user's own Claude plan if the binary is unmodified, the user signs in through Anthropic's own flow, and the product never collects, stores or relays the session token. Our sandboxes are short-lived and per thread, so doing that properly means signing in again per sandbox. We haven't shipped it. On the hosted app, Claude Code runs on an Anthropic API key you connect, or on our credit.

OpenCode takes OpenAI, Anthropic, OpenRouter or Cerebras keys. Keys are write-only in Settings and never enter the sandbox. New members get $20 of Claude Opus 5.5 credit for Claude Code and OpenCode, then GLM credits from us. The gateway that meters that credit per member is its own post: an LLM gateway with per-user credit.

Bots are threads with a name

A bot is a named preset over one durable home thread: a name, standing rules, an engine, a model, repos, a pinned skill. Message it today and again next week and it is the same thread. Its status (needs you, working, idle) is derived from its runs every time you look, never stored, so it can't drift from what actually happened. Type @bot/Nova in any thread and that part of the work goes to Nova in its own delegated thread; the asking thread gets a receipt saying it was created, sent, or refused and why.

Some bot products give all of a user's bots one persistent computer that keeps logins to your SaaS tools, and let you teach a task by recording your browser. We have neither. Each of our turns runs in a sandbox with credentials behind the gateway, which is easier to trust and slower to set up: you pick an engine and model, they don't ask. The missing persistent tool access is a real gap.

Where Devin is ahead

Plainly, in four places.

Speed. When we planned our latency work, the plan's name was literally "Devin-class speed". A warm Codex follow-up on UseAgent now reaches first text in about 5 seconds, down from 12.6. A brand new Codex thread still takes around 15 seconds to first text.

Polish. Several of our features were built with Devin as the reference: named org secrets injected into the sandbox at boot, picking several repos in the composer, importing skills from a repo. Devin's Slack conventions, like asides the bot ignores and mute per thread, are better thought through than ours were.

Maturity. Schemas still change between our releases. Pin a tag.

Hands-off with one bill. If you want one vendor, one invoice and no keys to manage, Devin is the simpler purchase. Our README puts it this way and I agree with it: UseAgent is not a new model, and not a proven replacement for every Devin workflow.

Where we are different is the list above: you pick the engine per turn, you can run all of it on your own servers, credentials never enter the sandbox, you bring your own plans and keys, approvals bind to arguments, and every step sits in your own Postgres. Sandboxes are plugins too: Daytona, Cube or Box behind one contract. The row-by-row version is on UseAgent vs Devin.

Self-hosting the open source Devin alternative

You need bun and Postgres 16+ with pgvector.

bash
git clone https://github.com/useagenthq/useagent.git && cd useagent

docker run -d --name useagent-pg -p 127.0.0.1:5432:5432 \
  -e POSTGRES_HOST_AUTH_METHOD=trust pgvector/pgvector:pg16
export DATABASE_URL=postgres://postgres@localhost:5432/postgres

# install each package (the README lists them), then:
bun run dev:backend    # API and orchestration on :3201
bun run dev:frontend   # UI on :3400, proxies /api/* to the backend

A real agent task also needs a sandbox provider key and a model key; the quickstart walks through both. For a server, infra/self-host/deploy-app.sh targets any Linux host over SSH. Daytona is the easiest sandbox to start with; CubeSandbox runs on your own hardware if the data can't leave. The longer version is in self-hosting an AI coding agent.

Read the code at github.com/useagenthq/useagent, or start a thread on the hosted app and hand it something you'd give Devin.

Frequently asked questions

Is there an open source alternative to Devin?

UseAgent is one. Its core is AGPL-3.0 on GitHub, runs on any Linux host with Postgres, and drives Claude Code, Codex and OpenCode in isolated sandboxes instead of a single built-in agent.

Can UseAgent use my ChatGPT or Claude subscription?

Codex can run on your own ChatGPT plan; the login stays on the control plane and never enters the sandbox. Claude Code on the hosted app runs on an Anthropic API key, or on the starting credit and then GLM credits from us, because signing in with a Claude plan inside hosted sandboxes is not offered yet.

Is UseAgent free?

Self-hosting the open source core is free. The hosted cloud is free during early access, model and sandbox spend bill to your own accounts, and new members start with $20 of Claude Opus 5.5 credit for Claude Code and OpenCode.

All posts →

Hand your next task
to a coding agent.

UseAgent runs Claude Code, Codex and OpenCode in cloud sandboxes. The core is open source, so you can read the code or host it yourself.