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 skills/0xendale/evm-agent-toolkit/gas-optimizationnpx skills add 0xendale/evm-agent-toolkit --skill gas-optimizationgit clone --depth 1 https://github.com/0xendale/evm-agent-toolkitWrote 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/skills/0xendale/evm-agent-toolkit/gas-optimization)<a href="https://agentmods.dev/skills/0xendale/evm-agent-toolkit/gas-optimization"><img src="https://agentmods.dev/badge/skills/0xendale/evm-agent-toolkit/gas-optimization.svg" alt="Measured on agentmods" 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 | $0.00072 | $0.01473 |
| Opus 5 | $0.00036 | $0.00737 |
| Sonnet 5 | $0.00014 | $0.00295 |
| Haiku 4.5 | $0.00007 | $0.00147 |
Grade A, and why
gas-optimization 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 4d 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 — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Gas Optimization
Overview
Reduce the gas a contract spends without changing its observable behavior. Every proposed saving is a hypothesis until measured. The core discipline is: find candidates, rewrite one at a time, prove the behavior is unchanged, and prove the gas actually went down — discard anything that fails either proof.
The Iron Rule: never claim a gas saving you have not measured. A rewrite that "should" be cheaper but isn't, or that subtly changes behavior, is a regression. No exceptions for "obvious" wins.
When to Use
- Lowering deployment or runtime gas of Solidity/Vyper/Yul contracts
- Symptoms: "gas too high", expensive
SSTORE/SLOAD, largeforloops, structs with many fields,string memory/bytes memoryexternal args, repeated.lengthreads,i++in loops - Considering
unchecked,constant/immutable, mappings-over-arrays, bitwise tricks, or transient storage
Do NOT use for: correctness bugs or security audits (use vulnerability-scanning), or micro-tweaks to code that isn't on a hot path and isn't deployed at scale — readability usually wins there.
Workflow
Run these four steps in order. They are reasoning steps you perform, not scripts.
- Seek — Read the target contract and match it against the known waste patterns in
reference/patterns.md. List every candidate with its location. Ground every later idea in the EVM cost facts inreference/cost-model.md. - Innovate — For each candidate, propose one concrete rewrite. You may also propose novel rewrites beyond the library, but only if you can name the exact opcode/cost reason it's cheaper. Reject ideas you cannot justify from the cost model.
- Execute — Apply rewrites one at a time, then verify each (see below). If verification fails, revert that rewrite and move on. Do not batch unverified changes.
- Manage — After the loop, report each accepted change: location, pattern, measured gas delta (before → after), and any behavioral caveat. Be honest about rewrites you discarded and why.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago First seen · 72 lines · 72 tokens per session scan A 86dbba827c4f
gas-optimization is a skill published in the GitHub repository 0xendale/evm-agent-toolkit (1 stars, last pushed 1mo ago), licensed MIT. It adds 72 tokens to every session and 1,473 once invoked, about $0.0004 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.
Other skills, from other repositories
ethereum-development
Production-grade Ethereum/EVM development workflow for smart contracts, dApps, transactions, clients, gas optimization, testing, security review, deployment, verification, monitoring, and incident response across Foundry, Hardhat, Solidity, TypeScript, viem, ethers, wagmi, and common EVM networks.
Gas Optimizer
Advanced gas optimization tool for Ethereum and EVM-compatible chains. Analyzes transactions, simulates gas usage, suggests optimal gas prices, batches transactions, and implements gas-saving patterns for smart contract interactions.
evm-bytecode-analysis
Analyze supplied deployed EVM runtime bytecode with EVMole or guide a separate application in integrating a published EVMole Rust, Go, Python, or JavaScript binding. Use for unverified-contract inspection, ABI reconstruction from runtime code, selector discovery, storage-access analysis, EVM control-flow inspection…
web3-bug-classes
Complete reference for all 10 DeFi smart contract bug classes. Use this when hunting for specific vulnerability types, need attack patterns for accounting desync, access control, incomplete path, off-by-one, oracle manipulation, ERC4626 vaults, reentrancy, flash loans, signature replay, or proxy/upgrade bugs.
web3-methodology-research
External research synthesis from Trail of Bits, SlowMist, ConsenSys, Immunefi, and Cyfrin. Use this for advanced audit methodology, Echidna/Medusa fuzzing setup, Slither custom detector writing, attack pattern deep dives, or the 4-phase learning roadmap.
web3-poc-foundry
Complete Foundry PoC writing guide + all cheatcodes + DeFiHackLabs reproduction patterns. Use this when building a proof of concept exploit, setting up a fork test, using Foundry cheatcodes, or reproducing a known DeFi hack for learning.