> *Originally published at [claudeguide.io/cursor-to-claude-code-migration](https://claudeguide.io/cursor-to-claude-code-migration?utm_source=devto&utm_medium=syndication&utm_campaign=cursor-to-claude-code-migration)*
# Migrating from Cursor to Claude Code: A Developer's Guide
**Migrating from Cursor to Claude Code takes about two hours in 2026.** Convert your `.cursorrules` to a `CLAUDE.md` file, install Claude Code with `npm install -g @anthropic-ai/claude-code`, and most of your existing workflow translates directly. Claude Code handles complex autonomous tasks — multi-file refactors, long build pipelines, subagent parallelism — better than Cursor. Cursor still edges ahead for inline edit speed and its visual UI. This guide covers exactly what to convert, what to rebuild, and what to leave behind.
---
## Why Developers Switch from Cursor to Claude Code
### The migration trigger patterns
Based on developer reports in 2026, migrations typically happen when:
1. **Cursor's 10-second edits frustrate you on large tasks** — you find yourself babysitting Claude suggestions that miss context
2. **You need to run commands as part of the workflow** — Cursor doesn't execute bash; Claude Code does
3. **Multi-file refactors require too much manual direction** — Claude Code handles these autonomously
4. **You want subagent parallelism** — Cursor is single-threaded; Claude Code can run multiple agents simultaneously
### What you'll miss from Cursor
Be honest with yourself before switching:
- Cursor's inline diff accept/reject UI is faster for small edits
- Cursor has VS Code extensions and a familiar IDE feel
- Cursor's Tab autocomplete is smoother for line-by-line suggestions
- Cursor's `.cursorrules` is well-documented with a large community
---
## Step 1: Convert `.cursorrules` → `CLAUDE.md`
This is the most important migration step. Your `.cursorrules` file contains the project context Claude Code needs.
### Direct mapping
| `.cursorrules` concept | `CLAUDE.md` equivalent |
|-----------------------|------------------------|
| Project overview | `# Project Overview` section |
| Code style rules | `## Code Style` section |
| Tech stack info | `## Tech Stack` section |
| File structure | `## Directory Structure` section |
| Commands to run | `## Development Commands` section |
| Things to avoid | `## Constraints` section |
### Example conversion
**Before (`.cursorrules`):**
```plaintext
You are an expert TypeScript developer working on a Next.js SaaS app.
Always use TypeScript strict mode.
Never use `any` types.
Database is PostgreSQL with Drizzle ORM.
Authentication is Clerk.
Use shadcn/ui components.
Run `bun run typecheck` before declaring any task complete.
```
**After (`CLAUDE.md`):**
```markdown
# Project Context
This is a Next.js 15 SaaS app with TypeScript strict mode throughout.
## Tech Stack
- Framework: Next.js 15 App Router
- Language: TypeScript (strict mode — no `any` types)
- Database: PostgreSQL with Drizzle ORM
- Authentication: Clerk
- UI Components: shadcn/ui + Tailwind CSS
## Development Commands
```bash
bun run dev # Start dev server
bun run typecheck # Type check (run before declaring done)
bun run build # Production build
bun run test # Run tests
```
## Code Constraints
- Never use `any` types
- Never commit `console.log` statements
- Always add error handling for async operations
- DB migrations: `bun run db:generate` then `bun run db:migrate`
```markdown
### What CLAUDE.md can do that `.cursorrules` can't
**Reference external files:**
```markdown
## API Design Patterns
See `docs/api-patterns.md` for our standard patterns.
When adding new routes, follow the template in `app/api/_template/route.ts`.
```
**Define per-task workflows:**
```markdown
## Adding a New Feature
1. Check `TODO.md` for the task description
2. Create a branch: `git checkout -b feat/[name]`
3. Write tests first, then implementation
4. Run `bun run typecheck && bun run test` before PR
```
---
## Step 2: Install Claude Code
```bash
npm install -g @anthropic-ai/claude-code
```
Verify:
```bash
claude --version
```
**Authentication:**
```bash
claude
# Opens browser for Anthropic account auth
# Or set ANTHROPIC_API_KEY env var for API key auth
```
---
## Step 3: Rebuild Your Workflow Patterns
### Inline edits (Cursor habit) → Targeted requests
In Cursor, you'd select text and hit Cmd+K to edit inline. In Claude Code, you describe what you want:
**Cursor workflow:**
1. Select 20 lines
2. Cmd+K: "Add error handling"
3. Review diff
4. Accept/reject
**Claude Code equivalent:**
```plaintext
"Add proper error handling to the createUser function in src/users/service.ts.
Throw typed errors, handle DB constraint violations separately from network errors."
```
Claude Code reads the file, understands context, makes the change. No selection required.
### Tab autocomplete (Cursor habit) → Not available
Claude Code has no tab autocomplete. If you rely heavily on this, keep Cursor open alongside Claude Code for that workflow. Many developers run both:
- Cursor: active coding with autocomplete
- Claude Code: autonomous tasks, refactors, test generation
### Chat with context (Cursor habit) → Works the same
Both Cursor and Claude Code let you ask questions about the codebase. Claude Code's advantage: it can act on the answer immediately.
```plaintext
Cursor: "What does processPayment() do?" → explains it
Claude Code: "What does processPayment() do, and add input validation" → explains AND does it
```
---
## Step 4: Configure Permissions
Claude Code needs explicit permission for operations that feel automatic in Cursor.
Create `.claude/settings.json` in your project:
```json
{
"permissions": {
"allow": [
"Bash(bun run *)",
"Bash(git log *)",
"Bash(git diff *)",
"Bash(cat *)",
"Bash(find * -name *)"
],
"deny": [
"Bash(rm -rf *)",
"Bash(git push --force *)",
"Bash(git reset --hard *)"
]
}
}
```
Run `/doctor` inside Claude Code to see current permission state.
---
## Workflow Comparison: Claude Code vs Cursor
### Large refactor
**Cursor:**
1. Open Composer (Cmd+I)
2. Select files
3. Describe change
4. Review each file's changes one by one
5. Accept/reject file by file
**Claude Code:**
```plaintext
"Refactor all API routes in app/api/ to use the new error handling middleware.
Files: users/route.ts, payments/route.ts, auth/route.ts, settings/route.ts"
```
Claude Code reads all files, understands the pattern, applies it consistently, runs typecheck, reports done.
**Winner**: Claude Code for large changes (fewer interruptions). Cursor for small changes (faster UI).
---
### Bug investigation
**Cursor:**
Good for looking at code, explaining errors. Can suggest fixes but requires you to apply them.
**Claude Code:**
```plaintext
"The test suite is failing with:
TypeError: Cannot read properties of undefined (reading 'userId')
at AuthMiddleware.ts:47
Find the root cause, fix it, and make sure tests pass."
```
Claude Code: reads the error, traces the call stack through files, finds the null check gap, adds the fix, reruns tests, reports pass.
**Winner**: Claude Code for multi-file debugging.
---
### New feature development
**Cursor:**
Best for feature branches where you know the shape of the code and want inline suggestions as you type.
**Claude Code:**
```typescript
"Build a usage analytics page at app/dashboard/analytics/page.tsx:
- Show daily API calls for last 30 days (Recharts LineChart)
- Show cost breakdown by model (PieChart)
- Source data from usageRecords table via tRPC
- Match existing dashboard styling
- Add loading skeleton states"
```
Claude Code creates the file, wires up tRPC queries, builds components, runs build.
**Winner**: Claude Code for complete features. Cursor for detailed UI polish.
---
## Using Both Tools Together
Many developers keep both:
```plaintext
Cursor (IDE): writing new code with autocomplete, small edits
Claude Code (terminal): autonomous tasks, refactors, bug investigations
```
No conflict — they operate independently.
**Recommended split:**
| Task | Tool |
|------|------|
| New file creation | Claude Code |
| Refactoring existing code | Claude Code |
| Bug investigation | Claude Code |
| Small inline edits | Cursor |
| UI polish (Tailwind) | Cursor |
| Large multi-file feature | Claude Code |
| Autocomplete while typing | Cursor |
---
## Slash Commands Cheat Sheet (Claude Code)
Coming from Cursor, these are the equivalents you'll use daily:
| Action | Claude Code |
|--------|------------|
| New chat | `/clear` |
| Compact context | `/compact` |
| Switch model | `/model haiku` or `/model opus` |
| Check permissions | `/doctor` |
| Init project | `/init` (creates CLAUDE.md) |
| Help | `/help` |
| Run task | Just type it naturally |
---
## Cost Comparison: Cursor vs Claude Code
| Plan | Cost | What you get |
|------|------|-------------|
| Cursor Pro | $20/month | Unlimited Claude 3.5 Sonnet, 10 Opus requests/day |
| Claude Max | $100/month | High-volume Claude access for Claude Code |
| Claude Code (API) | Pay-per-use | ~$0.02-0.10 per complex task (Sonnet) |
**For moderate usage** (10-20 tasks/day): API pricing is often cheaper than Cursor Pro. Heavy usage (50+ tasks/day) may favor Claude Max subscription.
---
## Frequently Asked Questions
**Can I use Claude Code without leaving VS Code?**
Yes — open the integrated terminal in VS Code and run `claude` there. You get full Claude Code functionality within your IDE environment.
**Do I need to delete `.cursorrules` after migrating?**
No. Keep both files. Cursor reads `.cursorrules`; Claude Code reads `CLAUDE.md`. They coexist without conflict.
**Does Claude Code support all the languages Cursor does?**
Yes — Claude Code has no language restrictions. Any language that Claude understands (Python, TypeScript, Go, Rust, etc.) works.
**How do I handle large codebases where context is limited?**
Claude Code uses 200K token context. For very large repos, use CLAUDE.md to point to the most relevant directories:
```markdown
## Focus Areas
- Primary: `src/features/billing/`
- Secondary: `lib/db/`
- Ignore: `node_modules/`, `.next/`, `dist/`
```
**Is Claude Code safe for production code?**
Claude Code can make mistakes like any AI tool. Use Plan Mode (`/plan`) for large changes, keep git commits frequent, and review diffs before pushing.
---
## Related Guides
- [Claude Code vs Cursor: Full Comparison](/claude-code-vs-cursor) — detailed benchmark comparison
- [CLAUDE.md Effective Patterns](/claude-md-effective-patterns) — getting the most from your project context file
- [Claude Code Subagents for Parallel Work](/claude-code-subagents-parallel-research) — when to use multiple agents simultaneously
---
## Take It Further
**[Power Prompts 300: Claude Code Productivity Patterns](https://shoutfirst.gumroad.com/l/agfda?utm_source=claudeguide&utm_medium=article&utm_campaign=cursor-to-claude-code-migration)** — 300 production-tested prompts including the migration workflow, CLAUDE.md templates for 8 stack types, and the autonomous task patterns that replace 80% of Cursor usage.
[→ Get Power Prompts 300 — $29](https://shoutfirst.gumroad.com/l/agfda?utm_source=claudeguide&utm_medium=article&utm_campaign=cursor-to-claude-code-migration)
*30-day money-back guarantee. Instant download.*