unchecked-arithmetic

unchecked-arithmetic is a skill for Claude Code from zaryab2000/decipher-gas-optimizoor. It costs 100 tokens per session (1,863 once invoked), scanned A, original, MIT.

A Solidity review skill that identifies arithmetic proven safe from overflow or underflow and places it in an unchecked block, which skips Solidity's automatic safety checks.

In plain words
What is it for?
Use it when reviewing checked subtractions, loop counters, or other bounded arithmetic in Solidity functions.
Why use it?
It can remove unnecessary arithmetic checks where the surrounding code proves they cannot fail, while requiring that proof to be documented.

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 when reviewing checked subtractions, loop counters, or other bounded arithmetic in Solidity functions.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/zaryab2000/decipher-gas-optimizoor/unchecked-arithmetic"><img src="https://agentmods.dev/badge/skills/zaryab2000/decipher-gas-optimizoor/unchecked-arithmetic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,863 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.00100 $0.01863
Opus 5 $0.00050 $0.00932
Sonnet 5 $0.00020 $0.00373
Haiku 4.5 $0.00010 $0.00186

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

Security

Grade A, and why

unchecked-arithmetic 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/unchecked-arithmetic/SKILL.md · 171 lines

How it starts

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

Purpose

Identify arithmetic operations where the overflow/underflow invariant is provable from the surrounding code logic, then wrap those operations in unchecked {} to skip Solidity 0.8+'s automatic overflow guards (~30 gas per operation). Always require an explicit inline comment documenting the invariant. Never recommend unchecked without proof.

When to Use This Skill

Use when:

  • Claude reviews a subtraction operation that is immediately preceded by a check proving the minuend is greater than or equal to the subtrahend
  • Claude writes loop counter increments where the bound is proven by a for condition
  • Claude reviews arithmetic on values proven bounded by type constraints or prior validation (e.g., a uint8 counter that cannot exceed 255)
  • The user asks whether a specific arithmetic expression is safe to wrap in unchecked

When NOT to Use This Skill

Do NOT use for:

  • Any arithmetic where the overflow/underflow condition is not explicitly proven in the same function scope — "it looks safe" is not proof; document the invariant in a comment or do not apply
  • User-controlled inputs that have not been validated by a prior bounds check
  • Business-critical arithmetic (token balances, prices, collateral ratios) unless fuzz test coverage specifically targeting boundary values is confirmed to exist — always document the fuzz test name in the finding
  • Operations inside re-entrant paths where state can change between the check and the arithmetic (confirm reentrancy guard present or CEI pattern followed before applying)
  • Solidity versions before 0.8.0 — those have no overflow checks to remove
  • When uncertain about overflow safety: state "Cannot confirm bounds — do not apply unchecked without fuzz test proving safety" rather than guessing

Rationalizations to Reject

Rationalization Why It's Wrong Required Action
"This looks safe" Looking safe is not proof of safety — only bounds proven by code logic count Document the invariant in an inline comment before applying unchecked
"The tests pass" Tests only cover cases you thought of; unchecked wraps silently on overflow Add fuzz tests that specifically target boundary conditions
"It's a small number" Small input does not mean overflow-safe — compound expressions can overflow Trace the maximum possible value through every arithmetic operation
"The compiler would catch it" The compiler does not catch logical overflow errors — it only removes the runtime check Prove the invariant in code and in comments

Read the full file on GitHub · 171 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 · 171 lines · 100 tokens per session scan A a78441aa3c82

Subscribe to this mod's changes

unchecked-arithmetic is a skill published in the GitHub repository zaryab2000/decipher-gas-optimizoor (7 stars, last pushed 6mo ago), licensed MIT. It adds 100 tokens to every session and 1,863 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.

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

flounder

Operates Flounder, an autonomous white-hat security auditor. Use when a user asks for a security audit, bug-bounty review, vulnerability investigation, or exploit proof for a public-source or authorized repository, source tree, package, smart contract, Solidity/EVM project, ZK or proof-system code, deployed address…

adshao/flounder · 202 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