How to migrate from Cursor to Claude Code: rules, MCP servers and ignore files, step by step

Moving from Cursor (now Grok Build) to Claude Code. Turn .cursor/rules and .cursorrules into CLAUDE.md and .claude/rules, .cursor/mcp.json into .mcp.json, .cursorignore into deny rules, and keep your editor.

· 9 min read

On November 30, 2026, Cursor became Grok Build. The desktop app keeps working as before, but some people are using the change as the moment to move to Claude Code. Most of a Cursor setup carries over in under an hour: your rules become CLAUDE.md and .claude/rules/, your MCP servers move to .mcp.json, and your ignore file becomes a few deny rules. You don't even have to leave the editor.

Every step below was checked against both sides' documentation on November 30, 2026: Grok Build's docs, which now hold Cursor's at docs.grok.com/build (cursor.com/docs redirects there), and Anthropic's Claude Code docs.

#What moves where?

In Cursor (Grok Build desktop)In Claude CodeNotes
AGENTS.mdAGENTS.md, read as isWhen there's no CLAUDE.md (Claude Code v2.1.277 or later)
.cursorrules (legacy)CLAUDE.mdCopy the text over
.cursor/rules/*.mdc with alwaysApply: trueCLAUDE.md, or .claude/rules/*.mdLoaded every session
.cursor/rules/*.mdc with globs.claude/rules/*.md with paths:Loaded when Claude touches a matching file
.cursor/rules/*.mdc with only a descriptionA skill in .claude/skills/Claude picks it up when the task matches
Manual rules (@rule-name)A skill you call as /nameOr a file you @-mention
User Rules (settings)~/.claude/CLAUDE.mdApplies to every project
Team Rules (dashboard)A managed CLAUDE.mdDeployed by your IT, see below
.cursor/mcp.json.mcp.json at the repository rootSmall syntax changes
~/.cursor/mcp.jsonUser scope, in ~/.claude.jsonAdded with claude mcp add-json --scope user
.cursorignorepermissions.deny rules, plus the sandboxNo ignore file in Claude Code

#Step 1: install Claude Code

On macOS, Linux or WSL, the quickstart installs it with one line (Homebrew works too, with brew install --cask claude-code):

curl -fsSL https://claude.ai/install.sh | bash

Run claude in your project and sign in with your Claude account. A Pro or Max plan covers it, with no API key. If you were paying for Claude models in Cursor, that's the first change: in Grok Build today, Claude and other third-party models aren't part of the included usage. On Premium and above, they're billed at API list price from prepaid credit, by Grok Build's models page. Its pricing is covered on its own page.

#Step 2: turn your rules into CLAUDE.md

Start with what loads every time. If your repository has an AGENTS.md, Claude Code reads it on its own when there's no CLAUDE.md, so there's nothing to do. If you want both, create a CLAUDE.md that imports it, so the two tools share one file:

@AGENTS.md

## Claude Code
- Run `pnpm test` before you say a task is done.

Then move the rest:

  • .cursorrules. It's the old single-file format. Paste its text into CLAUDE.md and delete it.
  • Always-applied rules. An .mdc file with alwaysApply: true goes into CLAUDE.md, or into its own file in .claude/rules/ without frontmatter. Every .md file there loads at the start of each session, like CLAUDE.md.
  • Rules scoped by globs. These have a direct equivalent: a .claude/rules/ file with a paths: list. Cursor separates patterns with commas, Claude Code takes a YAML list.

A Cursor rule like this one, .cursor/rules/api.mdc:

---
description: API conventions
globs: src/api/**/*.ts, src/server/**/*.ts
alwaysApply: false
---
- Validate every request body with zod.
- Return errors in the { error: { code, message } } shape.

becomes .claude/rules/api.md:

---
paths:
  - "src/api/**/*.ts"
  - "src/server/**/*.ts"
---
- Validate every request body with zod.
- Return errors in the { error: { code, message } } shape.

By Claude Code's memory docs, a path-scoped rule loads when Claude reads, writes or edits a matching file, so it costs nothing in sessions that never touch the API.

  • Rules the agent picks by description. Cursor offers an .mdc rule with only a description to the agent, which decides whether to apply it. In Claude Code, that's what a skill does: a SKILL.md in .claude/skills/<name>/ whose description tells Claude when to load it.
  • Manual rules. A rule you pull in with @rule-name becomes a skill you call by its name (/release-checklist), or a plain file you @-mention.
  • User Rules. They live in Cursor's settings, not in a file. Copy them into ~/.claude/CLAUDE.md, which applies to every project on your machine.
  • Team Rules. Cursor's dashboard pushes them to everyone. Claude Code's closest equivalent is a managed CLAUDE.md your IT places at /Library/Application Support/ClaudeCode/CLAUDE.md on macOS (/etc/claude-code/CLAUDE.md on Linux).

Keep CLAUDE.md short. Anthropic suggests under 200 lines per file and moving anything that matters for part of the code into path-scoped rules. Run /memory in a session to see which files loaded. The CLAUDE.md guide has more on what to put in it.

#Step 3: move your MCP servers to .mcp.json

Both tools use the same mcpServers wrapper, so most entries copy over. Rename .cursor/mcp.json to .mcp.json at the repository root, then fix four things:

  1. Environment variables. Cursor writes ${env:API_KEY}. Claude Code writes ${API_KEY}, or ${API_KEY:-default} with a fallback.
  2. The project folder. Cursor's ${workspaceFolder} becomes ${CLAUDE_PROJECT_DIR:-.}. The default after :- is needed in a project .mcp.json, by the MCP docs.
  3. Remote servers. An entry with a url needs a "type": "http" (or "sse"). Claude Code reads an entry without a type as a local command, so it fails.
  4. envFile. Cursor can load a .env file for a local server. Claude Code's MCP docs don't list that field, so export the variables in your shell and reference them with ${NAME}.

