How to Use Claude Code and Cursor Together (My Actual Setup)
Published September 7, 2026
Cursor and Claude Code aren’t competitors. Once you use them together, going back to one feels like coding one-handed. Here’s the setup that works.
The mental split
Cursor for anything you’d do with your eyes: writing new code, reviewing diffs, exploring the codebase, using autocomplete.
Claude Code for anything you’d script: multi-file refactors, running long tasks, orchestrating sub-agents, batch changes, working over SSH.
If a task takes more than 5 seconds to type but is otherwise mechanical, Claude Code. If a task requires you to see the output as it’s forming, Cursor.
Physical setup
Screen 1: Cursor full-window on your main monitor. Screen 2 (or split): terminal with Claude Code, always in the same project directory as your open Cursor project.
Both point at the same repo. Both edit the same files. They don’t conflict because they’re both just modifying the filesystem.
The safety rule
Never run Claude Code and Cursor’s Composer at the same time on the same files. They’ll race. Cursor might revert what Claude Code just wrote, or vice versa. Pick one to be the active writer per task.
Where they hand off
Real examples from my week:
Refactoring pattern: Cursor for the first file (where I need to understand what’s changing), then Claude Code to propagate the pattern to the other 12 files with “apply the same refactor to all files in src/handlers/*.ts, using src/handlers/users.ts as the reference.”
Debugging pattern: Cursor to poke at the failing test, add print statements, run it locally, get the failure mode clear in my head. Claude Code to trace through the codebase and find where the bug actually is once I have a hypothesis.
Building a new feature: Cursor for the initial scaffolding and iterative UI work (I need to see what’s rendering). Claude Code for the backend batch work (add endpoint, add tests, add types, add migration, add docs — all in one prompt).
Code review: Claude Code with /plan mode against the PR branch, then read its analysis. Cursor for actually making the review comments if I decide to change things.
Configuration
CLAUDE.md that Cursor also reads
Cursor 0.44+ reads project-level .cursorrules OR CLAUDE.md for context. So you can have one file both tools use.
Put this at your project root, name it either. Cursor picks it up as system rules, Claude Code picks it up as project context.
# CLAUDE.md
## Project
Next.js 15 SaaS with Stripe, Supabase auth, Postgres.
## Style
- Never use `any`. Use `unknown` if genuinely unknown.
- Do not add comments unless the "why" is non-obvious.
- Prefer Server Components. Only add "use client" if the component needs interactivity.
## Constraints
- Never add a new npm package without asking first.
- Do not modify migrations after they run in production.
- Match existing code style; do not reformat unrelated lines.
Both tools now behave consistently.
Git config
Because both tools commit sometimes, agree on an author:
git config user.name "Matic"
git config user.email "matic@example.com"
Optional: give Claude Code its own author signature via a hook:
// ~/.claude/settings.json
{
"hooks": {
"afterEdit": "git config user.name 'Matic (via Claude Code)'"
}
}
I don’t bother. One author is fine.
Cursor .cursorrules pointing at Claude Code
Add this to your .cursorrules so Cursor knows to defer certain tasks:
For tasks that touch more than 3 files, ask the user if they want to
delegate to Claude Code in the terminal instead of using Composer.
For running shell commands, prefer suggesting the command for the user
to run in their Claude Code session rather than executing it directly.
Cursor now stops trying to be Claude Code, and Claude Code stops being under-utilized.
The .gitignore you actually need
Both tools may create scratch files. Add:
# Claude Code
.claude/
CLAUDE.local.md
# Cursor
.cursor/
.cursorignore
.cursorignore is like .gitignore but for Cursor’s indexing. Add generated files, huge JSONs, node_modules.
Task delegation cheat sheet
| Task | Tool |
|---|---|
| Add a new component | Cursor Composer |
| Rename a symbol across 20 files | Claude Code |
| Debug why the test is flaky | Start Cursor, escalate to Claude Code if it takes >10 min |
| Write documentation | Claude Code (batch task, no visual output needed) |
| Explore how X works in this codebase | Cursor chat (@codebase context) |
| Set up CI/CD | Claude Code (multi-file, sequential, config-heavy) |
| Prototype a design | Cursor (need to see the render) |
| Migrate to a new library version | Claude Code with sub-agents |
| Interactive REPL-style exploration | Neither, use your terminal directly |
What each tool learns
Cursor learns your file access patterns, indexes your code semantically, remembers your recent edits.
Claude Code learns from CLAUDE.md, from MCP servers you’ve configured, from your explicit context in the current session.
Both benefit from good CLAUDE.md. Neither benefits from bad prompts.
Cost stacking
Claude Pro: $20/mo (includes Claude Code). Cursor Pro: $20/mo. Total: $40/mo for both.
That’s the price of one nice lunch. If you code full time, this pays for itself in a week of avoided context-switching.
For lighter use, pick one. See is Cursor worth it and Claude Code vs Cursor for the individual verdicts.
When to drop one
If you’re only using Claude Code for autocomplete-adjacent tasks, drop it and keep Cursor. If you’re only using Cursor as a text editor that happens to have AI, drop it and keep Claude Code + your favorite terminal editor.
The dual-tool setup earns its cost when you use each for what it’s uniquely good at.
Related
FAQ
Won’t Cursor and Claude Code conflict when editing the same file?
They can, if you run them simultaneously. The safe pattern is one active writer per task. Cursor watches the filesystem and will reload when Claude Code changes files — no conflict as long as you’re not editing in Cursor at that exact moment.
Do I need to pay for both Claude Pro and Cursor Pro?
If you use both heavily, yes. Claude Pro ($20) is required to use Claude Code past the free trial. Cursor Pro ($20) is required for meaningful chat usage. $40/mo total.
Can Cursor call Claude Code as a tool?
Not directly. But you can add an MCP server that spawns Claude Code subprocesses and returns output. Some devs do this. I don’t — I prefer explicit tool switching.
Should I put my project rules in CLAUDE.md or .cursorrules?
Newer Cursor versions read both. CLAUDE.md is the more portable choice — Claude Code, Cursor 0.44+, and other AI clients respect it. If your tools all read it, one file is easier to maintain.
Which one commits my code to git?
Whichever tool you tell to. Both can run git commit. I prefer running commits manually from the terminal so I can review the diff. Both tools respect your git config’s user.name and user.email.