# CLAUDE.md vs. AGENTS.md vs. .cursorrules: Multi-Harness Sync Guide

Updated: 2026-11-30 · Pillar: AI Coding Harnesses & IDE Setup · Target Query: claude.md vs agents.md · Canonical: https://memoreal.kolivri.com/articles/claude-md-vs-agents-md-vs-cursorrules

## Direct Answer (TL;DR)

Modern AI engineering teams frequently use multiple coding harnesses: Claude Code reads CLAUDE.md, OpenAI Codex CLI and OpenCode read AGENTS.md, while Cursor utilizes .cursorrules and modern .mdc rules. Without active synchronization, rules rapidly diverge across environments, leading to conflicting lint standards and test commands. Memoreal MCP provides a unified rule audit CLI and cognitive memory layer that synchronizes architectural constraints across all harnesses from a single source of truth.

## Key Benchmarks & Metrics

- **4 Harnesses** — Standard development harnesses supported (Claude, Codex, OpenCode, Cursor) (2026 Developer Tooling Survey)
- **1 Command** — CLI audit command (npx @kolivri/memoreal-mcp audit) to detect rule conflicts (Memoreal CLI Documentation)
- **73%** — Reduction in conflicting instruction errors across multi-tool engineering teams (Enterprise Monorepo Case Studies)

## Instruction File Standards Across AI Coding Environments

| Harness / Standard | Primary Rule File | Inheritance & Subdirectory Support | Dynamic Cross-Session State | Best Use Case |
| --- | --- | --- | --- | --- |
| Claude Code | CLAUDE.md | Hierarchical folder discovery | Static only (unless MCP attached) | Claude Code CLI sessions and terminal workflows |
| OpenAI Codex CLI & OpenCode | AGENTS.md | Project root and workspace scopes | Static markdown files | Autonomous subagent and workstream orchestration |
| Cursor IDE (Legacy) | .cursorrules | Root folder only (deprecated in favor of .mdc) | Static prompt prefix | Simple single-directory editor configurations |
| Memoreal Unified MCP | Unified cognitive graph | Polyglot workspace namespaces | Dynamic persistent graph with audit command | Synchronizing rules seamlessly across all harnesses |

## The Instruction File Landscape: CLAUDE.md, AGENTS.md, and Cursor Rules

As AI developer tooling has exploded, each major vendor created its own proprietary instruction file format. Anthropic built Claude Code around CLAUDE.md, placing heavy emphasis on project commands, code style, and compact summaries.

Simultaneously, autonomous frameworks like OpenAI Codex CLI and OpenCode standardized on AGENTS.md to define subagent roles, verification commands, and workstream boundaries. Meanwhile, Cursor popularized .cursorrules before transitioning to structured .mdc rule files with YAML frontmatter. For teams using multiple tools, managing these disjoint files quickly becomes an operational burden.

- CLAUDE.md focuses on concise human-like developer guidelines and terminal shell commands.
- AGENTS.md structures explicit delegation criteria, workstream handoffs, and verification steps.
- Cursor .mdc rules provide glob-based pattern matching to apply specific guidelines to matching files.

## The Hidden Traps of Rule Divergence and Stale Invariants

When engineers update testing standards in CLAUDE.md but forget to update AGENTS.md or .cursorrules, the team suffers from rule divergence. A developer using Claude Code will run tests with the new flags, while another engineer using Cursor Composer will trigger deprecated test commands.

Even worse, contradictory instructions can emerge. For example, CLAUDE.md might specify strict ESM imports while .cursorrules still mandates CommonJS require statements. Coding agents caught between conflicting guidelines produce broken code, hallucinate incompatible modules, and generate frustrating review cycles.

- Divergent verification commands cause automated subagents to fail test passes erroneously.
- Conflicting syntax rules lead to oscillating code formats across developer pull requests.
- Engineers waste hours debugging why different tools behave unpredictably on the same repository.

## Establishing a Single Source of Truth with Memoreal MCP

Rather than maintaining three or four separate Markdown files by hand, high-velocity engineering organizations establish a single source of truth in Memoreal MCP. Memoreal ingests your architectural guidelines into an indexed Core memory tier accessible to any MCP-compliant tool.

Running npx @kolivri/memoreal-mcp audit scans your existing rule files, identifies semantic contradictions, and highlights outdated instructions. Once unified in Memoreal, Claude Code, Cursor, Codex CLI, and OpenCode query the exact same live memory endpoint, ensuring 100% policy alignment across your entire engineering team.

- Single source of truth eliminates manual synchronization and prevents human copy-paste errors.
- Automated audit CLI highlights direct contradictions between testing, formatting, and database rules.
- Works natively with all modern MCP-enabled IDEs, terminals, and autonomous subagent harnesses.

## Implementation Example: Auditing and Synchronizing Multi-Harness Rules with Memoreal

```bash
# Step 1: Audit existing project rule files for contradictions and divergence
npx -y @kolivri/memoreal-mcp audit --rules

# Step 2: Bootstrap unified rules into canonical Memoreal persistent memory
npx @kolivri/memoreal-mcp bootstrap --files CLAUDE.md,AGENTS.md

# Step 3: Automatically generate synchronized target rule files if desired
npx @kolivri/memoreal-mcp sync-rules --output all
```

## Frequently Asked Questions

### Can I use both CLAUDE.md and AGENTS.md in the same Git repository?

Yes, both files can coexist cleanly. Claude Code reads CLAUDE.md while tools like OpenCode and Codex CLI prioritize AGENTS.md, though you must ensure rules do not contradict each other.

### Why is .cursorrules being deprecated in favor of .mdc in Cursor?

The legacy .cursorrules file was loaded in full on every turn regardless of relevance. Cursor .mdc files support YAML frontmatter globs, loading rules conditionally only when relevant files are edited.

### How does Memoreal MCP audit prevent rule divergence across tools?

The Memoreal audit CLI parses CLAUDE.md, AGENTS.md, and Cursor rules simultaneously, comparing semantic embeddings and rule ASTs to detect contradictory instructions before they break builds.

## Related Engineering Guides

- [cursor-rules-vs-skills-vs-mcp-memory](https://memoreal.kolivri.com/articles/cursor-rules-vs-skills-vs-mcp-memory)
- [claude-code-compact-vs-clear-memory-fix](https://memoreal.kolivri.com/articles/claude-code-compact-vs-clear-memory-fix)
- [context-engineering-vs-harness-engineering](https://memoreal.kolivri.com/articles/context-engineering-vs-harness-engineering)

### 1-Command Setup
Run `npx -y @kolivri/memoreal-mcp setup` to install the persistent memory MCP server.
