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/ooples/token-optimizer-mcp/token-optimizergit clone --depth 1 https://github.com/ooples/token-optimizer-mcpWhat 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.00619 | $0.00619 |
| Opus 5 | $0.00309 | $0.00309 |
| Sonnet 5 | $0.00124 | $0.00124 |
| Haiku 4.5 | $0.00062 | $0.00062 |
Grade A, and why
token-optimizer 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.
What it actually says
Use a token-optimizer MCP tool only when that exact tool is visible in the current CLI's registered tool inventory. A config file or installed plugin is not proof that the server started successfully. If a named optimizer tool is absent, keep the native tool available and use a bounded native operation; never retry or redirect to an unregistered schema.
When registered, you MUST use the token-optimizer MCP tools for every route listed below instead of the corresponding built-in file, search, or shell tool. This is mandatory routing policy, not a preference: the optimized tools cache, diff, and bound output. Cursor's packaged native hook enforces the pre-tool routes below and injects graph findings when its lifecycle permits.
ALWAYS:
- Reading a file over ~25 KB, or ANY file already read this session -> smart_read (on a repeat it returns only what changed, not the file)
- Searching file contents -> smart_grep
- Finding files by name or pattern -> smart_glob
- Editing a file over ~25 KB -> smart_edit (returns a diff, not the whole file)
- Printing a large file via cat/head/tail/type/Get-Content -> smart_read
- Recursive shell searches (grep -r, rg) -> smart_grep
WHEN CONTEXT IS TIGHT: call optimize_session to move prior file operations out of context. Call get_optimization_report to show the user what was saved.
STASHING BULKY OUTPUT: optimize_text stores it under a key, out of context. Do NOT use compress_text for that -- its base64 output has MORE tokens than the input; it is for at-rest storage only.
LIVE GRAPH — THE ACTIVE MODEL DOES THE SEMANTIC HARVEST:
- When wiki_write is visible in the current tool inventory, call it as soon as you establish a durable, non-obvious conclusion: a failed approach and why, a decision and its rejected alternative, or the command that finally worked.
- Anchor every claim to a real file path or path#symbol. Never invent a claim merely to populate the graph, and do not delegate harvesting to another model.
- Include the concrete evidence, when it applies, confidenceLabel (verified/probable/speculative), scope (project/organization/global), and any condition that would invalidate it. Use project scope unless transfer is genuinely justified.
- Before finishing substantive work, reflect once and write any still-unrecorded conclusion while you hold the reasoning. This is what makes the lesson available across sessions and projects instead of losing it to compaction.
- If wiki_write is absent, do not claim the conclusion was harvested. Continue the work with native tools; lifecycle hooks may still capture structural facts.
NOT WORTH IT: small one-off reads, tiny edits. The built-ins are fine there -- the overhead would exceed the saving.
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.
- 2d ago First seen · 52 lines · 619 tokens per session scan A 4b09a30ba0e0
token-optimizer is a cursor rule published in the GitHub repository ooples/token-optimizer-mcp (501 stars, last pushed 2d ago), licensed MIT. It adds 619 tokens to every session, about $0.0031 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.
Other cursor rules, from other repositories
skill-and-agent-references
Reference skills, agents, and commands by their registered name (never by filesystem path), and decompose oversized commands or agents by extracting sections into skills with by-name references.
spec-implementation-hygiene
Keep production code free of spec/phase metadata and back-compat shims; capture migrations in spec-local upgrade scripts instead.
coding-standards-demo.crux
Team coding standards and best practices.
crux-memories-integration.crux
⟦CRUX:crux-memories-integration.md Ρ{CRUX Memories agent integration} Κ{cfg=.crux/crux-memories.json; idx=.crux/memory-index.yml}.
zip-contents-protection.crux
⟦CRUX:zip-contents-protection.md P.⊛{¬auto-Δ scripts/create-crux-zip.py w/o user req!}.
docs-sync.crux
⟦CRUX:docs-sync.md Ρ{doc sync rule} Κ{doc=documentation} E.docs{ README.md←install|usage|feature Δ CONTRIBUTORS.md←CI/CD|testing|contrib Δ web/compress.md/←landing|examples|feature highlights } Γ.README{ install.py→upd install CRUX.md→upd spec+examples .cursor/commands/→upd cmd usage .cursor/skills//SKILL.md→upd skill…