Before and after:

// .cursor/mcp.json
{
  "mcpServers": {
    "linear": { "url": "https://mcp.linear.app/mcp" },
    "db": {
      "command": "node",
      "args": ["${workspaceFolder}/tools/db-mcp.js"],
      "env": { "DATABASE_URL": "${env:DATABASE_URL}" }
    }
  }
}
// .mcp.json
{
  "mcpServers": {
    "linear": { "type": "http", "url": "https://mcp.linear.app/mcp" },
    "db": {
      "command": "node",
      "args": ["${CLAUDE_PROJECT_DIR:-.}/tools/db-mcp.js"],
      "env": { "DATABASE_URL": "${DATABASE_URL}" }
    }
  }
}

The first time you run claude in the folder, it asks you to approve the servers from .mcp.json. That's on purpose: a cloned repository can't switch its own servers on. claude mcp list then shows each one's status.

Global servers from ~/.cursor/mcp.json belong in your user scope. Add each one with the object inside mcpServers:

claude mcp add-json --scope user docs '{"type":"http","url":"https://mcp.example.com/mcp"}'

If a key was written in clear in a Cursor config, this is a good moment to move it to an environment variable. More in MCP servers in Claude Code and keeping secrets out of Claude Code.

#Step 4: replace .cursorignore with deny rules

Claude Code has no ignore file. The equivalent is a deny rule in .claude/settings.json, which you commit so it applies to everyone:

{
  "permissions": {
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)"
    ]
  }
}

The patterns use the same syntax as .gitignore, so most lines of a .cursorignore translate one for one. Two things to know, on both sides:

  • Neither is a wall. Cursor's own docs say the terminal and MCP tools can't block files listed in .cursorignore. Claude Code applies Read deny rules to its built-in tools, @-mentions and IDE context as a best effort. To stop shell commands too, turn on Claude Code's sandbox, which enforces file and network limits at the OS level.
  • .gitignore only hides files from the picker. Claude Code's respectGitignore setting, on by default, keeps ignored files out of the @ file picker. It doesn't stop Claude from reading them.

#Step 5: keep your editor, or move to the terminal

You don't have to give up the editor. Claude Code's VS Code docs list install links for VS Code and for Cursor, and the extension installs in other VS Code forks through the Open VSX Registry. It brings Claude Code into a side panel, with inline diffs, @-mentions of files and plan review. Or run claude in any integrated terminal.

How Cursor habits map:

Habit in CursorIn Claude Code
Agent chat in the side panelThe Claude Code panel in VS Code, or claude in a terminal
Tab completionNone. Claude Code is an agent, not an autocomplete, so keep an editor's completion if you rely on it
Plan before editingPlan mode, Shift+Tab
Checkpoints/rewind, or Esc twice. See undoing Claude Code's changes
Background and cloud agentsBackground sessions, worktrees, cloud sessions. See running coding agents in parallel
Agents on your phoneRemote Control in the Claude app. See remote control compared

#Step 6: check that it all loaded

In a fresh session:

claude
/memory      # which CLAUDE.md and rules files loaded
/mcp         # which servers connected
/permissions # your deny rules

Then give it a real task from your backlog, one that touches the API folder, and watch the path-scoped rule load.

#Can you keep both tools?

Yes, and moving to Claude Code's format doesn't break Grok Build. By its docs, Grok Build's desktop app reads CLAUDE.md like AGENTS.md, loads skills from .claude/skills/, and runs Claude Code hooks from .claude/settings.json. The Grok Build terminal app reads CLAUDE.md, .claude/rules/*.md and MCP servers from .mcp.json and ~/.claude.json. Its new /import-claude copies Claude Code settings the other way. Before running it, read what Grok Build's import reads.

#FAQ

Will my Cursor rules work in Claude Code without changes?

AGENTS.md will. .mdc files won't: Claude Code reads .md files in .claude/rules/, with paths: instead of globs. The conversion is a copy and a frontmatter edit.

Do I need an API key for Claude Code?

No. A Claude Pro or Max plan covers it, within its usage limits. API billing is an option, not a requirement.

Is there a .claudeignore?

No. Use permissions.deny rules with Read(...) patterns in .claude/settings.json, and the sandbox for shell commands.

Can I use Claude Code inside Cursor?

Claude Code's docs give an install link for Cursor, and the extension works in VS Code forks through Open VSX. Since the app is now called Grok Build, check that the link still opens it in your version.

What about Cursor's Tab autocomplete?

Claude Code doesn't have one. Many people keep an editor's completion for typing and use Claude Code for the work.

#More on the Grok Build change

#In Relais

Relais is a Mac app built on Claude Code. Once your setup is in CLAUDE.md and .mcp.json, Relais runs Claude Code sessions with it, sorted by project, with a Needs you list of what waits for you, undo from any message and commit in a click, on your own Claude plan. It reads the same files Claude Code does, so the migration above is all the setup it needs. It doesn't run Grok Build. See what Relais adds to Claude Code, or Relais next to Grok Build. Every comparison is on Compare.

Your AI team,
on your Claude plan.

$14.99 a month, everything included. On your Mac or on Linux, on your Claude Pro or Max plan. Cancel any time.