# Agent Coherence — Stale Write Guard (FS)

> Agent Coherence — Stale Write Guard (FS) is an open-source MCP server for developer tools. Block stale writes when agents share files, plans or stores on one host. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://agent-coherence.dev
- **Repository:** https://github.com/cohexa-ai/agent-coherence
- **MCP Registry name:** io.github.cohexa-ai/stale-write-guard-fs
- **Categories:** developer tools
- **Listing updated:** 2026-11-14

## About

When two agents share a file, one can read version 1, another commits version 2, and the first then overwrites it with no error. This server denies that write, makes the writer re-read, and hands the loser a typed conflict to retry. It works for shared files through CoherentVolume and for store keys through write_cas.

The stdio server comes from the agent-coherence PyPI package and exposes eleven tools: guarded reads and writes, an effect gate, a targeted handoff and a way to give a file back. The same protocol has a LangGraph store, CrewAI and AutoGen adapters, and a Claude Code plugin that protects files such as plan.md.

It covers a single host only and needs Python 3.11 or later.

## Features

- **Stale write denial:** Rejects writes based on an outdated read.
- **Typed conflicts:** Gives the loser a conflict to retry.
- **Guarded file access:** Guarded reads and writes on shared files.
- **Effect gate:** Gates actions behind coherence checks.
- **Targeted handoff:** Hands a file to a specific agent.
- **Framework adapters:** LangGraph, CrewAI and AutoGen.

## Good for

- Keep parallel Claude sessions from clobbering plan.md
- Protect shared state in a multi-agent flow
- Detect lost updates in a LangGraph store
- Add safe handoffs between agents

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "stale-write-guard-fs": {
      "command": "uvx",
      "args": [
        "agent-coherence"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "stale-write-guard-fs": {
      "command": "uvx",
      "args": [
        "agent-coherence"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "stale-write-guard-fs": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "agent-coherence"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "stale-write-guard-fs": {
      "command": "uvx",
      "args": [
        "agent-coherence"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "stale-write-guard-fs": {
      "command": "uvx",
      "args": [
        "agent-coherence"
      ]
    }
  }
}
```

## FAQ

### Does it work across machines?

No, it covers a single host.

### What Python version?

3.11 or later.

### Which frameworks?

LangGraph, CrewAI and AutoGen, or custom orchestrators.

### Is Agent Coherence — Stale Write Guard (FS) free?

Yes. Agent Coherence — Stale Write Guard (FS) is open source, so you can use and self-host it for free.

### How do I add Agent Coherence — Stale Write Guard (FS) to Claude Code?

Run this command in your terminal: claude mcp add stale-write-guard-fs -- uvx agent-coherence

### What are the best alternatives to Agent Coherence — Stale Write Guard (FS)?

The closest alternatives to Agent Coherence — Stale Write Guard (FS) are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/agent-coherence-stale-write-guard-fs-2
