By zaryab2000
Audit Foundry Solidity contracts for gas inefficiencies across storage packing, loops, functions, custom errors, unchecked math, and deployment costs. Generate severity-sorted reports with estimated savings, compare git snapshots for regressions, manage forge snapshots, and toggle real-time gas annotations during edits.
Conduct a full gas optimization analysis on a Foundry Solidity project.
Read, update, or query the `.gas-snapshot` file produced by `forge snapshot`.
Compare gas snapshots between two git references to identify regressions and improvements.
Explain the EVM mechanic behind a specific gas optimization pattern with exact cost
Toggle real-time gas annotation mode. When active, Claude appends a gas impact note
Detects calldata inefficiencies in Solidity external functions: memory instead of calldata for array and struct parameters, smaller types with masking overhead for computation-only parameters, and multiple bool parameters that could be packed into a bitmap. Use when writing or reviewing external function signatures in Foundry-based Solidity projects. Covers CD-001 through CD-004: calldata arrays, calldata structs, uint256 for computation parameters, and bool bitmap encoding.
Analyzes foundry.toml optimizer configuration for Foundry-based Solidity projects. Detects suboptimal optimizer_runs settings relative to contract call frequency, missing via_ir flag for complex contracts, and outdated Solidity versions missing built-in optimizer gains. Covers CO-001 (optimizer_runs tuning), CO-002 (via_ir for Yul-level optimization), CO-003 (Solidity version selection for 0.8.22 auto-unchecked loops and 0.8.24 transient storage). Use when writing or reviewing foundry.toml or pragma declarations.
Detects all require() with string messages and revert("string") calls in Solidity contracts and converts them to custom errors. Never allows string-based reverts to pass without flagging. Covers CE-001 (require with string → custom error), CE-002 (revert string → custom error), CE-003 (parameterless errors that should include typed context). Use when writing or reviewing any revert logic in Foundry-based Solidity 0.8.4+ projects.
Detects deployment cost inefficiencies in Solidity: factory patterns that deploy full contracts when ERC-1167 minimal proxies would suffice, non-payable admin functions with unnecessary ETH check overhead, dead code paths inflating bytecode, and opportunities for vanity addresses via CREATE2 for high-frequency contracts. Covers DP-001 (minimal proxy factories), DP-002 (payable admin functions), DP-003 (dead code removal), DP-004 (vanity addresses). Use when writing constructors, factory contracts, or reviewing bytecode size.
Detects storage writes used for off-chain-only historical data and recommends replacing them with event emission. Also identifies events missing indexed parameters on filterable fields. LOG1 costs ~375 gas vs cold SSTORE 22,100 gas for off-chain data. Covers EV-001 (storage → events for historical data) and EV-002 (indexed parameter selection for filterable events). Use when writing storage arrays for historical records or event declarations in Foundry-based Solidity projects.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Dedicated Solidity Smart Contract Gas optimizoor for your Solidity projects.
All you need to optimize your smart contracts.
Inside Claude Code, run:
Step 1: Add the marketplace
/plugin marketplace add zaryab2000/decipher-gas-optimizoor
Step 2: Install the marketplace
/plugin install decipher-gas-optimizoor@decipher-gas-optimizoor-marketplace
Prerequisites: Foundry installed · Claude Code installed · a Solidity project with foundry.toml and at least one test
The regression guard compares every future save against this snapshot. Run once, then commit it.
/decipher-gas-optimizoor:baseline --update
git add .gas-snapshot && git commit -m "chore: gas baseline"
Do not add
.gas-snapshotto.gitignore— it must be committed for the regression guard to work.
/decipher-gas-optimizoor:analyze src/
You'll get a prioritized findings report: severity, file + line, estimated gas saving, before/after code, and a top-3 action list.
/decipher-gas-optimizoor:watch
After activation, every Solidity edit Claude makes gets a gas impact note appended to the response. Turn it off with /decipher-gas-optimizoor:watch --off.
| Command | What it does | Forge |
|---|---|---|
/decipher-gas-optimizoor:analyze [path] [--threshold N] | Full gas analysis of a contract or directory. Reports all findings sorted by estimated gas saving. | ✅ |
/decipher-gas-optimizoor:compare [ref1] [ref2] | Compares gas snapshots between two git refs (default: HEAD~1 vs HEAD). Shows per-function delta split into regressions and improvements. | ✅ |
/decipher-gas-optimizoor:baseline [--update|--show X] | Manages the .gas-snapshot baseline. --update regenerates it; --show X filters to matching functions; no args prints the full summary. | --update only |
/decipher-gas-optimizoor:explain <pattern> | EVM mechanic, exact gas numbers, before/after code, and when NOT to apply — for any listed pattern. | ❌ |
/decipher-gas-optimizoor:watch [--off] | Toggles per-edit gas annotation mode. Session-scoped. | ❌ |
--threshold — suppress findings below a minimum gas saving. Default is 100:
/decipher-gas-optimizoor:analyze src/ --threshold 500
Patterns for :explain — cold-sload · slot-packing · unchecked · custom-errors · calldata · external-vs-public · immutable · loop-caching · unbounded-loop
Skills fire automatically as you write Solidity. You never invoke them directly.
npx claudepluginhub zaryab2000/decipher-gas-optimizoor --plugin decipher-gas-optimizoorEnd-to-end Solidity smart contract workflow: planning, TDD with Foundry, gas optimization, security review, deployment, upgrades, and audit preparation
Complete creative writing suite with 10 specialized agents covering the full writing process: research gathering, character development, story architecture, world-building, dialogue coaching, editing/review, outlining, content strategy, believability auditing, and prose style/voice analysis. Includes genre-specific guides, templates, and quality checklists.
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Intelligent draw.io diagramming plugin with AI-powered diagram generation, multi-platform embedding (GitHub, Confluence, Azure DevOps, Notion, Teams, Harness), conditional formatting, live data binding, and MCP server integration for programmatic diagram creation and management.
Comprehensive startup business analysis with market sizing (TAM/SAM/SOM), financial modeling, team planning, and strategic research
v9.44.1 — Patch release for Gemini environment/version detection and qwen auth gating. Run /octo:setup.