distroid self-hosted · source not yet public

Agent runs as C# code.
Each in its own VM.

A run is a C# script: the VMs, the agent sessions in them and what each is asked, in a fluent API. distroid boots the VMs on KVM, starts Claude Code inside and journals every prompt, tool call and model call, so a run can be repeated, branched from a snapshot and scored.

ports-zero.cs · abridged, the script of the run replayed here

var model = new ClaudeModelConfig { Model = "opus[1m]", Effort = Effort.XHigh,
    Tools = [ClaudeTool.Read, ClaudeTool.Glob, ClaudeTool.Grep] };
string[] readers = [.. arms.Keys.SelectMany(arm =>
    Enumerable.Range(1, 5).Select(n => $"{arm}-{n}"))];

var definition = RunDefinitionBuilder.Create()
    .WithEnvironment(e => e
        .WithVm(v => v.Kernel("7.2.15").Disk("arch", Bytes.GiB(8))
            .Cpus(4).Memory(Bytes.GiB(12)))
        .WithDirectory("climb", d => d.FromHost(corpus)))
    .WithSession(readers[0], s => s
        .WithModelConfig(model).WithWorkingDirectory("climb"));
foreach (var reader in readers[1..])
    definition = definition.WithSession(reader, s => s
        .WithModelConfig(model).WithWorkingDirectory("climb"));

await using var engine = await EngineClient.Connect();
var run = await engine.BeginArm(definition.Build());
await run.Armed();
await Task.WhenAll(readers.Select(r => run.Session(r).Ask(Prompt(r))));
await run.End();

dotnet run ports-zero.cs

01The run above: does a reading instruction change what an agent reads?

The panel at the top replays run b2e755b6 from the engine's journal, recorded 26 November 2026.

setup
one VM: 4 vCPUs, 12 GB, a 43-file corpus copied in 15 Claude Code sessions, Opus 5.5 at xhigh effort, tools limited to Read, Glob and Grep the same question to all: describe every port and adapter in six designs three conditions, five sessions each: no instruction, "read what your question needs", "read every file whole"
timeline
0.3 s VM booted; 5.0 s answers on vsock; 5.2 s corpus in place 6.7–15.1 s the sessions start; 15.1 s all 15 prompted at once 7:45–14:31 the sessions finish; the VM is removed at 14:32
result
files read, mean of five: 25.8 "read what you need", 39.2 no instruction, 43 "read every file" with no instruction, three of five read the whole corpus anyway 651 tool calls, 477 model calls, 1.0M output tokens, all in the journal

02Components

VM
a cloud-hypervisor microVM under KVM, sized in vCPUs and memory a custom Linux kernel with drivers built in, and a minimal init disk: a copy-on-write clone of a read-only image reached only by ssh over vsock several sessions can share one VM, as the 15 above do
run script
a C# file run with dotnet run declares VMs, the directories copied in, agent sessions and their model configs, and the links between them engine.BeginRuns(definition, epochs: 5) runs the same definition five times sent to the engine as data over gRPC; no script code runs in the engine
engine
one .NET daemon per host boots and stops VMs, copies repositories in, starts the sessions holds the credentials and grants a VM only what the run asks for
session
a Claude Code process inside a VM, driven over its stream-json protocol every message, tool call and tool result is returned to the script as an event
gateway
all model API traffic from a VM goes through it exchanges a per-session token for the host's Claude login, which never enters a VM sees every call, so usage and cost are attributable per session
journal
every event of a run in Postgres, in order: VM, session, model API, snapshot a run's replay, cost and tool use are queries on it; the panel at the top is one
snapshot
a run's state named at a point, for example when its sessions go idle later runs continue from it, so one history can branch into many

03Architecture

Host · one Linux machine run.cs dotnet run forgejo repositories engine boots and stops VMs, copies directories in links peers, takes snapshots journal Postgres every event, every run microVM cloud-hypervisor · KVM kernel 7.2.15-distr0id disk: a reflinked copy of the image sessions Claude Code over stream-json, one per name peers reached with SendMessage gateway a session's grant in, the host's login out model API Anthropic gRPC a commit events vsock: ssh, directories, peerlinks model calls every call

The script talks only to the engine. No VM holds a credential: the host fetches repositories and copies them in, and the gateway puts the host's Claude login on each model call. A VM has no network card unless its environment asks for one with .WithNet(). What a run did is read back from the journal.

04In use: issue to CI-verified change

eva, an autonomous development pipeline, runs on distroid. Each task gets its own VM.

  1. an issue is opened on a Forgejo repository and labelled ready
  2. a VM boots, the repository is cloned in, Claude Code starts with the issue as its brief
  3. the agent works, commits and pushes
  4. CI runs on the push; the issue is closed only when CI passes
  5. the VM is removed

~500development tasks

30+repositories

1VM per task

example
request: "I need a Cloud Hypervisor client" an issue was opened, a VM picked it up, the package was on the NuGet feed in under an hour 259 files, about 3,700 lines of C#, none written by hand tested against 73 HTTP responses recorded from a live cloud-hypervisor where the OpenAPI spec and the recorded responses disagree, the recording wins and the generated property documents the difference

05Evaluation example: documentation and architecture recovery

Every run starts from the same image and the same commit, so a task can be repeated and scored. The question here: how much documentation does an agent need to reconstruct a codebase's architecture?

subject
a 20,000-line .NET codebase structural answer keys extracted with Roslyn; 20 questions derived from the code
method
five Sonnet agents rebuild the system from a description alone output scored mechanically against the answer keys
result
100 % structural accuracy from a 44-line index of the system's names 83 % from the project's own 596 lines of documentation

example scenarios

Three scripts that use batches, snapshots, branches and peerlinks.

● a step of the scenario◆ a snapshot → a message or a call