Running a self-hosted coding agent factory on a single spare Linux box with git worktrees
Seeing the Self-hosted software development factory thread on HN today reminded me how simple our own setup is.
People assume running parallel background coding agents requires Kubernetes, DinD containers, and cloud VMs. For a small team, a single spare 64GB RAM Linux box with git worktree and systemd-run gets you 95% of the way there in ten minutes.
Why worktrees beat cloning 4 times
Cloning a monorepo four times duplicates .git objects and slows down disk I/O. With git worktree, all four agents share one object store while working on completely separate branches and directories:
bash# Spin up an isolated branch directory for agent task #42 git worktree add -b agent/task-42 /tmp/worktrees/task-42 main # Run the agent + test suite inside a memory/CPU-capped transient systemd unit systemd-run --user --scope -p MemoryMax=6G -p CPUQuota=200% \ python run_agent.py --cwd /tmp/worktrees/task-42
When the run finishes (or crashes), you push the branch if tests pass and run git worktree remove /tmp/worktrees/task-42. No orphaned container images, no cloud egress bill, and everything stays inside your tailnet.