load-lock: a machine-wide semaphore that stops parallel AI agents from melting your machine
erdar2 · reddit · 2026-10-30
Running 2-4 coding agents in parallel means they all kick off builds and tests simultaneously, crushing the machine. The author built load-lock, a daemon implementing a machine-wide counting semaphore over a Unix socket (named pipe on Windows):
- Agents acquire a permit before heavy work, keep doing light work while queued, get FIFO offers when slots free up
- Permits bind to real process lifecycles (pid + process group + /proc start time) so crashed agents release automatically
- Journaled state enables clean restart reconciliation
- Sandboxed agents (Docker, bubblewrap, macOS seatbelt, WSL2) share the host budget via a bridged socket
- Installers for OpenCode, Claude Code, Codex, Cursor, Gemini CLI, Cline and more, plus a generic MCP server
Honest limitation: cooperative only, nothing enforced. MIT licensed, one npm install away.
More from coding & agent
- dhh: 'Review every line' is AI psychosis — the future is verifying outcomes, not code — CtrlAltDwayne · 2026-10-30
- Do you need an AI QA agent writing Playwright tests when AI already reviews PRs? — Infinite-Fly-2756 · 2026-10-30
- Octoverse: Claude Code tops fastest-growing repos; helium lands at #9 — uwukko · 2026-10-30
- Agentic MRI review takes 9th place out of 6299 teams in Kaggle RSNA knee abnormality detection — kagglingdieter · 2026-10-30
- Open-source Row-Bot demo: autonomous multi-turn agent finishes shop launch in 3 turns — Acceptable-Object390 · 2026-10-30
- Model choice is the least important decision in an AI project — alex_verem · 2026-10-30