| Cursor CLI | Claude Code | |
|---|---|---|
| Terminal command | agent | claude |
| Non-interactive runs | agent -p for scripts and CI | claude -p for scripts and CI |
| MCP servers | mcp.json, shared with the Cursor editor | Local, project (.mcp.json) or user servers |
| Project instructions | .cursor/rules, AGENTS.md and CLAUDE.md | CLAUDE.md, or AGENTS.md when there is no CLAUDE.md |
| Git worktrees | agent --worktree [name] | claude --worktree [name] |
| Hand off to the cloud | & prefix for a Cursor Cloud Agent | claude --cloud for cloud tasks |
Pick Cursor CLI to reuse the Cursor editor’s MCP configuration in the terminal. Pick Claude Code for its GitLab CI/CD integration, which GitLab maintains.
The commands and project rules differ
Cursor CLI runs as agent to write, review and modify code from the terminal. Claude Code runs as claude to read your codebase, edit files and run commands.
Cursor CLI applies .cursor/rules and reads AGENTS.md and CLAUDE.md at the project root. Claude Code reads CLAUDE.md at the start of each session, or AGENTS.md in its place when the repo has no CLAUDE.md.
Both run non-interactively in CI
Cursor CLI uses agent -p or agent --print for scripts and CI pipelines. Add --force to edit files instead of only proposing changes.
Cursor CLI authenticates scripts through CURSOR_API_KEY in the environment. Its --output-format accepts text, json or stream-json. Its docs include a GitHub Actions setup.
Claude Code uses claude -p for scripts and CI. It also has a GitHub Actions integration, and a GitLab CI/CD integration that GitLab maintains.
Both create worktrees for isolated sessions
Cursor CLI’s agent --worktree [name], or -w, runs the agent in a new git worktree.
Claude Code’s claude --worktree <name>, or -w, creates a worktree under .claude/worktrees/<name>/ on the branch worktree-<name>. You can start a second isolated session from another terminal.
Claude Code also supports subagents with their own context windows inside a session. Its experimental agent teams coordinate several sessions from a lead. Background agents run several full sessions you watch from one screen.
Cloud handoffs use different commands
In Cursor CLI, prefixing a message with & sends the conversation to a Cursor Cloud Agent. It keeps running while you are away. You pick it up at cursor.com/agents.
Claude Code uses claude --cloud to start a task in the cloud. Its claude --teleport command pulls a web session into the terminal.
Several agents can pull from one Retasc queue
Rate limits, closed laptops and stalled sessions stop your agents. Retasc is a work queue for AI coding agents that both Cursor CLI and Claude Code pull from over MCP.
A claim is one server transaction. Two agents can never hold the same issue. An agent calls next_issue to claim the highest effective-priority issue that is unblocked and unclaimed.
Run npx @retasc/cli@latest bind in the folder you want to connect. Setup wires each of the two it finds on the machine.
For Cursor CLI, setup writes the Retasc server into ~/.cursor/mcp.json. For Claude Code, it registers the server with claude mcp add.
Start or restart the agent in that folder afterward.
Questions about Cursor CLI and Claude Code
Is Cursor CLI the same as Cursor agent?
agent is the Cursor CLI command. It runs from your terminal to write, review and modify code.
Can Cursor CLI and Claude Code use the same MCP servers?
Cursor CLI uses mcp.json over stdio, HTTP or SSE, while Claude Code uses claude mcp add --transport http or .mcp.json. Both can connect to the same remote HTTP MCP server through their own configurations. Retasc’s setup writes the server into ~/.cursor/mcp.json for Cursor and registers it with claude mcp add for Claude Code.
Can Cursor CLI and Claude Code run in CI?
Both Cursor CLI and Claude Code run non-interactively in CI. Cursor CLI uses agent -p with CURSOR_API_KEY for script authentication. Claude Code uses claude -p.
Can Cursor CLI and Claude Code work on the same repo at the same time?
Both can run in separate git worktrees for isolated sessions on the same repo. Both can pull work from the same Retasc queue over MCP. In that queue, two agents can never hold the same issue.
Run the command below in your folder. Then start or restart your agents there. You get $10 of usage at signup, no card.