DEV Community

Clogmeter
Clogmeter

Posted on Originally published at clogmeter.vercel.app

How to move Cursor rules to Claude Code (where each rule type goes)

Claude Code doesn't read .cursor/rules, and pasting them all into CLAUDE.md makes every scoped rule load every session. Here's where each Cursor rule type goes instead, plus the frontmatter and glob gotchas.

Originally published on clogmeter.vercel.app.

Claude Code doesn't read .cursor/rules, so your rules don't come with you. The quick fix people suggest is to paste them all into CLAUDE.md. That works, but it changes when each rule loads: Cursor attaches most rules only some of the time, while everything in the project-root CLAUDE.md loads at the start of every session. A better move is to map each Cursor rule type to the Claude Code feature that loads it at the same moment: always-on rules to CLAUDE.md, file-pattern rules to .claude/rules/ with paths:, description rules to a skill, and manual rules to a skill you call with /name.

The question comes from an r/cursor thread, "Easiest way to migrate to Claude Code if I basically only use Cursor Chat?" (16 Nov 2026). Most replies cover the editor side, such as the Claude Code extension, diffs and plan mode. One reply points out that "your cursor rules do not come with you" and suggests copying .cursor/rules into CLAUDE.md, and another asks whether people now keep .cursor/rules and CLAUDE.md in sync by hand. This post covers both.

Behaviour is taken from Cursor's rules docs and Anthropic's Claude Code docs on memory and rules and skills (checked 18 Nov 2026). Both tools change often; confirm on your version with the checks at the end.

The mapping

