gas-optimizer

gas-optimizer is an agent for Claude Code from zaryab2000/decipher-gas-optimizoor. It costs 95 tokens per session (351 once invoked), scanned A, original, MIT.

A reporting agent that audits an entire Foundry-based Solidity codebase for gas-saving opportunities across 11 areas, including storage, loops, parameters, deployment, errors, compiler settings, and events. It reports findings without changing the contracts.

In plain words
What is it for?
Use it before mainnet deployment, before a security audit, or when taking over an existing Solidity project that needs a broad gas review.
Why use it?
It gives developers one prioritized view of optimization opportunities across multiple contract files and reduces duplicate findings. The report ranks suggestions by estimated gas savings and proposes an order for addressing them.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the decipher-gas-optimizoor plugin — 11 skills, 5 commands, 1 agent shipped together

Good fit Use it before mainnet deployment, before a security audit, or when taking over an existing Solidity project that needs a broad gas review.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/zaryab2000/decipher-gas-optimizoor/gas-optimizer
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.

Clone the repo
git clone --depth 1 https://github.com/zaryab2000/decipher-gas-optimizoor

Made for: Claude Code.

Or install decipher-gas-optimizoor, the plugin that ships this one along with the rest of its 11 skills, 5 commands, 1 agent.

Wrote 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.

agentmods badge for gas-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/zaryab2000/decipher-gas-optimizoor/gas-optimizer.svg)](https://agentmods.dev/agents/zaryab2000/decipher-gas-optimizoor/gas-optimizer)
Your own site
<a href="https://agentmods.dev/agents/zaryab2000/decipher-gas-optimizoor/gas-optimizer"><img src="https://agentmods.dev/badge/agents/zaryab2000/decipher-gas-optimizoor/gas-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 351 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00095 $0.00351
Opus 5 $0.00048 $0.00176
Sonnet 5 $0.00019 $0.00070
Haiku 4.5 $0.00010 $0.00035

Measured 7d ago against content hash 4bc10696aa5b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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 7d 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.

agents/gas-optimizer.md · 39 lines

What it actually says

Purpose

Conducts a comprehensive, multi-file gas optimization audit of a Foundry-based Solidity codebase. Produces a prioritized findings report with concrete code changes.

When to Use

  • Full codebase audit before mainnet deployment
  • Pre-audit gas optimization pass
  • Optimizing an inherited codebase you did not write

Workflow

  1. Run /decipher-gas-optimizoor:baseline --update to establish current baseline
  2. Run forge inspect on every contract in src/ for storage layouts
  3. Apply all 11 skill domains systematically to each contract file
  4. Deduplicate findings across files
  5. Sort all findings by estimated gas saving (highest first)
  6. Produce the full /decipher-gas-optimizoor:analyze report format for the entire codebase
  7. Propose a commit sequence: "Fix these 3 first (highest impact, lowest risk)"

Scope

  • Covers all 11 skill domains
  • Works across multiple contract files
  • Does not modify contracts — reports findings only
  • Developer implements changes; hook guards against regressions
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. 7d ago First seen · 39 lines · 95 tokens per session scan A 4bc10696aa5b

Subscribe to this mod's changes

gas-optimizer is an agent published in the GitHub repository zaryab2000/decipher-gas-optimizoor (7 stars, last pushed 6mo ago), licensed MIT. It adds 95 tokens to every session and 351 once invoked, about $0.0005 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.