claude-vs-cursor
ai/claude-vs-cursor · Updated · Tags: ai
正在用 AI 翻譯成中文,可能需要一分鐘… 以下暫時顯示英文原文。
Claude Code vs Cursor — instruction files & skills
How the two tools handle memory/instruction files and skills, and when each one loads.
Colour key: Claude Code Cursor · amber = no direct equivalent in that tool
Quick answers
- Does Cursor have a
CLAUDE.md/CLAUDE.local.md? Not by that name. Cursor's equivalent is.cursor/rules/*.mdc(project) + User Rules in Cursor Settings (user). Cursor also readsAGENTS.md(project root) as a simple always-on instruction file. The legacy.cursorrulesfile is the old single-file equivalent (deprecated). - Does Cursor have skills? Yes —
.cursor/skills/<name>/SKILL.md, same model-invoked-on-description mechanism as Claude's.claude/skills/. In this repo, tool-agnostic skills are real dirs in.cursor/skills/with symlinks from.claude/skills/.
Instruction / memory files
Two Loads columns because the two tools fire on different triggers — read them per tool.
| What | Claude Code | Cursor | Scope | Loads (Claude) | Loads (Cursor) |
|---|---|---|---|---|---|
| Global user instructions | ~/.claude/CLAUDE.md | User Rules (Cursor Settings → Rules; not a file) | User | Always | Always |
| Global user rule files | ~/.claude/rules/*.md, imported skills | ~/.cursor/rules/ (if used) | User | Always / on-demand per frontmatter | Always / on-demand per frontmatter |
| Project instructions | ./CLAUDE.md or ./.claude/CLAUDE.md | AGENTS.md (root) · legacy .cursorrules | Project | Always | Always |
| Personal project overrides (gitignored) | ./CLAUDE.local.md | (no direct equivalent — use a gitignored .cursor/rules/*.mdc) | Project (local) | Always | N/A (use a gitignored rule → per its frontmatter) |
| Always-on rule | .claude/rules/*.md without paths: frontmatter | .cursor/rules/*.mdc with alwaysApply: true | Project | Always | Always |
| Path/glob-scoped rule | .claude/rules/*.md with paths: frontmatter | .cursor/rules/*.mdc with globs: | Project | On demand — when you Read a matching file | On demand — when a matching file is attached/in context |
| Model-decides rule | (no exact equivalent; closest is the CLAUDE.md glob table pointing at a rule) | .cursor/rules/*.mdc with description: only (Agent Requested) | Project | On demand — only if the glob table points the model at it | On demand — model pulls it in by description relevance |
| Manual / @-mention rule | Listed in CLAUDE.md glob table, read on demand | .cursor/rules/*.mdc with no globs/alwaysApply (Manual) | Project | On demand — when the table/task says to read it | On demand — only when @-mentioned in chat |
| Nested/subdir instructions | Subdirectory CLAUDE.md | Nested .cursor/rules/ in subfolders | Project (sub-tree) | On demand — when working in that subtree | On demand — when a file in that subtree is in context |
| Imports | @path inside any CLAUDE.md/rule (e.g. @RTK.md, @.cursor/rules/foo.mdc) | @file.mdc reference inside a rule | Either | Inlined with the host file | Inlined with the host file |
Skills
| What | Claude Code | Cursor | Scope | Loads (Claude) | Loads (Cursor) |
|---|---|---|---|---|---|
| User skill | ~/.claude/skills/<name>/SKILL.md | ~/.cursor/skills/<name>/SKILL.md | User | On demand — model invokes by description match, or /<name> | On demand — model invokes by description match, or /<name> |
| Project skill | <repo>/.claude/skills/<name>/SKILL.md | <repo>/.cursor/skills/<name>/SKILL.md | Project | On demand — model invokes by description match, or /<name> | On demand — model invokes by description match, or /<name> |
| This repo's convention | Tool-agnostic skill = real dir in .cursor/skills/, symlinked into .claude/skills/; tool-specific skills stay in their own tool folder | same source dir | Project | On demand | On demand |
Skills are never "always loaded" — only their one-line description is indexed; the full SKILL.md body loads when the skill is invoked (by the model matching the description, or the user typing /name).
Load-timing summary
- Always (every turn/session): Claude
~/.claude/CLAUDE.md, projectCLAUDE.md,CLAUDE.local.md,.claude/rules/*withoutpaths:— Cursor: User Rules,AGENTS.md/.cursorrules,alwaysApply: truerules. - On demand (when relevant): Claude
paths:-scoped.claude/rules, subdirCLAUDE.md, all skills — Cursor:globs:rules,description-only rules, manual rules, subdir rules, all skills.
This repo's dual-file rule pattern (Claude ↔ Cursor bridge)
Every glob-scoped rule lives in two files kept in sync:
.cursor/rules/<name>.mdc— source of truth (body + Cursorglobs:/description:)..claude/rules/<name>.md— thin wrapper carrying onlypaths:frontmatter +@.cursor/rules/<name>.mdc.
A rule with no globs (manual) gets no .claude wrapper — instead it's listed in the CLAUDE.md glob table as the on-demand index. See CLAUDE.local.md → "When you update a rule, update BOTH sides", and the /sync-rules skill which audits this coverage.
Disclaimer: These documents are personal notes. The information may be incomplete, out of date or wrong, so check it before you rely on it.