Cursor Agent
Delegate a task to Cursor's headless CLI agent (
). Use this to get a second opinion from a non-Claude model on code reviews, plan critiques, text/copy review, or general Q&A.
Inputs
- : The task to hand to cursor-agent. Usually a review or question prompt. If the user adds a model hint (e.g. "with Opus", "using GPT", "pomocí Sonnetu"), extract it and pass via .
Goal
Run cursor-agent headless, surface its output to the user, and add a brief Claude TL;DR so the user doesn't have to re-read a wall of text.
Steps
1. Parse the task
Extract from
and the surrounding conversation:
- Model hint — look for phrasing like:
- "Opus" / "claude" →
--model claude-opus-4-7-medium
- "Sonnet" →
--model claude-4.6-sonnet-medium
- "GPT" / "GPT-5" / "Codex" →
- "Gemini" →
- "Auto" →
- Nothing mentioned → omit (cursor uses its default: )
- Mode hint:
- "plan" / "plan mode" / "navrhni" →
- "write" / "edit" / "implement" / "headless" → omit (cursor can write)
- Otherwise → (read-only, default)
- Is this a review? If the task mentions "review", "check", "verify", "second opinion", or references a branch/PR/diff, enrich the prompt (step 2).
Success criteria: Flags decided, prompt ready.
2. Enrich the prompt (reviews only)
If the task is a code review:
- Identify the diff scope. Try in order: explicit reference in the task (PR number, branch name), current branch vs (
git diff origin/main...HEAD
), or uncommitted changes ().
- Prepend a short instruction to the prompt so cursor-agent knows what to look at:
"Review the branch
against main. Use
git diff origin/main...HEAD
to see the actual changes. Focus on real issues (correctness, edge cases, security); skip nitpicks. Report under ~400 words with
references."
For non-review tasks (ask/plan/text/UI), pass the task as-is.
Success criteria: Final prompt string ready for the CLI.
3. Run cursor-agent
Invoke headless via Bash:
bash
cursor-agent -p --output-format text [--mode <mode>] [--model <model>] "<prompt>"
- Always use (print/headless).
- Always use unless the task needs structured output.
- Workspace defaults to pwd — don't pass unless the user explicitly asked for a different dir.
- For runs with only non-write modes ( or ), no extra permission flags are needed. For headless write mode, do not silently add or ; ask the user first.
- Pipe to if you suspect a very long response and want to cap context use. By default, take the full output.
Success criteria: cursor-agent returns (exit 0) with a response. If it errors (auth, model not available), surface the error to the user instead of hiding it.
4. Return the output
Present to the user in this order:
- Cursor's verbatim response — quote it directly so the user hears the other model's voice, including file:line references.
- Your short TL;DR — 3–6 bullets at most, separated by a horizontal rule. Highlight what's real vs. noise, and suggest concrete next actions. Do not silently filter cursor's findings; if you disagree with one, call it out explicitly.
Keep the summary tight — the goal is to save the user from re-reading, not to replace cursor's output.
Success criteria: User sees both cursor's raw output and a Claude-curated action list.
Notes
cursor-agent --list-models
shows every available model ID. If the user asks for something exotic (e.g. "thinking tier", "max tier"), check the list first.
- reads/writes inside the current workspace like any CLI tool — it is not sandboxed by default. Treat its output the same way you'd treat a teammate's PR comment: trust but verify.
- This skill is for one-shot delegation. For a longer back-and-forth, the user can run interactively themselves (no ).