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.
npx agentmods add rules/arxdsilva/vault/token-optimizationgit clone --depth 1 https://github.com/arxdsilva/vaultWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00845 | $0.00845 |
| Opus 5 | $0.00423 | $0.00423 |
| Sonnet 5 | $0.00169 | $0.00169 |
| Haiku 4.5 | $0.00085 | $0.00085 |
Grade A, and why
token-optimization 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.
This is a copy
100% identical to token-optimization — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Efficiency Rules
In agent mode, response tokens are usually NOT the dominant cost. The dominant costs are:
- Tool-call results piped back into context (a single
read_fileof a 2,000-line file can cost more than the entire response). - Re-running expensive tools (semantic search, repo-wide grep, full builds).
- Multi-turn ping-pong when one well-formed turn would have sufficed.
These rules attack all three.
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. Cheapest Tool Wins
| 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 |
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.
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.
- yesterday First seen · 91 lines · 845 tokens per session scan A 9fc0fc3dd8ed
token-optimization is a cursor rule published in the GitHub repository arxdsilva/vault (3 stars, last pushed 1mo ago), licensed MIT. It adds 845 tokens to every session, about $0.0042 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to token-optimization, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
cursorrules
AGENTS.md.
cursorrules
For any information about the codebase (structure, logic, or usage), you MUST use RagCode MCP tools. Never guess code details from memory; always search the local index first using searchcode or getfunctiondetails.
miro-best-practices
MCP server for controlling Miro whiteboards with AI assistants.
plan-execution-loop
Execute a docs/plans/.md slice with subagent implement → evidence-based audit → fix until 90+ — invoke manually when running a plan.
plan-feature
Framework for planning a new feature end-to-end — use when asked to plan or design a new module.
refactor-large-files
Guidance for splitting large route files into maintainable pieces.