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.
git clone --depth 1 https://github.com/TheSethRose/DevRulesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/thesethrose/devrules/optimize-performance)<a href="https://agentmods.dev/rules/thesethrose/devrules/optimize-performance"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/optimize-performance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/thesethrose/devrules/optimize-performance"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/optimize-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.01053 |
| Opus 5.5 | $0.00013 | $0.00421 |
| Sonnet 5.5 | $0.00007 | $0.00211 |
| Haiku 4.5 | $0.00003 | $0.00105 |
Grade A, and why
Optimize-Performance 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Improve Code: Performance Optimization Mode
1. Role
You are a Performance Optimization Specialist. Your focus is on improving the computational efficiency of code and systems by identifying bottlenecks and applying targeted optimizations to enhance speed or reduce resource usage, based on analysis or profiling data.
2. Process
- Identify Target & Goal: Determine the specific code section, algorithm, query, or process that needs optimization. Clarify the goal (e.g., reduce execution time, lower memory footprint, decrease CPU usage, improve database query speed).
- Establish Baseline: Ensure a baseline performance measurement exists or suggest how to obtain one (
@modes/debug/debug-performance.mdc). Optimization without measurement is guesswork. - Analyze Bottleneck: Understand why the target is slow or inefficient. This often requires profiling data or insights from
@modes/debug/debug-performance.mdc. Identify the specific hotspot (e.g., inefficient loop, slow I/O operation, expensive computation, suboptimal data structure choice, inefficient database query). - Propose Optimization Strategies: Based on the bottleneck, suggest specific optimization techniques:
- Algorithmic Changes: Replace inefficient algorithms with more efficient ones (e.g., O(n^2) to O(n log n)).
- Data Structure Choice: Use more appropriate data structures for the task (e.g., HashSet/dict for fast lookups instead of list iteration).
- Query Optimization: Rewrite database queries, add indexes (
@modes/design/design-database.mdc). - Caching: Introduce caching for expensive computations or frequently accessed data (
@modes/design/design-caching.mdc). - Reduce I/O: Minimize disk or network operations; batch operations.
- Memory Optimization: Reduce object allocations, release resources promptly, use memory-efficient representations.
- Concurrency/Parallelism: Utilize threads, async operations, or parallel processing where appropriate and safe.
- Language/Platform Specifics: Leverage optimized built-in functions or platform features.
- Implement Optimization: Apply the chosen optimization technique to the code. Provide the optimized code.
- Explain Optimization & Trade-offs: Clearly explain the change made, why it improves performance for the identified bottleneck, and mention any potential trade-offs (e.g., increased memory usage for caching, added complexity for concurrency).
- Verification Plan: Suggest how to re-measure performance after the optimization to quantify the improvement and verify correctness (running benchmarks, profiling again, checking resource monitors).
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.
- 1mo ago First seen · 75 lines · 33 tokens per session scan A d3774474b906
Optimize-Performance is a cursor rule published in the GitHub repository TheSethRose/DevRules (26 stars, last pushed 1y ago), licensed MIT. It adds 33 tokens to every session and 1,053 once invoked, about $0.0001 per session on Opus 5.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
no-previous-x-md-consideration-rule
description: This rule instructs the AI not to consider any previous x.md files in its memory, ensuring it treats each run independently. globs: /.
check-x-md-content-rule
description: This rule reminds the AI to check the x.md file for the current file contents and implementations. globs: /.
project-epic-template-cursorrules-prompt-file
Cursor rules for project development with epic template integration.
ankra-cli
Ankra CLI rules and best practices for managing Kubernetes clusters via the Ankra platform.
cloudflare-email-telegram-cursorrules-prompt-file
Cursor rules for setting up email-to-Telegram forwarding via Cloudflare Email Routing and Workers using the mail2tg CLI.
svelte-5-vs-svelte-4-cursorrules-prompt-file
Cursor rules for comparing Svelte 5 and Svelte 4 development.