Skip to main content
MCP server CX Codex

Agent Coherence — Stale Write Guard (FS) — Claude Code MCP Server

An MCP server that blocks stale writes to shared workspace files like plan.md. It stops concurrent agents from silently clobbering each other's progress.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add stale-write-guard-fs -- uvx agent-coherence
Open on GitHub

What Agent Coherence — Stale Write Guard (FS) does

When multiple agents edit the same plan.md or memory.json, silent overwrites happen. One worker reads a snapshot while another writes changes. The last write wins silently. This server blocks those updates and returns explicit conflict signals instead.

Under the hood, the server implements MESI-style artifact tracking and optimistic compare-and-swap via write_cas. Reads register the active version generation. If a teammate updates the file before your write arrives, the commit fails closed. Safety invariants are verified by nine formal TLA+ specifications.

Setup requires Python 3.11 or higher. The coordination logic runs on a single host only. It does not track external side effects like outgoing emails or webhooks.

What it helps with

  • prevent silent overwrites on shared plan.md files
  • reject outdated edits via optimistic commit-CAS
  • coordinate concurrent agent file access on a single host
  • guard against lost state updates in memory.json

Example prompts for the agent

  • Read plan.md through the stale write guard before updating tasks.
  • Commit these updates to memory.json using optimistic concurrency.

How to install Agent Coherence — Stale Write Guard (FS)

Platform CLI

claude mcp add stale-write-guard-fs -- uvx agent-coherence

uvx runs the command named after the package; if the README names another one, use uvx --from agent-coherence <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Agent Coherence — Stale Write Guard (FS)

How do I install Agent Coherence — Stale Write Guard (FS) in Claude Code?

Run claude mcp add stale-write-guard-fs -- uvx agent-coherence in your terminal.

What does the stale-write-guard-fs server do?

It tracks shared file versions on the local disk and denies stale write attempts if an agent worked on an outdated snapshot. This prevents silent clobbering across agent runs.

What are the runtime requirements for this server?

It requires Python 3.11 or newer. The uvx runner executes the agent-coherence package directly on your local machine.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor