Self-hosted coding agents that work in the background
Run Claude Code, Codex or Opencode on your own server and let them work while you do something else. Hand off a task from the console, the API, a schedule or a GitHub comment, and check the result when it is done.
Why run coding agents on your own server?
On your laptop, a coding agent ties up your machine, does one task at a time and runs with your SSH keys and full network access. Hosted coding agents fix that, but your code goes to someone else's cloud.
Agenhood gives you the middle path. Coding agents run on a server you own, each in its own sandbox, with your repo kept between tasks. You hand off the work and check the result when it's done. The Claude Code sandbox page explains how each agent is locked down.
Run Claude Code, Codex or Opencode in the background
Pick the coding agent you already use. Agenhood runs the real Claude Code, Codex and Opencode CLIs, and all three work the same way, so a Claude Code reviewer and a Codex test fixer can sit side by side. Use your own API keys or sign in with your own plan.
Hand off tasks from wherever you work
- The web console. Type a task and watch it run.
- The API. Start tasks from scripts or your own tools.
- A schedule. Run a task every night or every Monday. See scheduled AI agents.
- GitHub. Comment on an issue or pull request, for example
/fix the date parser fails on leap years. The agent replies in the same thread with live progress and the result. Reply again to keep the conversation going. - Slack. Send the agent a message.
Your repo stays with the agent
Link a repository and the agent gets its own deploy key and a clone of your branch. The clone stays in place between tasks, so the agent never starts from scratch. Give the key write access and the agent can push its work.
Watch, stop and undo
Follow every message, command and file change live, and stop a task if it heads the wrong way. If a run goes wrong, roll back: your repo's Git history works as the undo button.
Run many self-hosted coding agents at once
Each agent has its own container and workspace, so agents on different repos or branches don't get in each other's way. Agents start in under 5 seconds, and idle ones pause until the next task, so agents waiting for work don't hold memory.
Example: self-hosted Codex in two calls
# Create a Codex agent
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"}}'
# Give it a coding task
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"}'
Swap "codex" for "claude-code" to run Claude Code instead. See the
self-hosted AI agent platform page for everything else Agenhood
does.
What it doesn't do
- No built-in pull request step. An agent can push a branch and open a pull request with its own tools if you ask it to.
- The model runs at your provider. Your repo stays on your server, but prompts and the code the agent reads go to the model's API.
- No IDE plugin. You hand off work from the console, the API, schedules, GitHub or Slack.
- GitHub takes some setup. You install a GitHub App and give Agenhood a public URL.
Questions people ask
What is a self-hosted coding agent?
A coding agent such as Claude Code, Codex or Opencode that runs on your own server instead of a vendor's cloud. It works on tasks without you watching and keeps a copy of your repo between tasks.
Can I run Claude Code in the background on my own server?
Yes. Create a Claude Code agent in Agenhood, give it a task and close your laptop. The task keeps running on the server and you check the result later.
Can I self-host Codex?
You can run the Codex CLI on your own server with Agenhood and your own OpenAI key. Your repo stays on your server. The model itself still runs at OpenAI.
How does an agent get my code?
Link a repository and Agenhood creates a deploy key for the agent. Add the key to your repo and the agent clones your branch, which it keeps between tasks.
Does Agenhood open pull requests for me?
Not on its own. An agent can push a branch and open a pull request with its own tools if your task asks for it.
How many coding agents can run at once?
Up to 30 per team by default, as far as your server allows. Idle agents pause on their own, so they only use resources while they work.