cursor-agent

A command-line coding agent from the Cursor editor that works inside a specified project folder and follows that project's Cursor rules. It can be called by another coding tool in a non-interactive mode that reports progress as structured data.

In plain words
What is it for?
Use it for repository-aware coding tasks in projects with .cursor/rules, including making edits through Cursor's command-line agent mode.
Why use it?
It lets an automated coding workflow use Cursor's project context and configuration without requiring the editor's interactive interface. It requires Cursor to be installed and the user to be authenticated.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/markus-global/markus/cursor-agent
Any agent
npx skills add markus-global/markus --skill cursor-agent
Clone the repo
git clone --depth 1 https://github.com/markus-global/markus

Made for: Claude Code, Codex.

Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,355 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.02355
Opus 5 $0.00010 $0.01177
Sonnet 5 $0.00004 $0.00471
Haiku 4.5 $0.00002 $0.00235

Measured 2d ago against content hash 54becb4dedb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursor-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/cursor-agent/SKILL.md · 263 lines

How it starts

The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Agent

Cursor Agent (cursor binary) runs the Cursor IDE's agent mode from the command line. Markus invokes it via invoke_coding_tool({ tool: "cursor-agent", ... }). Use it when the project has Cursor-specific configuration (.cursor/rules) or when IDE-integrated, project-aware editing is the best fit.

Installation

Install Cursor from https://cursor.sh, then enable the shell command:

  1. Open Cursor → Command Palette → "Install 'cursor' command in PATH"
  2. Verify: cursor --version

Check availability with markus doctor. Requires authentication via cursor agent login (browser-based) or CURSOR_API_KEY env var.

How Markus Invokes Cursor Agent

Markus runs Cursor in CLI agent mode:

cursor agent --print --output-format stream-json --workspace <workdir> --trust --force "<prompt>"
Flag Purpose
--print Non-interactive mode
--output-format stream-json Emits structured JSON events for progress parsing
--workspace <workdir> Specifies the repo root for project context
--trust --force Auto-trusts the workspace without interactive prompts

Additional args can be configured via CodingToolConfig.defaultArgs.

.cursor/rules Context Files

Cursor projects use .cursor/rules/ for persistent agent instructions. Rule files (.mdc or .md) define:

  • Coding standards and naming conventions
  • Architecture decisions and patterns to follow
  • Test requirements and deployment procedures
  • Files or areas agents should not modify

Cursor Agent reads these rules automatically when operating in a project directory. Well-maintained rules significantly improve output quality.

Markus Task Context Injection

When you pass task_id to invoke_coding_tool, Markus writes task-specific context to:

.cursor/rules/markus-task.mdc

This file contains the full Markus task context (title, description, subtasks, dependencies, progress-reporting CLI commands). It sits alongside your project's permanent rules and takes effect for the coding session.

Read the full file on GitHub · 263 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 263 lines · 21 tokens per session scan A 54becb4dedb5

Subscribe to this mod's changes

cursor-agent is a skill published in the GitHub repository markus-global/markus (157 stars, last pushed 5d ago), licensed Apache-2.0. It adds 21 tokens to every session and 2,355 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.