$ man how-to/claude-code-inside-cursor

CLI Toolsintermediate

Claude Code Inside Cursor

Run Claude Code as a terminal agent inside your IDE


Why Run Claude Code Inside Cursor

Cursor has its own AI agent. Claude Code is a separate AI agent. Running Claude Code inside the Cursor terminal gives you both. The Cursor agent handles inline edits, chat-based file changes, and visual diffs. Claude Code in the terminal handles repo-wide tasks, complex multi-file operations, and workflows that need the CLI. You pick the right tool for the task. Simple inline edit? Cmd+K in Cursor. Build a new feature across 5 files? Claude Code in the terminal. The terminal is already there in Cursor. You are just running a different agent in it.
CODE

Setup

If Claude Code is already installed globally (npm install -g @anthropic-ai/claude-code), it works inside the Cursor terminal immediately. Open a terminal in Cursor (Ctrl+` or Terminal > New Terminal). Type claude. You are now running Claude Code inside Cursor. Your CLAUDE.md file applies to both agents. The Cursor agent reads it. Claude Code reads it. Rules files in .cursor/rules/ only apply to the Cursor agent. Skills in .cursor/skills/ apply to the Cursor agent. Claude Code has its own skill and rule system. Keep this separation in mind when configuring. Pro tip: open a split terminal. One pane for Claude Code, one for manual commands. You can run Claude Code on a complex task in one pane while running git status or checking logs in the other.
PATTERN

When to Use Which Agent

Use the Cursor agent (Cmd+L chat) for tasks scoped to one or a few files. Editing a component, fixing a bug in a specific function, refactoring a single module. The visual diff makes reviewing easy. Use Claude Code (terminal) for tasks that span the whole repo. Building a new feature that creates multiple files. Running a workflow that involves git operations, API calls, and file generation. Anything where the terminal output matters. Use both in parallel for maximum speed. The Cursor agent edits the frontend while Claude Code in the terminal handles the data layer. They do not conflict because they work on different files. This is the poor man's parallel agent setup. Two agents, one IDE, different scopes.
PRO TIP

The Cron Job Stability Model

Claude Code is more stable for long-running, multi-step tasks than IDE chat. The Cursor agent works within the editor's lifecycle. If the editor refreshes, the context can shift. Claude Code in the terminal maintains a persistent session. It does not lose context mid-task. This makes Claude Code ideal for tasks that feel like cron jobs: sequential, multi-step workflows that need to run to completion without interruption. Deploy scripts, data migrations, bulk file operations, campaign setup workflows. If the task has more than 5 steps and you do not want to babysit it, run it in Claude Code, not the IDE agent.

knowledge guide
See "Cursor" in Knowledge See "Claude" in Knowledge See "Agent" in Knowledge

related guides
Claude Code QuickstartGetting Started with CursorRules, Skills, and Context Files
← how-to wikiknowledge guide →
ShawnOS.ai|theGTMOS.ai|theContentOS.ai
built with Next.js · Tailwind · Claude · Remotion