/weasel:weasel-gasfrom weasel
Analyzes and implements gas optimizations for Solidity smart contracts on EVM chains. Detects target chain and applies chain-specific rules.
Ships in weasel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Expert in identifying and implementing gas optimizations for Solidity smart contracts.
weasel_analyze with severity: "Gas"Before any gas analysis, determine the target chain.
Config files (most reliable):
hardhat.config.js/ts → networks: { mainnet, arbitrum, optimism, polygon, bsc }
foundry.toml → [rpc_endpoints] or comments
truffle-config.js → networks section
README.md - Look for deployment targets, chain mentions
Dependencies/Files:
foundry.toml, hardhat.config.*, truffle-config.js → EVM (Supported)@arbitrum/* → Arbitrum L2@eth-optimism/* → Optimism L2Anchor.toml, *.rs → Solana (NOT SUPPORTED)Move.toml, *.move → Move (NOT SUPPORTED)tronbox, tronweb → Tron (NOT SUPPORTED).sol files → NOT SUPPORTEDAsk user if unclear: "Which EVM chain is this for? (Ethereum/Arbitrum/Optimism/Polygon/BSC/Other)"
| Category | Chains | Supported |
|---|---|---|
| EVM L1 | Ethereum mainnet | ✓ Full |
| EVM L2 | Arbitrum, Optimism, Base, zkSync, Scroll | ✓ Filtered |
| EVM L1 (cheap) | Polygon, BSC, Avalanche, Fantom | ✓ Filtered |
| Non-EVM | Tron, Solana, Aptos, Sui, CosmWasm, TON, etc. | ❌ NO |
Weasel supports Solidity on EVM chains only.
All standard gas optimizations apply:
Execution is cheap. Calldata dominates costs.
| Optimization | Priority | Why |
|---|---|---|
| Calldata size reduction | HIGH | Calldata posted to L1 |
| Short strings/bytes32 | HIGH | Reduces calldata |
| Event data size | HIGH | Logged to L1 |
| Batch operations | HIGH | Reduces L1 overhead |
| Storage caching | Low | Execution is cheap on L2 |
| Unchecked math | Low | Saves ~20 gas, negligible |
| Struct packing | Maybe | Only if reduces calldata |
Gas is cheap - micro-optimizations often pointless.
| Optimization | Report? | Why |
|---|---|---|
| Storage caching | Maybe | Only for hot paths |
| Unchecked math | Skip | Saves cents, not worth readability |
| Prefix increment | Skip | Negligible savings |
| Array length caching | Skip | Marginal benefit |
Rule: Only report if saves >1000 gas or is on hot path.
Weasel analyzes Solidity on EVM only. Non-EVM chains are not supported.
If detected (Tron, Solana, Move, CosmWasm, TON, etc.):
❌ Cannot run gas analysis.
This project targets a non-EVM chain.
Weasel supports Solidity on EVM chains only.
Gas optimization skill does not apply.
If deploying to multiple EVM chains or unclear:
High Impact - Fix first:
Medium Impact:
Low Impact - Usually skip:
High Impact:
Low Impact (often skip):
Only report if:
Always include chain context:
Gas analysis for: Arbitrum (L2)
Raw findings: 12
After chain filter: 4 relevant
High (2): calldata size (2)
Medium (2): event optimization (2)
Filtered out (8): storage caching, unchecked math - low impact on L2
Fix high impact issues? [yes/specific/skip]
For non-EVM chains:
❌ Cannot run gas analysis.
Detected: Non-EVM project
Weasel supports Solidity on EVM chains only.
Gas optimization skill does not apply.
When user confirms:
Mention when relevant:
| Rationalization | Why It's Wrong |
|---|---|
| "Gas optimizations are universal" | WRONG. L2s have different cost models. Non-EVM is not supported. |
| "I'll assume Ethereum mainnet" | WRONG. ASK or DETECT first. Wrong chain = wrong advice. |
| "Storage caching always helps" | WRONG on L2s. Execution is cheap, saves negligible amounts. |
| "More optimizations = better report" | WRONG. Irrelevant findings waste developer time. |
| "Unchecked math is always good" | WRONG on cheap chains. Saves cents, hurts readability. |
| "Non-EVM is similar enough" | WRONG. Weasel = Solidity + EVM only. Non-EVM = not supported. |
| "I can still give general advice" | WRONG. If not supported, say "not supported" and stop. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub slvdev/weasel --plugin weaselOther plugins' skills for the same job
9 skills in this plugin
/weasel-analyzerStatic analysis and security review for Solidity smart contracts. Triggers on weasel analyze, weasel audit, weasel scan, weasel review, or weasel check./weasel-explainerCode explanation and understanding for Solidity smart contracts. Triggers on weasel explain, weasel what does, or weasel walkthrough./weasel-filterFalse positive filtering for Weasel static analysis results. Triggers on weasel filter, weasel triage, or weasel clean report./weasel-overviewProject overview and audit preparation for smart contract security. Triggers on weasel overview, weasel scope, or weasel onboard.