Skip to main content
mistakeknot

interlock

by mistakeknotv0.2.8

MCP server for intermute file reservation and agent coordination. 12 tools: reserve, release, conflict check, messaging, agent listing, negotiation, escalation. Companion plugin for Clavain.

Installation guide →
2 skillsMIT GitHub

Keywords

mcpfile-reservationagent-coordinationintermutemulti-agentconflict-prevention

Commands

join

Register this agent for multi-agent coordination — sets name, creates onboarding flag, shows active agents

leave

Leave multi-agent coordination — release all reservations, deregister, remove onboarding flag

setup

Setup intermute coordination service (delegates to /clavain setup scope)

status

Show multi-agent coordination status (delegates to /clavain status)

Documentation

# interlock

Multi-agent file coordination for Claude Code.

## What this does

When two agents try to edit the same file simultaneously, you get a mess. interlock prevents this by wrapping the intermute coordination service with an MCP server that provides file reservation, conflict detection, and inter-agent messaging.

The workflow: before editing a file, an agent reserves it. If another agent already holds the reservation, interlock offers a negotiated release protocol: the requesting agent sends a `negotiate_release` with urgency and optional blocking wait; the holding agent responds with either a release or a deferral with ETA. This is cooperative, not preemptive.

A git pre-commit hook provides mandatory enforcement: if you try to commit a file that's reserved by another agent, the commit is blocked. The PreToolUse:Edit hook is advisory (warns but doesn't block) so agents can still make emergency edits.

## Installation

First, add the [interagency marketplace](https://github.com/mistakeknot/interagency-marketplace) (one-time setup):

```bash
/plugin marketplace add mistakeknot/interagency-marketplace
```

Then install the plugin:

```bash
/plugin install interlock
```

Requires the intermute service running (the Go coordination backend).

## Usage

Join coordination:

```
/interlock:join
```

Check who's working on what:

```
/interlock:status
```

Leave and release all reservations:

```
/interlock:leave
```

## Architecture

```
bin/launch-mcp.sh        MCP server launcher (Go binary, mark3labs/mcp-go)
skills/                  coordination-protocol, conflict-recovery
commands/                join, leave, status, setup
hooks/                   PreToolUse (advisory), PostToolUse, git pre-commit
```

11 MCP tools cover the full reservation lifecycle. Connects to intermute via Unix socket (preferred) or TCP fallback.

## Design decisions

- Go binary for MCP server, bash for hooks
- Join-flag gating: all hooks check `~/.config/clavain/intermute-joined` before running
- `INTERLOCK_AUTO_RELEASE=1` enables advisory release-request notifications in the pre-edit hook