Cursor rule When Cursor uses it Claude Code home When Claude Code loads it
Always Apply (alwaysApply: true) Every chat Project CLAUDE.md (or a .claude/rules/*.md file with no paths) At startup, every session
Apply to Specific Files (globs:) When a matching file is in context .claude/rules/<name>.md with paths: frontmatter, or a CLAUDE.md in that folder When Claude reads, writes or edits a matching file
Apply Intelligently (description: only) When the agent decides the description is relevant A skill: .claude/skills/<name>/SKILL.md with a description The name and description are listed every session; the body loads when Claude (or you) invokes it
Apply Manually (no fields) When you @-mention it A skill with disable-model-invocation: true Only when you type /name. Its description stays out of context
User Rules Every chat, every project ~/.claude/CLAUDE.md or ~/.claude/rules/ Every session, every project
AGENTS.md (root and nested) Root always; nested ones when working in that folder Keep it. Current Claude Code reads AGENTS.md when there's no CLAUDE.md, or import it with @AGENTS.md Root and above at startup; a subfolder's file when Claude opens a file there

Two notes on the table. Claude Code reads AGENTS.md on its own only from v2.1.277, and by default only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your launch folder or above it. And Anthropic's docs say rules "load into context every session or when matching files are opened", and suggest skills for task-specific instructions that don't need to be there all the time. That is why description rules become skills rather than rules files.

Worked example: seven rules, flat copy vs mapped

A typical small TypeScript app has one always-on rule, three file-pattern rules (components, API handlers, migrations), two description rules (testing, RPC services) and one manual release checklist. We counted the rule bodies with the o200k_base tokenizer. Claude's own tokenizer gives different numbers, so read these as relative weights.

Cursor rule Type Tokens Where it goes
general.mdc Always 84 CLAUDE.md
react-components.mdc Globs src/components/**/*.tsx 118 .claude/rules/react-components.md
api-handlers.mdc Globs src/api/**/*.ts 119 .claude/rules/api-handlers.md
migrations.mdc Globs db/migrations/** 85 .claude/rules/migrations.md
testing.mdc Description 122 Skill testing
rpc-services.mdc Description 88 Skill rpc-services
release.mdc Manual 124 Skill release, manual only
  • Flat copy into CLAUDE.md: 53 lines, about 740 tokens loaded every session, including the release checklist you use once a month and the migration rules on days you never touch the database.
  • Mapped: about 100 tokens at startup: the 84-token CLAUDE.md plus the two skill descriptions (about 20 tokens) in the skill listing. Each scoped rule adds its 85–119 tokens only when Claude works on a matching file. The release skill adds nothing until you type /release.

Seven short rules is a small setup. Real .cursor/rules folders often run to thousands of tokens, and the gap grows with them. Anthropic's target for each CLAUDE.md is under 200 lines.

Converting one file-pattern rule

Cursor, .cursor/rules/api-handlers.mdc:

---
globs: src/api/**/*.ts
alwaysApply: false
---

- Every handler validates its input with the zod schema in `src/api/schemas/`.
- Log with `logger` from `src/lib/logger.ts`, never `console.log`.
Enter fullscreen mode Exit fullscreen mode

Claude Code, .claude/rules/api-handlers.md:

---
paths:
  - "src/api/**/*.ts"
---

- Every handler validates its input with the zod schema in `src/api/schemas/`.
- Log with `logger` from `src/lib/logger.ts`, never `console.log`.
Enter fullscreen mode Exit fullscreen mode

And a description rule as a skill, .claude/skills/testing/SKILL.md:

---
name: testing
description: How to write and run unit and integration tests in this repo
---

- Unit tests live next to the file as `*.test.ts` and run with `pnpm test`.
- ...
Enter fullscreen mode Exit fullscreen mode

For the manual release checklist, add disable-model-invocation: true to the skill's frontmatter so only /release runs it.

Five things that break in a straight copy

  1. Claude Code ignores Cursor's frontmatter. The docs say paths is the only field Claude Code reads from a rule, and other fields are "ignored without an error". A copied rule with globs: or description: and no paths: loads at launch, every session. Rename globs to paths, and move description rules to skills.
  2. The file extension changes. Cursor needs .mdc and ignores plain .md in .cursor/rules. Claude Code discovers .md files under .claude/rules/, including subfolders.
  3. Some globs match more. In Cursor, *.ts matches .ts files in the root only. In Claude Code, a pattern like *.md matches anywhere under the base directory, and /*.md is the root-only form. Cursor separates patterns with commas; Claude Code takes a YAML list or a comma-separated string.
  4. @file means something different. In a Cursor rule, @migration-template.sql tells the agent where to look, and the file isn't inlined. In CLAUDE.md, @path is an import: the file loads into context together with the CLAUDE.md, every session. Wrap the path in backticks to keep it as plain text.
  5. Broken YAML fails open. If a rule's frontmatter doesn't parse, Claude Code loads the rule as if it had no paths, which means every session. Run claude --debug to see the parse error.

If you keep using both tools

  • Shared always-on rules: put them in one root AGENTS.md. Cursor reads it, and current Claude Code reads it too when there's no CLAUDE.md. If you need a CLAUDE.md as well, start it with @AGENTS.md and add Claude-only lines below; Anthropic documents that the import never makes Claude read AGENTS.md twice. Don't also paste the same rules into CLAUDE.md, or you pay twice and the copies drift.
  • Scoped rules: there's no shared format. Cursor wants .mdc with globs, and Claude Code wants .md with paths. Pick one folder as the source and regenerate the other, or keep folder-specific rules in nested AGENTS.md files. Cursor loads those when it works in that folder, and Claude Code does the same when it is reading AGENTS.md (no CLAUDE.md in your launch folder or above, and none in that subfolder).
  • Don't convert everything on day one. One reply in the thread suggests overlapping the tools for a while. Move the always-on rules first, then add scoped rules when Claude gets something wrong in that area.

How to check what loaded

  1. Run /context all in a fresh session and check the Memory files list. Run it again after Claude has edited a file under src/api/ to see the scoped rule appear.
  2. Run /memory to see and open your CLAUDE.md and rules files.
  3. Check the skills list with /skills to see each skill and whether Claude can invoke it on its own.
  4. Weigh the result. Paste your old .mdc files into the free Cursor rules token counter and your new CLAUDE.md into the CLAUDE.md token counter, then paste everything into Clogmeter to flag duplicates and always/never conflicts between the two tools' files.

If you want to see what your own CLAUDE.md, AGENTS.md or Cursor rules cost in tokens and where they repeat or contradict each other, we built a free browser-only checker: Clogmeter.

Top comments (0)