How to migrate your AI coding rules between different IDEs and configuration formats.
Different AI IDEs use different file formats for their configuration. This guide helps you:
- Migrate from one IDE to another
- Support multiple IDEs simultaneously
- Use the universal AGENTS.md standard as a single source of truth
| From \ To | Cursor | Windsurf | GitHub Copilot | Claude Code | Cline | Codex |
|---|---|---|---|---|---|---|
| Cursor | - | Copy content | Reformat YAML | Remove frontmatter | Copy as-is | Remove frontmatter |
| Windsurf | Add YAML frontmatter | - | Add applyTo | Copy as-is | Copy as-is | Copy as-is |
| GitHub Copilot | Convert applyTo to globs | Remove applyTo | - | Remove frontmatter | Copy as-is | Remove frontmatter |
| Claude Code | Add YAML frontmatter | Copy as-is | Add applyTo | - | Copy as-is | Copy as-is |
| Cline | Add YAML frontmatter | Copy as-is | Add applyTo | Copy as-is | - | Copy as-is |
| Codex | Add YAML frontmatter | Copy as-is | Add applyTo | Copy as-is | Copy as-is | - |
The simplest approach is to maintain a single AGENTS.md file and create symlinks:
# Create your universal configuration
cp templates/agent-template.md AGENTS.md
# Customize AGENTS.md for your project
# Create symlinks for all IDEs
ln -sf AGENTS.md .windsurfrules # Windsurf
ln -sf AGENTS.md .cursorrules # Cursor (legacy)
ln -sf AGENTS.md CLAUDE.md # Claude Code
ln -sf AGENTS.md .clinerules # Cline
# Codex reads AGENTS.md natively — no symlink needed
# GitHub Copilot (needs .github/ directory)
mkdir -p .github
ln -sf ../AGENTS.md .github/copilot-instructions.mdPros:
- Single source of truth
- Edit once, all IDEs updated
- No content drift between formats
Cons:
- Cannot use IDE-specific features (globs, YAML frontmatter)
- One-size-fits-all format
Use each IDE's native format for maximum capability:
.cursor/rules/
├── 000-core-principles.mdc # alwaysApply: true
├── 001-code-style.mdc # alwaysApply: true
├── 002-security.mdc # alwaysApply: true
├── 100-testing.mdc # globs: ["**/*.test.*"]
└── 101-react-patterns.mdc # globs: ["**/*.tsx"]
global_rules.md → Windsurf Settings → AI Settings
.windsurfrules → Project root
.github/
├── copilot-instructions.md # Always active
└── instructions/
├── testing.instructions.md # applyTo: "**/*.test.*"
└── react.instructions.md # applyTo: "**/*.tsx"
CLAUDE.md → Project root (highest priority)
.claude/rules/*.md → Modular rules
subfolder/CLAUDE.md → Directory-specific overrides
.clinerules/
├── 01-core-principles.md
├── 02-code-style.md
├── 03-security.md
└── 04-testing.md
AGENTS.md → Project root (read natively)
subfolder/AGENTS.md → Directory-specific overrides
~/.codex/AGENTS.md → Global defaults
- Take your
.windsurfrulescontent - Split into separate .mdc files by topic (core, style, security, testing)
- Add YAML frontmatter to each file:
--- description: Core coding principles alwaysApply: true ---
- For file-specific rules, add glob patterns:
--- description: React patterns globs: ["**/*.tsx", "**/*.jsx"] alwaysApply: false ---
- Place files in
.cursor/rules/directory
- Combine all .mdc file contents into one document
- Remove YAML frontmatter from each section
- Organize with Markdown headers instead of separate files
- Save as
.windsurfrulesin project root - Move global rules to Windsurf Settings → AI Settings
- Create
.github/directory - Main rules →
.github/copilot-instructions.md - File-specific rules →
.github/instructions/[topic].instructions.md - Add
applyTofrontmatter for file-type-specific rules:--- applyTo: "**/*.tsx,**/*.jsx" ---
- Create
CLAUDE.mdin project root with core rules - Create
.claude/rules/directory for modular rules - Keep rules concise - Claude Code treats every line as a strong directive
- No YAML frontmatter needed - pure Markdown
- Use directory-based CLAUDE.md for scoped rules instead of globs
- Create
.clinerules/directory - Split rules into numbered files (01-, 02-, etc.)
- Pure Markdown format (no frontmatter needed)
- Cline also reads .cursorrules, CLAUDE.md, .windsurfrules, AGENTS.md
Add these files to .gitignore (the symlink targets):
# Don't need to track symlinks if using AGENTS.md approach
# .cursorrules
# .clinerules
# .rules
# CLAUDE.mdOr commit all files for teams using different IDEs:
project-root/
├── AGENTS.md # Universal (Cursor, Codex, Aider)
├── .windsurfrules → AGENTS.md # Windsurf
├── .cursorrules → AGENTS.md # Cursor legacy
├── CLAUDE.md → AGENTS.md # Claude Code
├── .clinerules → AGENTS.md # Cline
│ # Codex reads AGENTS.md natively
├── .github/
│ └── copilot-instructions.md → ../AGENTS.md # GitHub Copilot
├── .cursor/rules/ # Cursor advanced (optional)
│ ├── 000-core.mdc
│ └── 100-testing.mdc
└── .claude/rules/ # Claude Code modular (optional)
├── security.md
└── testing.md
| Feature | Cursor .mdc | Windsurf | Copilot | Claude Code | Cline | Codex |
|---|---|---|---|---|---|---|
| YAML frontmatter | Required | No | Optional | No | Optional | No |
| Glob patterns | ✅ globs: |
❌ | ✅ applyTo: |
❌ | ✅ globs: |
❌ |
| Multi-file | ✅ .cursor/rules/ |
❌ | ✅ instructions/ |
✅ .claude/rules/ |
✅ .clinerules/ |
❌ |
| Hierarchy | User > Project > Rule | Global > Project | Repo > Dir | User > Project > Dir | Global > Workspace | User > Project |
| Max size | ~500 tokens/file | ~6000 chars global | No limit | No limit | No limit | No limit |
- Start with AGENTS.md: Get your content right in one place first
- Test incrementally: Migrate one IDE at a time
- Verify behavior: Ask AI a standard question to verify rules are loaded
- Keep content synced: If using separate files, sync content regularly
- Use symlinks: Simplest way to support multiple IDEs from one source
Need help? Use our adaptation prompt to generate IDE-specific configurations from your AGENTS.md.