Cursor vs Claude Code vs Windsurf: Rules Compared
A head-to-head comparison of how Cursor, Claude Code, and Windsurf handle rules, context, and agent instructions in 2026.
Three approaches to AI coding
Cursor, Claude Code, and Windsurf are the three dominant AI coding tools in 2026, but they take fundamentally different approaches:
- Cursor puts AI inside your editor — it's a VS Code fork with deeply integrated AI features
- Claude Code puts AI in your terminal — it reads your codebase, runs commands, and works autonomously
- Windsurf puts AI in the driver's seat — its Cascade agent writes code while you supervise
Each tool is excellent. Many developers use two or three of them depending on the task. But each has its own rules format, file locations, and configuration quirks. Here's how they compare.
Rules format comparison
| Feature | Cursor | Claude Code | Windsurf |
|---|---|---|---|
| Rules location | .cursor/rules/*.mdc | .claude/skills/*.md, CLAUDE.md | .windsurf/rules/*.md |
| Legacy format | .cursorrules (root) | CLAUDE.md (root) | .windsurfrules (root) |
| File format | MDC (Markdown + frontmatter) | Markdown | Markdown |
| Global scope | ~/.cursor/rules/ | ~/.claude/CLAUDE.md | ~/.windsurf/rules/ |
| Project scope | .cursor/rules/ in project | .claude/ in project | .windsurf/rules/ in project |
| Glob filtering | Yes (frontmatter globs field) | No (manual context) | No |
| Skills vs rules | Rules only | Skills + Rules (separate dirs) | Rules only |
| Always-apply toggle | Yes (alwaysApply frontmatter) | Yes (all skills auto-loaded) | Yes (all rules auto-loaded) |
Context management
Cursor
Cursor reads rules files and includes them in the AI's context when generating code. The .mdc frontmatter system is the most granular — you can target rules to specific file patterns:
---
description: React component conventions
globs: ["src/components/**/*.tsx"]
alwaysApply: false
---
Use named exports for all components.
Use the cn() utility for conditional classNames.
This means your database rules don't pollute context when you're editing React components. Cursor is the only tool with this level of targeting.
Claude Code
Claude Code reads your CLAUDE.md and all files in .claude/skills/ and .claude/rules/ at the start of every session. It has a massive 200K token context window, so it can absorb more instruction content than other tools.
The trade-off: no glob-based filtering. All instructions are always in context. For most projects this is fine — Claude Code's large context means you rarely hit limits. For very large rulesets, you can organize by putting less-critical content in separate files that Claude reads on demand.
Windsurf
Windsurf's Cascade agent reads rules from .windsurf/rules/ and applies them during its autonomous coding sessions. Like Claude Code, there's no glob filtering — all rules are always active.
Windsurf's strength is its agentic workflow. Cascade doesn't just suggest code — it autonomously creates files, runs commands, and makes multi-file changes. Well-written rules are especially important because Cascade operates with less human oversight per action.
Global vs project scope
| Scope | Cursor | Claude Code | Windsurf |
|---|---|---|---|
| Global | ~/.cursor/rules/*.mdc | ~/.claude/CLAUDE.md | ~/.windsurf/rules/*.md |
| Project | .cursor/rules/*.mdc | .claude/skills/*.md, CLAUDE.md | .windsurf/rules/*.md |
| Precedence | Project overrides global | Project overrides global | Project overrides global |
All three support both global (applies to all projects) and project-level (applies to one repo) rules. Global rules are great for personal preferences — "I always use Vim keybindings" or "prefer functional components." Project rules encode team-specific conventions.
Which tool for which use case?
| Use case | Best tool | Why |
|---|---|---|
| In-editor code generation | Cursor | Inline completions, tab-to-accept, tight editor integration |
| Large refactors | Claude Code | Autonomous multi-file changes, deep context understanding |
| Rapid prototyping | Windsurf | Cascade agent builds features end-to-end with minimal guidance |
| Code review assistance | Cursor or Claude Code | Both excel at reviewing diffs and suggesting improvements |
| Terminal-heavy workflows | Claude Code | Native terminal integration, runs commands directly |
| Visual development | Cursor or Windsurf | IDE integration for seeing changes in real-time |
Many developers use multiple tools. Cursor for daily coding, Claude Code for complex refactors, Windsurf for prototyping new features. The challenge is maintaining consistent rules across all of them.
Using all three with shared agent skills
This is where fragmentation hurts. You write rules for Cursor, then copy them for Claude Code, then adapt them for Windsurf. Three files, three locations, three maintenance burdens.
localskills.sh eliminates this problem. Publish once, install everywhere:
# Publish your rules to the registry
localskills publish .cursor/rules/api-conventions.mdc --team my-team --name api-conventions
# Install into all three tools at once
localskills install my-team/api-conventions --target cursor claude windsurf
The CLI handles the format translation automatically. Your rules become:
.cursor/rules/api-conventions.mdc(with MDC frontmatter for Cursor).claude/skills/api-conventions.md(markdown for Claude Code).windsurf/rules/api-conventions.md(markdown for Windsurf)
When you update the skill, every tool gets the latest version with localskills pull.
How to install the same skill into all three
Step by step:
# 1. Install the CLI
npm install -g @localskills/cli
# 2. Authenticate
localskills login
# 3. Install a skill targeting all three tools
localskills install my-team/api-conventions --target cursor claude windsurf --project
# 4. Verify the files were created
ls .cursor/rules/
ls .claude/skills/
ls .windsurf/rules/
The CLI auto-detects which tools are installed on your machine and pre-selects them in interactive mode. You can also specify targets explicitly for CI/CD pipelines.
Learn how to write effective rules for each tool: Cursor rules guide, CLAUDE.md guide, Windsurf rules guide. Or read about standardizing AI coding across your team.
Use all three tools without maintaining three sets of rules. Get started with localskills.sh.
npm install -g @localskills/cli
localskills login
localskills publish