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.
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 Code | Notes |
|---|---|---|
AGENTS.md | AGENTS.md, read as is | When there's no CLAUDE.md (Claude Code v2.1.277 or later) |
.cursorrules (legacy) | CLAUDE.md | Copy the text over |
.cursor/rules/*.mdc with alwaysApply: true | CLAUDE.md, or .claude/rules/*.md | Loaded 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 description | A skill in .claude/skills/ | Claude picks it up when the task matches |
Manual rules (@rule-name) | A skill you call as /name | Or a file you @-mention |
| User Rules (settings) | ~/.claude/CLAUDE.md | Applies to every project |
| Team Rules (dashboard) | A managed CLAUDE.md | Deployed by your IT, see below |
.cursor/mcp.json | .mcp.json at the repository root | Small syntax changes |
~/.cursor/mcp.json | User scope, in ~/.claude.json | Added with claude mcp add-json --scope user |
.cursorignore | permissions.deny rules, plus the sandbox | No 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 intoCLAUDE.mdand delete it.- Always-applied rules. An
.mdcfile withalwaysApply: truegoes intoCLAUDE.md, or into its own file in.claude/rules/without frontmatter. Every.mdfile there loads at the start of each session, likeCLAUDE.md. - Rules scoped by globs. These have a direct equivalent: a
.claude/rules/file with apaths: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
.mdcrule with only adescriptionto the agent, which decides whether to apply it. In Claude Code, that's what a skill does: aSKILL.mdin.claude/skills/<name>/whose description tells Claude when to load it. - Manual rules. A rule you pull in with
@rule-namebecomes 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.mdyour IT places at/Library/Application Support/ClaudeCode/CLAUDE.mdon macOS (/etc/claude-code/CLAUDE.mdon 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:
- Environment variables. Cursor writes
${env:API_KEY}. Claude Code writes${API_KEY}, or${API_KEY:-default}with a fallback. - The project folder. Cursor's
${workspaceFolder}becomes${CLAUDE_PROJECT_DIR:-.}. The default after:-is needed in a project.mcp.json, by the MCP docs. - Remote servers. An entry with a
urlneeds a"type": "http"(or"sse"). Claude Code reads an entry without atypeas a local command, so it fails. envFile. Cursor can load a.envfile 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 appliesReaddeny 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. .gitignoreonly hides files from the picker. Claude Code'srespectGitignoresetting, 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 Cursor | In Claude Code |
|---|---|
| Agent chat in the side panel | The Claude Code panel in VS Code, or claude in a terminal |
| Tab completion | None. Claude Code is an agent, not an autocomplete, so keep an editor's completion if you rely on it |
| Plan before editing | Plan mode, Shift+Tab |
| Checkpoints | /rewind, or Esc twice. See undoing Claude Code's changes |
| Background and cloud agents | Background sessions, worktrees, cloud sessions. See running coding agents in parallel |
| Agents on your phone | Remote 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
- Cursor is now Grok Build: what changed
- Grok Build pricing
- Using Claude in Grok Build
- Grok Build alternatives
- Relais vs Grok Build
- What Grok Build's /import-claude and /resume-claude read
- Grok Build Remote Control vs Claude Code
- Running coding agents in parallel in Grok Build and Claude Code
- Grok Build privacy after the Cursor merger
- Grok Build vs Claude Code, side by side
#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.