Automatic synchronization for CLAUDE.md ↔ AGENTS.md files. Keep AI assistant instructions in sync when using Claude Code + Cursor together.
# cursor-agents-sync
**Automatic synchronization for CLAUDE.md ↔ AGENTS.md files in Claude Code projects**
Keep your AI assistant instructions synchronized when using multiple AI coding tools (Claude Code, Cursor, etc.) in the same project.
---
## The Problem
Different AI coding tools read instructions from different files:
- **Claude Code** reads `CLAUDE.md`
- **Cursor** (and other tools) read `AGENTS.md`
When using multiple AI tools in the same project, you need both files to contain identical instructions. Manually keeping them in sync is tedious and error-prone.
## The Solution
`cursor-agents-sync` is a Claude Code hook that automatically synchronizes `CLAUDE.md` and `AGENTS.md` files:
- ✅ **Bidirectional sync**: Edit either file, the other updates instantly
- ✅ **Auto-discovery**: Automatically finds all pairs in your project
- ✅ **Zero maintenance**: Set it once, forget about it
- ✅ **Safe**: Only updates when content actually differs
- ✅ **Monorepo ready**: Handles multiple pairs in subdirectories
- ✅ **Silent operation**: Works in background, logs available if needed
---
## Quick Start
### 1. Installation
```bash
# Clone or download this repository
git clone https://github.com/alexandrbasis/cursor-agents-sync.git
# Copy .cursor directory to your project
cp -r cursor-agents-sync/.cursor /path/to/your-project/
# Make scripts executable
chmod +x /path/to/your-project/.cursor/hooks/*.sh
```
### 2. Configuration
Add to your `.cursor/settings.local.json`:
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.cursor/hooks/auto-sync-cursor-agents.py",
"timeout": 30
}
]
}
]
}
}
```
### 3. Done!
Now whenever you edit `CLAUDE.md` or `AGENTS.md` in Claude Code, the other file updates automatically.
---
## How It Works
```
┌────────────────────────────────────────────Agent that generates comprehensive documentation, API references, architecture diagrams, and developer onboarding guides from existing code.
Agent configuration for systematic bug investigation that traces issues from error logs through the codebase to root cause with suggested fixes.
Agent for integrating third-party APIs including SDK setup, type generation, error handling, retry logic, and rate limit management.
Cursor's built-in autonomous coding agent that can make multi-file edits, run terminal commands, search the codebase, and iteratively build features with minimal human intervention.
Cloud-based autonomous coding agent that runs in the background on remote sandboxed environments, handling complex multi-step tasks while you continue working.
Cursor's multi-file editing agent within Composer mode that can create, edit, and delete files across your entire project in a single conversation.