TL;DR: faf_sync keeps your hand-written files, writes the context files it names, and tells you what it couldn't write.

In Plain English

Old state. grok-faf-mcp had its own copy of the code that writes faf's block into your context files. In a few cases it replaced a whole hand-written file with the block, then replied that your content was preserved.

Fix. It now writes through faf-cli's own writer, the one faf-cli, faf-mcp and claude-faf-mcp already use. faf replaces only the block it wrote, between its own marker lines. Everything else in the file is yours.

New state. Run faf_sync any time. Your rules stay. A file faf can't safely write is left exactly as it was, and the reply names it and says why.

What happened since The Instructions Edition

One blog, one arc. Last write-up was The Instructions Edition (v2.2.0). Short tour to today:

  • 2.2.1 — one rule for project questions: read project.faf first.
  • 2.2.2 — cleanup: removes leftover two-way sync wording.
  • 2.2.3 — faf_write can no longer overwrite the birth certificate or your context files.
  • 2.2.4 — faf_sync keeps your hand-written files. This post.

Why it matters if you use Grok or Cursor

Your CLAUDE.md, .cursorrules and .windsurfrules are where your team writes down how the project works: never deploy on Friday, which tests to run, what not to touch. A context tool that can wipe those is worse than no context tool at all.

  • Safe to run. Point your agent at faf_sync without checking your rules first.
  • No surprises. If a file can't be written (not UTF-8, a link out of the project), you're told which one and why. The others still sync.
  • Quiet git diffs. A repeat sync leaves the file byte-for-byte the same, so your history only shows real changes.

What 2.2.4 is

faf writes its block between two marker lines, <!-- faf:start --> and <!-- faf:end -->. The rule is simple: faf replaces only text it can prove it wrote. If the file has a matching pair of marker lines, only what's between them is updated. If it doesn't, faf puts its block on top and keeps everything else.

That rule already lived in faf-cli. grok-faf-mcp now calls faf-cli's writer instead of keeping its own copy, so every FAF tool that writes your context files behaves the same way.

When your file…BeforeNow
starts with a line that looks like faf'sthe whole file was replacedblock on top, every line kept, and the reply says why
has a start marker but no end markereverything after it was cutnothing cut
mentions the markers in its textthe wrong part could be replacedonly whole marker lines count
isn't UTF-8, or links out of the projectrewritten or written throughleft exactly as it was, named in the reply
is one of several, and one is refusedthe sync stopped part waythe others sync; the reply lists both

And faf_sync now writes the context files it names: the ones that exist (CLAUDE.md, .cursorrules, .windsurfrules, .clinerules), or CLAUDE.md when there are none. Before 2.2.4 it wrote none of them. One change to know about: in a project with no context files, faf_sync now creates CLAUDE.md.

How we got it right

  • An audit of the five FAF MCP servers found the problem, with exact reproductions.
  • We fixed it once, as a master, and turned the audit's reproductions into 7 tests. All 7 fail on 2.2.3 and pass on 2.2.4.
  • Two independent reviews followed. Each found things to tidy (what the reply says, which files faf_sync really writes). All fixed before release.
  • After publishing, we installed 2.2.4 from npm on a clean machine and ran the same cases through a real MCP client: 0 findings.

Full suite on the release: 672 tests pass, 0 fail.

Not claimed

  • The hosted endpoint (mcpaas.live/grok) serves the scoring tools and writes no files. This fix is in the local package, the one that writes your files.
  • .cursorrules, .windsurfrules and .clinerules keep the HTML-style markers they already have.
  • faf_sync doesn't write AGENTS.md or GEMINI.md.

Try it

Cursor (.cursor/mcp.json), or any IDE that runs a local MCP server:

{ "mcpServers": { "grok-faf-mcp": { "command": "npx", "args": ["--yes", "grok-faf-mcp"] } } }

Claude Code:

claude mcp add grok-faf-mcp -- npx --yes grok-faf-mcp@2.2.4

Grok, for scoring on a URL (~/.grok/config.toml):

[mcp_servers.grok-faf-mcp] url = "https://mcpaas.live/grok/mcp/v1"

Then ask your agent to run faf_sync. Homebrew has it too: brew install Wolfe-Jam/faf/grok-faf-mcp.

Technical details

  • Version: grok-faf-mcp 2.2.4 (November 5, 2026), The Instructions Edition
  • Where: npm · Homebrew · the MCP Registry
  • Writer: faf-cli's own (faf-cli ^8.5.0)
  • Changes: #186 · #187 · #188 · release notes