← Blog

How to Integrate Claude Code Into Cursor

2026-09-09 · 5 min read · SubToAPI Team

Cursor and Claude Code solve different parts of the same problem. Cursor is an editor built around inline AI editing, chat, and multi-file composer. Claude Code is Anthropic's agentic CLI tool that plans, edits, runs commands, and iterates on a codebase autonomously from a terminal. Integrating them means using Claude Code's agentic loop inside Cursor's workspace, so you get Cursor's editor experience plus Claude Code's ability to execute multi-step tasks without you babysitting every diff.

There is no plugin marketplace install for this — the integration happens at the terminal level, plus (optionally) at the API level if you want your own Claude calls available to scripts and extensions you build inside Cursor. Below are the three practical ways to make that happen.

Method 1: Run Claude Code in Cursor's Integrated Terminal

This is the simplest and most reliable approach, because Cursor ships a full terminal panel that behaves like any shell.

  1. Install Claude Code globally:

``bash npm install -g @anthropic-ai/claude-code ``

  1. Open Cursor, then open the integrated terminal with ` Ctrl+ ` (or Cmd+ ` on macOS).
  2. cd into your project root — Cursor's terminal already starts there by default.
  3. Run:

``bash claude ``

  1. Authenticate once when prompted. After that, Claude Code has full read/write access to the same file tree Cursor has open, so edits made by Claude Code show up live in Cursor's editor tabs and diff view.

This setup gives you two AI workflows side by side: Cursor's Cmd+K / Composer for quick, editor-native changes, and Claude Code in the terminal for longer autonomous tasks — refactors, test-writing, dependency upgrades, or multi-file features you'd rather describe once and let run.

Practical tip: keep Claude Code's terminal pinned in a split pane rather than a full-screen terminal tab. That way you can watch file changes appear in Cursor's editor in real time and interrupt (Ctrl+C) if it heads in the wrong direction.

Method 2: Use Cursor's Task/Composer Panels Alongside Claude Code

If you want Claude Code to trigger a task and then hand off to Cursor for review, structure your workflow like this:

This division of labor matters in practice: Claude Code is strong at multi-step execution but you still want a fast, precise editor for the last-mile polish. Cursor is that editor.

Method 3: Wire Up Your Own Claude API Calls From Inside Cursor

Some teams don't just want Claude Code as a CLI agent — they're building features on top of Claude inside their own app, and want to test those API calls without leaving the editor. If you already pay for Claude and don't want a second Anthropic API bill on top of it, SubToAPI turns your existing Claude access into a standard HTTPS API you can call from any script, extension, or terminal command inside Cursor.

After signing up at /signup, you get an application key in the format sub_live_... from your dashboard. Calling it looks like a normal Messages API request:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Summarize the changes in this diff."}
    ]
  }'

You can run this directly from Cursor's terminal, wrap it in a small script bound to a Cursor task, or call it from a Node script you're writing in the same window:

const res = await fetch("https://api.subtoapi.app/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "claude-sonnet-4",
    max_tokens: 512,
    messages: [{ role: "user", content: "Write a commit message for these changes." }]
  })
});

This is useful for anyone prototyping Claude-powered features — a code-review bot, a documentation generator, an internal tool — right inside the same editor session where they're writing the rest of the app. Streaming responses, tool use, and usage metadata are all supported; see /docs/messages, /docs/streaming, and /docs/tools for the request formats. Teams sharing one Claude subscription across multiple developers can also issue separate keys per seat instead of sharing a single credential, which keeps usage attributable per person — see /pricing for the Team and Scale tiers.

Putting It Together

A workable daily setup looks like this:

None of these require a special plugin or extension — it's a terminal, an editor, and an API key, combined deliberately.

FAQ

Is there an official Cursor extension for Claude Code? No. Claude Code is a standalone CLI tool. You run it in Cursor's built-in terminal, which gives it full access to your open project — there's nothing to install inside Cursor itself.

Can I use Claude Code and Cursor's own AI chat at the same time? Yes. They don't conflict. Many developers use Claude Code for larger autonomous tasks and Cursor's inline chat/Composer for quick, targeted edits within the same session.

Do I need a separate Anthropic API key to script against Claude from Cursor? Not necessarily. If you already have Claude access and want a straightforward HTTPS endpoint for scripts or internal tools, a service like SubToAPI issues you an API key without a separate Anthropic billing setup — see /docs/quickstart to get started.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →