Claude Code vs Cursor: Which Wins for AI Agent Dev (2026)
I built two production agent stacks across six months ending 2026-04-28: one driven from Claude Code Max 20x using the /model opus alias, one from Cursor Ultra routing across multiple providers. Both repos sit at roughly 200K LOC TypeScript, mixed MCP server code, orchestration, and observability plumbing. The task mix was agent infrastructure, not frontend. Request counts and rate-limit timing in this page come from my own CLI session logs over that window; I do not publish token-burn or hook-latency numbers because I did not instrument them rigorously enough to defend. Verdicts on ergonomics are anecdotal and labeled as such. The decision boundary I landed on: Claude Code for agent infrastructure work, Cursor for IDE-resident feature work.
TL;DR
Pick Claude Code for agent infrastructure work, CLI-heavy backends, MCP server development, and any codebase where session-persistent context (CLAUDE.md, skills, hooks) earns back the setup time. Pick Cursor for full-stack feature work, frontend-heavy codebases, and teams that want a shared IDE surface with inline edit affordances.
The biggest tradeoffs in concrete operator terms:
- Setup work. Claude Code needs an upfront investment in CLAUDE.md authoring, skill curation, and hook review (half a day to a few days before it pays back). Cursor is productive in roughly 10 minutes after importing VS Code settings.
- Extension points. Claude Code exposes skills, blocking
Stop/SubagentStophooks, MCP servers, and Task-tool sub-agents. Cursor exposes Project Rules,beforeShellExecution/afterFileEdit/beforeReadFile/beforeSubmitPrompthooks, MCP, and Background Agents (no documented session-end blocking equivalent). - Artifact portability. Claude Code skills and hooks are plain markdown and shell scripts in
~/.claude/, greppable and diffable outside the tool. Cursor's.cursor/rules/*.mdcfiles are plain text; Composer history, accepted-edit telemetry, and marketplace install state are not. - Review loop. Cursor's syntax-highlighted side-by-side diff UI for multi-file proposed edits is better than Claude Code's terminal diff when reviewing 10+ file changes interactively.
- Policy controls. Claude Code via Anthropic API defaults to no training on inputs; HIPAA requires a signed BAA on a HIPAA-enabled org. Cursor adds a second sub-processor and ships privacy mode opt-in for Pro, default-on for Business.
For my own workload, Claude Code is the tool I keep on Max 20x and run all day. For a team shipping a Next.js product with mixed seniority, Cursor is the right call.
Side-by-side: what actually matters
| Dimension | Claude Code | Cursor |
|---|---|---|
| Surface | CLI + IDE extensions (VS Code, JetBrains) + web app at claude.ai/code | AI-first IDE forked from VS Code |
| Default model | Account-dependent per docs.anthropic.com/en/docs/claude-code/model-config (verified 2026-04-28). The active default varies by plan, and /model aliases (/model sonnet, /model opus, /model default) switch the active session within whatever the account is entitled to. Re-check the docs on plan upgrade rather than assuming a slug. | Multi-model: Claude, GPT, Gemini routed by Cursor, with the active model selectable per request |
| Persistent context | CLAUDE.md (global + per-project), skills, hooks, /memory | .cursor/rules Project Rules (per-project, scoped, version-controlled), User Rules (global), and @-mentions for ad-hoc context. Legacy .cursorrules files still load but Cursor's docs flag them as superseded. |
| Plugin model | Skills (markdown with YAML frontmatter), hooks (shell scripts with blocking exit codes), MCP servers, sub-agents via Task tool | VS Code-compatible extensions, plus Cursor-native MCPs, skills, hooks, and plugins via the Cursor marketplace. Claude Code skills are plain markdown in ~/.claude/skills/ that survive a tool switch as plaintext runbooks; Cursor's marketplace assets are tied to the IDE install flow. |
| Agent mode | Built-in, terminal-native, runs tools and shell, spawns sub-agents | Composer / Agent mode in IDE for multi-file edits, plus Background Agents for remote sandboxed runs |
| Pricing entry | $20/mo Pro, $100/mo Max 5x, $200/mo Max 20x (anthropic.com/pricing, verified 2026-04-28) | $20/mo Pro, $60/mo Pro+, $200/mo Ultra, $40/user/mo Teams, custom Enterprise (cursor.com/en-US/pricing, verified 2026-04-28) |
| Best for | Agent infra, CLI tools, backend services, codebases with strong existing conventions | Frontend, full-stack apps, teams new to AI-assisted dev |
Lock-in rubric. Score against five dimensions: artifact portability (does configuration leave as plain files), workflow portability (do daily habits survive the switch), server-side state (vendor-held context the operator cannot extract), extension API portability (do plugins/hooks/skills run elsewhere unchanged), and migration work.
| Dimension | Claude Code | Cursor |
|---|---|---|
| Artifact portability | High. Skills are markdown with YAML frontmatter, hooks are shell scripts, CLAUDE.md is plain text. | Medium. Project Rules under .cursor/rules/*.mdc are plain text; Composer history and marketplace install state are not. |
| Workflow portability | High. Driven from a CLI any operator can script around. | Medium. Tab + Composer muscle memory has no equivalent outside the Cursor IDE. The Cursor CLI (docs.cursor.com/en/cli/using, verified 2026-04-28) closes part of this gap. |
| Server-side state | Low. Context is local files plus whatever the API call carries. | Medium. Cursor stores Composer threads and indexed repo state in their infrastructure (docs.cursor.com/account/privacy, verified 2026-04-28). |
| Extension API portability | High for skills, medium for hooks (PreToolUse / Stop event semantics are Claude Code specific). | Low to medium. Hook event names like beforeShellExecution and afterFileEdit (docs.cursor.com/en/agent/hooks, verified 2026-04-28) are Cursor specific. |
| Migration work | Roughly half a day to relocate skills, hooks, and CLAUDE.md into a different harness. | Roughly two to three days to rebuild Composer-flavored multi-file edit habits and re-establish marketplace plugins. |
Net: artifact-level lock-in is similar; workflow and extension-API lock-in is meaningfully heavier on the Cursor side because the IDE is the runtime.
Pricing reality (and the gotchas)
Both vendors price entry at $20/mo. That's where the simple comparison ends.
Claude Code (verified 2026-04-28):
- Pro $20/mo. The active default model and any extended-context eligibility are account-dependent per the model-config docs. In my anecdotal workload (~200K LOC TypeScript, 60-80 prompts/day, 40K-80K context per turn, heavy Task-tool sub-agent fanout), Pro-tier limits surfaced rate-limit events within a half-day and forced me up the ladder.
- Max 5x at $100/mo. Carried roughly a full day of active agent work before hitting limits, with
/model sonnetswaps used for cheaper passes through generation-heavy loops. - Max 20x at $200/mo. What I actually pay. On heavier days, the only tier where I stop watching the rate-limit meter.
- Model selection.
/modelaliases route to whatever models the account is entitled to. The cheaper Sonnet-heavy mix is available inside the subscription via/model sonnet. Defaults change; re-check on plan upgrade. - API pay-as-you-go. For sustained 8-hour days, API billing has consistently run higher than Max 20x in my logs. For occasional bursts, lower.
Cursor (verified 2026-04-28):
- Hobby is the free tier with limited agent requests and Tab completions.
- Pro at $20/mo ships with included model usage at the standard rate, then on-demand usage once consumed.
- Pro+ at $60/mo advertises 3x the model usage of Pro.
- Ultra at $200/mo advertises 20x the model usage of Pro.
- Teams at $40/mo per active user adds centralized billing, privacy mode default-on, and admin controls. Billed per active user, not per provisioned seat.
The hidden costs nobody mentions:
- Cursor's included-usage pool resets monthly but the IDE does not surface burn-rate trajectory the way a per-request CLI does. Set a hard usage cap in the dashboard on day one. Cautionary tale, not benchmark data: in Q1 2026, two engineers in my network on Pro with on-demand left enabled and no cap configured ran heavy multi-week Composer sessions and reported invoices in the low four figures each.
- On Claude Code, cheaper Sonnet-heavy usage requires explicit
/model sonnetselection per session. Set the alias deliberately rather than assume which model is in play. - Both tools charge per active user, not per repo. A team of 8 on Cursor Pro+ is $480/mo before on-demand usage; 8 on Claude Code Max 5x is $800/mo. That's the breakpoint where teams start asking whether per-developer subscriptions still make sense versus a centralized API gateway with per-engineer attribution.
Where Claude Code wins
Agent infrastructure work. Building MCP servers, orchestration code, hook handlers, skill plugins. Claude Code is itself an agent, and the surfaces I use to drive it (skills, hooks, CLAUDE.md, /memory, sub-agents via the Task tool) overlap in shape with the abstractions I'm building in production: skills look like the prompt+tool bundles I ship as agent routines, hooks look like the gating middleware I wrap around tool calls, MCP servers are literally the same protocol on both sides. Useful as a development environment whose primitives rhyme with the runtime, not as a stand-in for the runtime.
Long-running multi-step tasks, with caveats. Claude Code's Task tool spawns sub-agents that run in parallel. Cursor ships Background Agents that run in a remote sandbox against a branch (docs.cursor.com/background-agents, verified 2026-04-28). PR creation is configuration-dependent: the launch API exposes autoCreatePr defaulting to false. The shapes differ. Claude Code sub-agents run locally in my shell, inherit my env and credentials, and obey my hooks, so a Stop hook can refuse to end the session if pnpm typecheck fails. Cursor Background Agents run on AWS-hosted VMs in Cursor's infrastructure with internet access enabled by default and the GitHub app granted read/write. Fine for "kick it off from my phone and review the branch later" and worse if the work needs local-only secrets, custom toolchains, or strict no-egress. Anecdotally, my heaviest Claude Code overnight session this quarter touched 23 files across an MCP server refactor and left a dirty worktree I had to triage in the morning. Roughly one in three of those long runs needs human cleanup before merge, so treat the "go away for an hour" affordance as a force multiplier, not autopilot.
Codebases with strong conventions. I keep a 4KB CLAUDE.md per project that encodes "we use Drizzle not Prisma," "tests live in __tests__ not adjacent," "never delete migration files." Every conversation starts pre-loaded. Cursor's current rules surface (Project Rules under .cursor/rules/*.mdc, User Rules in settings, AGENTS.md support per docs.cursor.com/en/context/rules, verified 2026-04-28) covers the same conventions-encoding job, and the Cursor CLI loads both CLAUDE.md and AGENTS.md directly. The remaining edge for me is that /memory plus skills give that context an invocation surface (a skill can spawn sub-agents and chain tool calls), not just a passive prompt prefix.
Terminal-resident workflows. For operators living in tmux + zsh + neovim, the Cursor IDE is a regression, but the Cursor CLI is not. The Cursor CLI documents agent, rules, MCP, review, resume, and non-interactive modes (docs.cursor.com/en/cli/using, verified 2026-04-28). Honest framing: Cursor IDE versus Claude Code CLI is the regression; Cursor CLI versus Claude Code CLI is closer to parity, with Claude Code still pulling ahead on the depth of skills, sub-agent dispatch via the Task tool, and the Stop / SubagentStop blocking hooks I rely on.
Skills, plugins, and the portability gap. Cursor now ships hooks (docs.cursor.com/en/agent/hooks) and an MCP surface (docs.cursor.com/en/context/mcp, both verified 2026-04-28). On 2026-04-28 I installed one MCP server and one hook on the Cursor side, one skill plus one hook on the Claude Code side, and ran the same agent task through both. Both surfaces are real. The real difference is portability and packaging. Claude Code skills are plain markdown sitting in ~/.claude/skills/ or a plugin repo, invoked by name from any conversation, trivially diffable in Git. They survive the tool. Cursor's hooks and rules transfer as text, but the runtime that consumes them and the IDE-mediated install flow do not. Invocation depth also still differs in my testing: Claude Code skills can spawn sub-agents, gate tool calls via hooks, and chain into other skills inside one turn; the Cursor hook events I exercised ran closer to scoped tool extensions than to full agent routines.
Where Cursor wins
Frontend and full-stack feature work. Tab completion in Cursor on TSX is genuinely better than anything I've used. The Composer can take a Figma screenshot and produce a working React component in one shot, with the imports right and the Tailwind classes vaguely matching the design system. Claude Code can do this through the CLI but the round-trip feel makes it slower for IDE-resident work.
Teams of mixed seniority. A junior engineer can be productive in Cursor on day one. Claude Code has a learning curve: skills, hooks, CLAUDE.md, and the Task tool to extract its full value. For a team where some folks just want "AI in my IDE," Cursor is the lower-friction default.
Inline review of agent edits. Cursor's diff UI for proposed multi-file edits is better than Claude Code's terminal diff. Reviewing 12 files of changes before accepting, syntax-highlighted side-by-side diffs in the IDE is real value.
More model providers natively. Cursor routes across Claude, GPT, and Gemini transparently. Faster than setting up your own gateway for A/B comparisons. Claude Code is Claude-only.
Onboarding speed. Install Cursor, import VS Code settings, productive in 10 minutes. Claude Code productivity tracks with how much CLAUDE.md, skill curation, and hook setup has been done.
Where neither wins
If your daily work is heavy refactors of large legacy codebases (>500K LOC, weakly-typed languages, tangled dependencies), neither tool is great alone. The model loses thread on cross-file invariants and both will confidently produce edits that compile but break runtime invariants three modules away. For this case:
- Aider for Git-native editing with strong repo-map awareness. Better than both for surgical edits in legacy codebases, in my experience.
- Sourcegraph Cody if you're already on Sourcegraph for code search.
I keep Aider installed alongside Claude Code for exactly this reason. Right tool per task, not per career.
Things nobody talks about
1. Cursor's privacy mode is opt-in for Pro, default-on for Business. Cursor docs on privacy mode (verified 2026-04-28) state that with privacy mode disabled, prompts and code may be retained for product improvement. A solo Pro user who forgot to flip the toggle has code sitting in their retention scope. Claude Code via Anthropic API defaults to no training on API inputs (anthropic.com/legal/commercial-terms, verified 2026-04-28), a meaningfully different default posture.
2. "Self-hosted" or "on-prem" is a near-impossibility for both. Both products send prompts and code to a model provider as a sub-processor. Phrases like "your code stays private" mean "we don't retain it," not "it doesn't leave your network." Per Anthropic's API and data retention docs and the HIPAA help article (both verified 2026-04-28), HIPAA-ready use of the Anthropic API requires a signed BAA between the covered entity and Anthropic, scoped to a HIPAA-enabled organization, with PHI traffic routed through that organization's API keys. Zero Data Retention is a separately negotiated configuration. Certain features (Files API, prompt caching, batches) interact with retention differently and may be excluded from a given BAA's scope. Cursor adds a second sub-processor on top of the model provider; confirm their current BAA scope, ZDR availability, and any excluded features against their security page before routing PHI through them.
3. Lock-in is asymmetric. Claude Code skills and hooks are plain markdown and shell scripts. Switching off Claude Code tomorrow leaves the skills as readable runbooks and the hooks as files callable from a Makefile. Cursor's Composer history, accepted-edit telemetry, and Tab patterns are not portable. Switching costs are higher in Cursor than the surface marketing suggests.
4. Hooks are a security surface, not a free lunch. Anthropic's hooks guide (verified 2026-04-28) warns that hooks execute arbitrary shell commands automatically with the local user's full environment, credentials, and filesystem access. Operational consequences I have actually run into: a hook that pipes prompt content to an external endpoint for "logging" is a credential and source-code exfiltration vector; a hook shelling out to a tool that reads ~/.zshenv will inherit production keys that should never have been on a dev box; a Stop hook with no timeout that wedges on a hung subprocess will block the session indefinitely; a PreToolUse hook returning exit code 2 on a flaky condition will silently refuse legitimate work. Concrete posture: every hook reviewed line by line before install, hooks calling external services forbidden, every blocking hook gets an explicit timeout (timeout 30 pnpm typecheck rather than bare pnpm typecheck), and the hook directory lives in a Git repo with signed commits. Cursor hooks carry the same risk shape and deserve the same review bar.
5. Hooks now exist on both sides, but the event models diverge.
| Event | Claude Code | Cursor |
|---|---|---|
| Before tool call | PreToolUse (can block) | beforeShellExecution / beforeMCPExecution (can block via JSON permission: deny) |
| After tool call | PostToolUse (observe) | afterFileEdit (observe) |
| Before submit / read | UserPromptSubmit | beforeReadFile, beforeSubmitPrompt |
| Session end | Stop, SubagentStop (can block exit) | No documented direct equivalent for blocking session-end |
| Runs as | Shell process invoked by the CLI, blocking exit code 2 | Hook script invoked by the IDE, JSON permission response |
Where Claude Code still pulls ahead is the Stop / SubagentStop pair: my Stop hook runs timeout 60 pnpm typecheck and timeout 120 pnpm test:fast and refuses to let the session end if either fails, which catches "the model said it's done but actually broke the typecheck" cleanly. The closest Cursor analogue is a beforeSubmitPrompt check or external CI gate, neither of which is session-terminating.
6. The "$20/mo" headline is misleading for both. Power-user reality: $100 to $200/mo on Claude Code Max, or $20 to $100/mo on Cursor Pro depending on usage burn. Neither tool's sticker price reflects what serious daily use costs. Budget accordingly when proposing this internally.
Decision tree
Q: Are you building agent infrastructure (orchestration, MCP servers, agent skills, observability plumbing)? → Claude Code. The tool's mental model matches your work.
Q: Is your daily work primarily React, Next.js, or other frontend-heavy TypeScript? → Cursor. Tab completion and Composer in the IDE outpace the CLI loop for this work.
Q: Do you need session-persistent context that survives across days, weeks, and team members?
→ Lean Claude Code, but the gap is narrower than it used to be. Cursor's Project Rules cover the same ground as CLAUDE.md for codifying conventions, and the Cursor CLI loads both files directly. The remaining edge for Claude Code is that /memory plus skills give session-persistent context an invocation surface, not just a passive prompt prefix.
Q: Is your team mixed-seniority, with engineers who want "AI in my IDE" not "a CLI to learn"? → Cursor. Lower onboarding friction wins.
Q: Are you under HIPAA, FedRAMP, or other strict data-handling regulations? → Claude Code via Anthropic API with a signed BAA. Cursor adds a sub-processor in the data path; verify their current posture before assuming coverage.
Verdict
If I'm being honest about my own usage in 2026, Claude Code is on Max 20x and runs all day, every day. Cursor is installed but I open it maybe twice a week for frontend work where Composer pulls its weight. Time-weighted split is roughly 85/15 toward Claude Code.
For an engineer doing what I do (building agent systems, infrastructure code, MCP servers, content pipelines, internal tooling), Claude Code wins by a margin that's not close. The skills + hooks + CLAUDE.md + Task tool combination is a productivity unlock that nothing else matches.
For an engineer doing primarily frontend or full-stack feature work, Cursor wins for IDE-resident speed. The Composer + Tab combination is genuinely better than the CLI loop for that work.
The case where I'd reverse my recommendation: a small team shipping a product where 80% of the code is a Next.js app, the team wants AI assist without learning a new mental model, and they value an IDE that "just works" over the deepest possible agent integration. For that team, Cursor is the right call and Claude Code's surface area is overkill.
If you want to test both: Claude Code is included with Claude Pro at $20/mo (affiliate link, see disclosure above), and Cursor offers a free tier with limited credits (affiliate link, see disclosure above). A week of real work in each will make the answer for your specific stack obvious by Friday.
Companion code I use in both tools (skills, hooks, MCP server scaffolds, CLAUDE.md templates) lives at github.com/MPIsaac-Per/agentinfra-examples.