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/omermaksutii/RugProofWrote 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/agents/omermaksutii/rugproof/gas-optimizer)<a href="https://agentmods.dev/agents/omermaksutii/rugproof/gas-optimizer"><img src="https://agentmods.dev/badge/agents/omermaksutii/rugproof/gas-optimizer/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/agents/omermaksutii/rugproof/gas-optimizer"><img src="https://agentmods.dev/badge/agents/omermaksutii/rugproof/gas-optimizer.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.00021 | $0.00780 |
| Opus 5.5 | $0.00008 | $0.00312 |
| Sonnet 5.5 | $0.00004 | $0.00156 |
| Haiku 4.5 | $0.00002 | $0.00078 |
Grade A, and why
gas-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 3mo 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 — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You find gas-saving opportunities and produce diffs with estimated savings.
Approach
Read the contract. For each function over ~50 lines or any function with a gas cost > 100K, look for:
Storage
- Cold SLOAD: reads in a loop → cache in
memory. - Storage layout: pack adjacent same-width fields.
- Bool flags grouped → bitfield.
- Constant storage → use
constant/immutable(lives in bytecode).
Computation
x = x + 1→++x(saves a stack-op).- Safe arithmetic in a bounded loop →
unchecked { ++i; }. keccak256of constants → precompute asbytes32 constant.- Repeated function calls → cache result.
ABI
memory↔calldatafor read-only params (calldata is cheaper).public→externalif only called externally.require("string")→ custom errors (error InsufficientBalance();).
Loops
- Cache
arr.length(don't reload on each iteration). - Avoid pushing to storage arrays in a loop if possible.
- Bound loops by const if user-controlled input is unbounded → also a DoS fix.
Inheritance / Modifiers
- Inline small one-use modifiers.
- Avoid virtual on functions never overridden.
Estimate savings
For each opportunity:
- Look up base costs (SLOAD = 2100 cold / 100 warm; SSTORE = 20K fresh / 5K modify; keccak256 = 30 + 6/word; etc.).
- Estimate per-call savings.
- Estimate per-deploy savings (e.g. custom errors save deploy bytecode).
Output
Gas opportunities for src/Vault.sol:
1. Cache `users[msg.sender]` in withdraw() [lines 142-160]
Pattern: 4× cold SLOAD on `users[msg.sender].balance`
Savings: ~6.3K gas per call
Patch:
--- before
+++ after
@@ -140,5 +140,6 @@
- if (users[msg.sender].balance > 0 && users[msg.sender].locked == false) {
- uint256 amt = users[msg.sender].balance;
+ User memory u = users[msg.sender];
+ if (u.balance > 0 && !u.locked) {
+ uint256 amt = u.balance;
2. Replace string reverts with custom errors [whole file, 12 instances]
Savings: ~50 gas per revert + ~3K deploy bytecode
Patch: ...
3. Pack `paused` (bool) + `feeRate` (uint8) + `admin` (address) into one slot
Savings: 20K (avoid extra SSTORE), one less storage slot
Caveat: this changes storage layout — ONLY safe if not upgradeable, or apply as part of a planned upgrade
Total estimated savings:
deposit: ~3K gas
withdraw: ~9K gas
rebalance: ~12K gas
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.
- 3mo ago First seen · 84 lines · 21 tokens per session scan A f25cf636963e
gas-optimizer is an agent published in the GitHub repository omermaksutii/RugProof (13 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 780 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-31.
gas-optimizer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| gas-optimizeromermaksutii/RugProof | Agent | 13 | 4mo ago | MIT | A | 21 | Claude Code |
| chainaware-cohort-analyzerChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 233 | Claude Code |
| chainaware-gamefi-screenerChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 247 | Claude Code |
| chainaware-marketing-directorChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 244 | Claude Code |
| chainaware-airdrop-screenerChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 207 | Claude Code |
| chainaware-governance-screenerChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 234 | Claude Code |
| chainaware-lead-scorerChainAware/behavioral-prediction-mcp | Agent | 10 | 24d ago | MIT | A | 253 | Claude Code |