What is load-lock?
load-lock coordinates heavy work across coding agents that run at the same time on one machine, including agents in separate sessions, repositories, worktrees, or harnesses. It provides a shared permit system for jobs such as builds and test suites, so agents can wait for capacity instead of competing for machine resources. Developers can connect agents through supported harness integrations, an MCP server, or the command-line interface.
load-lock Features:
Shared Capacity Pool: Agents use one machine-wide permit pool across repositories, worktrees, and supported harnesses, with a default capacity of one and runtime-configurable limits.
Atomic Queueing: A single daemon event loop handles permit checks and queue registration together, preventing a release from being missed between those steps.
FIFO Offers: Queued agents receive offers in first-in, first-out order, with claim tokens that reserve capacity until claimed or expired.
Process-Aware Cleanup: Permits can track real processes and process groups, keeping a permit held while background work continues and releasing it after confirmed process death.
Crash Recovery: The daemon reconciles saved permit records with process liveness after a restart, and tracked permits are released when an agent process has died.
Harness Integrations: OpenCode, Claude Code, and Codex CLI have integrations, while other MCP-capable harnesses and plain shells can use the MCP server or CLI.
Machine Inspection: The inspection command reports cgroup or container CPU and memory limits alongside current resource pressure.
load-lock Benefits:
Less Resource Conflict: Teams can reduce builds and test suites competing for CPU and cache resources when several agents share a machine.
Useful Waiting Time: Agents can continue light work while queued, rather than having to stop all activity until a heavy job can run.
More Predictable Turns: FIFO offers make the order of queued heavy jobs visible and reduce uncertainty about which agent gets capacity next.
Fewer Stale Holds: Process tracking and restart recovery help avoid permits remaining occupied after tracked work or its agent has ended.
Capacity Based on Limits: Resource inspection helps teams set capacity with container and cgroup limits in view instead of assuming the host's core count is available.
Use Cases:
Parallel Test Suites: Coordinate test runs from multiple coding agents working in separate repositories or worktrees on the same machine.
Shared Build Host: Have agents request a permit before running CPU-heavy builds on a development machine used by several sessions.
Mixed Harness Teams: Share a single heavy-work budget when one developer's agents use OpenCode, Codex CLI, or Claude Code.
Sandboxed Agents: Connect agents running in environments such as Docker or bubblewrap to the host's shared permit pool.
Command-Line Jobs: Wrap a shell command such as a build with the CLI so it acquires a permit before execution and releases it afterward.

