Self-hosted setup runs Claude Code agents in per-project VMs

Self-hosted setup runs Claude Code agents in per-project VMs

A post on kudmitry.com describes what its author calls a remote, agentic, fully self-hosted software development factory, and says it was vibe-coded. The main goal was to move work off a MacBook, which was getting warm from running many VMs and no longer holding its battery, onto an always-on home machine reachable by VPN from anywhere. Each project gets its own VM running agentic harnesses, currently framed around Claude Code with room to add others. The author wanted strong isolation, VMs that are easy to recreate, no manual setup, and every service self-hosted with no public dependencies or subscriptions. Existing agent control panels were rejected as most likely vibe-coded or VC-funded.

The core hardware is a refurbished Dell Optiplex Micro 7010 with a 13th Gen Intel Core i5-13500T and 32 GB of RAM, chosen in a Micro chassis for its size, quiet and low power use. It runs Proxmox. A Lenovo ThinkCentre Tiny the author already owned also runs Proxmox, so Proxmox Datacenter Manager manages both hosts and Pulse monitors them.

Supporting services sit in one VLAN (called srv) and development machines in another (dev), with narrow openings between them. By the author's account, the worst a compromised VM or agent can do is list other VMs in its own VLAN and perhaps reach the web version of what a dev machine is running. Technitium provides DNS and DHCP, giving each new dev machine a name of the form [host].dev.[domain].net. Because the router has no DHCP relay and DHCP broadcasts cannot cross VLANs, dnsmasq in a small LXC container does the relaying.

Forgejo hosts the code, and a self-hosted Forgejo runner sits in a third VLAN, cut off from the rest apart from a tiny opening to the Forgejo instance, because it runs code downloaded from the internet and package repositories. Deploys used to run through Forgejo Actions, which meant Forgejo secrets held SSH keys to production servers. Even with a protected main branch, an agent could have created a workflow that dumped those secrets and sent them out. Deploys moved to Semaphore UI, which holds the keys and runs only a custom deploy script, triggered by a webhook from a Forgejo run that finished in main. Agents cannot push to main and the author reviews everything that enters it. The author concedes they could still slip in poisoned code that gets built and deployed.

API keys sit behind Infisical's agent-vault, a proxy in its own LXC container in srv, so dev VMs never hold them. A custom control program, kamino, orchestrates cloud-init and Ansible to build each VM: it clones the chosen repositories, creates a Forgejo bot user with read and write access, loads the vault, and copies dotfiles in with chezmoi.

A second custom tool, tipoca, is essentially a Forgejo webhook listener with rules. An issue labelled status/ready gets picked up by Claude Code in a new tmux session and worktree, and stage/research, stage/plan and stage/implement labels steer the flow. Recurring jobs are markdown files with a schedule and allowed outputs, run through systemd timers. Because such jobs can take unvalidated input, they run as a different Linux user without sudo or Forgejo access.

Key facts

  • The core machine is a refurbished Dell Optiplex Micro 7010 (Core i5-13500T, 32 GB RAM) running Proxmox, with one VM per project.
  • Services, dev machines and the CI runner are separated by VLANs, with only narrow openings where a service has to be reached.
  • Deploys moved from Forgejo Actions to Semaphore UI so that an agent-written workflow cannot dump production SSH keys.
  • Infisical's agent-vault proxies API keys and other secrets, so dev VMs never hold them.
  • A custom harness, tipoca, starts Claude Code sessions from labelled Forgejo issues and scheduled markdown job files.

Why it matters

Letting coding agents work on their own raises a practical question: what can they reach if one misbehaves or gets hijacked? This write-up answers with concrete layers. VMs are disposable, networks are split, secrets stay behind a proxy and deploy keys live outside the CI system the agents can influence. The secrets example is the sharpest one. A protected main branch did not stop the risk that an agent could write a Forgejo workflow that leaks every stored secret.

Who it affects

Developers who run Claude Code or similar harnesses with some autonomy, especially those whose laptop is straining under local VMs. Self-hosters with a Proxmox box will recognise most of the parts. Teams that keep production keys in CI secrets while agents can create workflows have a specific scenario to check against their own setup.

How to use it

The pieces can be borrowed separately. Give each project a VM built from code (here a Proxmox template with cloud-init, then Ansible). Put dev machines in their own VLAN. Move deploy keys into a separate tool that accepts only a finished run from main, as the author does with Semaphore UI. Route API calls through a secrets proxy. For autonomy, the model is labelled issues for immediate tasks and markdown files under .agents/jobs/.md for recurring ones, each with a cron or OnCalendar pattern and limits such as at most one PR and three issues. The idea draws on GitHub Agentic Workflows. Sessions stay open in tmux, so the author can watch, take over, or steer through issue comments and labels. After a crash or reboot, claude --resume restores the session tied to the issue.

How solid is it

This is one person's first-hand description of a home setup they built for themselves. The author says part of the reason for writing was to understand what had been made, and hopes it inspires others to experiment. The statements about what a rogue agent can and cannot reach are the author's own assessment of the design. kamino and tipoca are the author's custom programs, shaped around a personal workflow.

Risks and caveats

The author admits agents can still insert poisoned code that ends up in a deployed artifact, so human review of main carries real weight. A compromised VM may still see its neighbours in the dev VLAN. Network separation added work, particularly around DNS and VLAN access rules. Standalone agent-vault is no longer the recommended way to use it, according to the author, who thinks the next step will be replacing it with a wrapper around mitmproxy. Scheduled jobs that search the web or read input such as Sentry issues are treated as riskier and get fewer privileges.

“The worst a compromised VM/Agent can do is list all other VMs in its own VLAN, and maybe access the dev web version of whatever the dev machine is running.”

— The author of the post, kudmitry.com