agent-efficiency

A set of rules for making coding-agent work more efficient by limiting unnecessary searches, repeated commands, and oversized context. It recommends starting with the smallest check that can answer the question and widening the investigation only when needed.

In plain words
What is it for?
Use it to guide repository searches, targeted file reading, command execution, and evidence gathering during development tasks.
Why use it?
It helps reduce wasted tool calls and keeps the agent focused on the relevant files and symbols. This can make code changes faster and easier to review.

Cursor rule for Cursor

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 rules/inboxpraveen/minimize-cursor-cost/agent-efficiency
Clone the repo
git clone --depth 1 https://github.com/inboxpraveen/Minimize-Cursor-Cost

Made for: Cursor.

Per session 1,025 This file is loaded in full into every session.
When invoked 1,025 The same file — it is already loaded in full.
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.01025 $0.01025
Opus 5 $0.00513 $0.00513
Sonnet 5 $0.00205 $0.00205
Haiku 4.5 $0.00103 $0.00103

Measured yesterday against content hash fb2b2c7eabd3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-efficiency 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 yesterday.

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.

lean-cursor/.cursor/rules/agent-efficiency.mdc · 109 lines

How it starts

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

Agent Efficiency Rules

Tool results, repeated searches, and correction loops usually cost more than the final response. Gather the minimum evidence needed for a correct change.

1. Plan Before Acting

Before issuing tool calls, state internally (or briefly to user, max 1 line):

  • What file or symbol you're targeting
  • Which tool is the cheapest way to find it

Skip planning chatter for trivial tasks (one-line edits, single-file reads).

2. Elastic Evidence Budget

You need to… Use… Don't use…
Find an exact symbol or string grep / ripgrep Semantic search, full file reads
Locate a file by name pattern glob find recursive shell, listing all
Understand "how does X work" Semantic search, then targeted read Reading 10 files speculatively
Read a known function in a known file Targeted read (offset/limit) Full-file read on a 1k-line file
Check a single command's output Run it once Run it, then --help, then again

Use this evidence ladder:

  1. Use context already supplied.
  2. Run one exact symbol, path, or error search.
  3. Read only the matching function or ±20 lines.
  4. Widen one step only when current evidence is insufficient or contradictory.

If two widened searches produce no new evidence, stop and ask one focused question or report the blocker. Do not keep exploring by habit.

3. Batch Independent Calls

If two reads/searches don't depend on each other, fire them in the same message. Serial chains of independent calls double latency and inflate context-handoff tokens.

4. Don't Re-Read

  • A file read in this session stays read. Refer back to it from memory.
  • A directory listed once stays listed.
  • If you genuinely think the file changed (e.g., you just edited it and need to verify), re-read only the changed range.

Read the full file on GitHub · 109 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. yesterday First seen · 109 lines · 1,025 tokens per session scan A fb2b2c7eabd3

Subscribe to this mod's changes

agent-efficiency is a cursor rule published in the GitHub repository inboxpraveen/Minimize-Cursor-Cost (6 stars, last pushed 16d ago), licensed Apache-2.0. It adds 1,025 tokens to every session, about $0.0051 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-31.