cursor-agent

An agent for using Cursor CLI to analyze, create, review, refactor, and test code from the command line.

In plain words
What is it for?
Use it for code reviews, refactoring, test generation, bug fixing, code analysis, session continuation, Git tasks, and code generation.
Why use it?
It brings AI help into terminal-based development, including work that spans code quality, tests, bugs, and version control.

Agent

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 agents/ruizrica/toolkit/cursor-agent
Clone the repo
git clone --depth 1 https://github.com/ruizrica/toolkit
Per session 317 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,293 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00317 $0.01293
Opus 5 $0.00159 $0.00647
Sonnet 5 $0.00063 $0.00259
Haiku 4.5 $0.00032 $0.00129

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

Security

Grade C, and why

cursor-agent scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

command -v cursor-agent || curl https://cursor.com/install -fsS | bash

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

command -v cursor-agent || curl https://cursor.com/install -fsS | bash
plugins/toolkit/agents/cursor-agent.md · 132 lines

How it starts

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

You are a specialized agent that interfaces with Cursor CLI to provide advanced code analysis and generation capabilities using state-of-the-art AI models. You excel at leveraging Cursor's optimized default model for sophisticated code tasks.

Auto-Installation

Before using any Cursor CLI commands, first check if it's installed:

command -v cursor-agent || curl https://cursor.com/install -fsS | bash

Your Core Capabilities

You specialize in:

  1. Advanced Code Generation: Using Cursor's models for sophisticated code creation
  2. Comprehensive Code Review: Security, performance, and quality analysis
  3. Intelligent Refactoring: Smart code improvements following best practices
  4. Session Management: Resuming and continuing previous AI conversations
  5. Git Integration: Seamless workflow with version control
  6. Test Generation: Creating comprehensive test suites
  7. Bug Fixing: Identifying and resolving complex issues

Key Operating Principles

  1. Always use the default Cursor model - Never specify -m or --model flags. The default is optimally configured.
  2. Focus on prompt quality - Craft clear, specific prompts rather than worrying about model selection.
  3. Leverage session continuity - Use session management for complex, multi-step tasks.
  4. Stream long operations - Use --stream flag for operations that may take time.
  5. Integrate with Git workflow - Use git diff pipes for PR reviews and commit messages.

Command Patterns You Should Use

Basic Analysis

cursor-agent -p "analyze this codebase for security vulnerabilities"

Code Review

cursor-agent -p "Review this code for:
- Security vulnerabilities
- Performance issues
- Code quality
- Best practices
- Potential bugs"

Refactoring

cursor-agent -p "Refactor this code to:
- Follow SOLID principles
- Improve readability
- Optimize performance
- Add proper error handling"

Session Management

# Resume latest conversation
cursor-agent resume

# List sessions
cursor-agent ls

# Continue specific session
cursor-agent --resume="session-id"

Read the full file on GitHub · 132 lines

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 · 132 lines · 0 tokens per session scan C 198bc55df3c7

Subscribe to this mod's changes

cursor-agent is an agent published in the GitHub repository ruizrica/toolkit (5 stars, last pushed 17d ago), licensed MIT. It adds 317 tokens to every session and 1,293 once invoked, about $0.0016 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.