storage-layout

storage-layout is a skill for Claude Code from zaryab2000/decipher-gas-optimizoor. It costs 130 tokens per session (2,431 once invoked), scanned A, original, MIT.

A Solidity review guide for reducing the cost of contract data stored on-chain, including how fields and state variables occupy storage slots.

In plain words
What is it for?
Use it to review struct field ordering, state variables, mappings and arrays, repeated storage access, temporary transaction data, and batch updates.
Why use it?
It helps find wasted storage space and unnecessary reads or writes, which can make contract operations more expensive.

Skill 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 to review struct field ordering, state variables, mappings and arrays, repeated storage access, temporary transaction data, and batch updates.

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

Any agent
npx skills add zaryab2000/decipher-gas-optimizoor --skill storage-layout
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 storage-layout

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaryab2000/decipher-gas-optimizoor/storage-layout/github.svg)](https://agentmods.dev/skills/zaryab2000/decipher-gas-optimizoor/storage-layout)
Your own site
<a href="https://agentmods.dev/skills/zaryab2000/decipher-gas-optimizoor/storage-layout"><img src="https://agentmods.dev/badge/skills/zaryab2000/decipher-gas-optimizoor/storage-layout/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.

agentmods 80×15 button for storage-layout

Your own site · 80×15
<a href="https://agentmods.dev/skills/zaryab2000/decipher-gas-optimizoor/storage-layout"><img src="https://agentmods.dev/badge/skills/zaryab2000/decipher-gas-optimizoor/storage-layout.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 130 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,431 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.00130 $0.02431
Opus 5 $0.00065 $0.01215
Sonnet 5 $0.00026 $0.00486
Haiku 4.5 $0.00013 $0.00243

Measured 9d ago against content hash 85dd177d8594, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

storage-layout 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 9d 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.

skills/storage-layout/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

Identify storage slot inefficiencies in Solidity contracts and recommend layout changes that reduce SSTORE and SLOAD costs. Storage operations are the most expensive EVM instructions: a cold SSTORE costs 22,100 gas and a cold SLOAD costs 2,100 gas. Every eliminated slot and every avoided redundant storage access compounds across all callers for the life of the contract.

This skill covers 10 techniques (SL-001 through SL-010) derived from the gas optimization knowledge base. It does not invent new rules.


When to Use This Skill

  • Writing or reviewing a struct definition with mixed-size fields
  • Reviewing state variable declarations at the contract level
  • Auditing functions that read or write the same storage variable multiple times
  • Reviewing reentrancy guards (check for SSTORE-based lock patterns)
  • Reviewing flash-loan or callback patterns that use persistent storage flags
  • Reviewing constructors that push static data into storage arrays
  • Reviewing contracts that use arrays for key-based lookup instead of mappings

When NOT to Use This Skill

  • Upgradeable contracts (proxy pattern): Never reorder existing state variables. Storage layout is immutable across upgrades. Only append at the end, using gaps.
  • Frozen/deployed contracts: If the contract is already deployed and not upgradeable, storage layout cannot be changed. Report findings as informational only.
  • Separately accessed fields: If struct fields are always read in separate transactions, packing into shared slots adds masking overhead without reducing SLOAD count.
  • Chains without Cancun support: Do not recommend transient storage (SL-005, SL-006) on chains that do not yet support EIP-1153 (e.g., some L2s before their Cancun upgrade).
  • Mutable large data: Do not recommend SSTORE2 (SL-007) for data that changes after deployment — bytecode is immutable.

Rationalizations to Reject

Rationalization Why It's Wrong Required Action
"The struct looks fine as-is" Unpacked slots cost 22,100 gas per write, silently Run the packing check regardless of visual appearance
"It's only one extra slot" At 10,000 tx/day, 1 extra slot = 221M gas/day wasted Eliminate every eliminable slot
"I'll optimize later" Storage layout cannot be changed after deployment without a migration Fix during development, not after
"The compiler handles this" Solidity packs within consecutive declarations only; cross-declaration gaps are not packed Always verify with forge inspect

Read the full file on GitHub · 236 lines

Files

What ships with it

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

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. 9d ago First seen · 236 lines · 130 tokens per session scan A 85dd177d8594

Subscribe to this mod's changes

storage-layout is a skill published in the GitHub repository zaryab2000/decipher-gas-optimizoor (7 stars, last pushed 6mo ago), licensed MIT. It adds 130 tokens to every session and 2,431 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

solidity-gas-optimizer

Analyze and optimize gas consumption in Solidity smart contracts using proven patterns and best practices.

ZhouXiaoHong/binance-skills · 23 tokens

blockchain-expert

Expert-level blockchain, Web3, smart contracts, DeFi, and cryptocurrency development. Use when the user mentions Web3, smart contracts, DeFi, Ethereum, or Solidity, or when the task involves Blockchain Fundamentals, Web3 & DeFi, Smart Contract Security, or Gas Optimization.

personamanagmentlayer/pcl · 63 tokens

blockchain-application

Use this skill when asked about smart contract development, Solidity, Vyper, Rust smart contracts (Solana, NEAR, Polkadot), Haskell/Plutus (Cardano), Cairo/StarkNet, dApp backend development, Truffle, Hardhat, Foundry, Anchor, and blockchain application patterns. Languages: Solidity, Vyper, Rust, Haskell, Cairo, Move.…

j4flmao/agent-skills · 175 tokens

web3-expert

Build production-ready Web3 applications including smart contracts, dApps, DeFi protocols, and decentralized storage solutions. Use when the user mentions Web3, smart contracts or Solidity, dApps, DeFi protocols, ethers.js or web3.js, IPFS, or on-chain integration with Ethereum-compatible networks.

personamanagmentlayer/pcl · 66 tokens

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.

dirtybits/agent-skills · 64 tokens

pentagonal-clawd

Use when the user asks to create, generate, build, audit, fix, compile, or look up smart contracts and tokens. Pentagonal Clawd is a sovereign smart contract forge and token intelligence platform with AI-powered 8-agent security pen testing across Ethereum, Solana, Polygon, Base, Arbitrum, Optimism, and BSC.

Pentagonal-ai/pentagonal · 75 tokens