load-lock: an open-source machine-wide semaphore that makes parallel coding agents take turns
erdar2 · reddit · 2026-10-30
Running 2-4 coding agents in parallel kept melting the author's machine — they all fire builds and test suites at once. So he built load-lock, a machine-wide counting semaphore daemon on a Unix socket: agents acquire a permit before heavy work, do light work while queued, and get a FIFO offer when a slot frees.
Key design points:
- One budget for the whole machine across sessions, harnesses and worktrees
- Process-lifecycle permits (pid + process group + /proc start time) so crashed agents free slots automatically; journaled state reconciles after restarts
- Honest sleeping: bounded blocking wait that wakes the moment it's their turn
- Sandbox bridging: agents in bubblewrap, Docker, macOS seatbelt or WSL2 share the host budget via a bridged socket
- Live dashboard, with an in-window panel for OpenCode
It beats renice/cgroups (throttle only), flock (stale locks) and orchestrators (need a single control point). Honest limitation: cooperative and advisory, nothing is enforced; default capacity is 1.
Install: npm install -g @aron98/load-lock; installers for OpenCode, Claude Code, Codex, Cursor, Gemini CLI and more, plus a generic MCP server. MIT licensed.
More from coding & agent
- Octoverse 2026: Over 40% of New Pull Requests Now Started by Agents, Pushes Hit Record 17.9B — 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
- CapCut GPT in ChatGPT turns a prompt into a finished short video with script and voiceover in 5 minutes — thisguyknowsai · 2026-10-30
- Agent harness engineering: lessons from 57 papers — same model, 6x performance gap — Marmelab · 2026-10-30