compare

compare is a command for Claude Code from zaryab2000/decipher-gas-optimizoor. It costs 0 tokens per session (1,221 once invoked), scanned A, original, MIT.

A command for comparing gas snapshots, which record Solidity contract gas costs, between two Git versions of a project.

In plain words
What is it for?
Use it to compare two Git references with Foundry, while checking required tools and temporarily stashing uncommitted changes when needed.
Why use it?
It shows whether code changes made transaction costs better or worse, helping identify gas regressions.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the decipher-gas-optimizoor plugin — 11 skills, 5 commands, 1 agent shipped together

Good fit Use it to compare two Git references with Foundry, while checking required…

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

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 compare

README.md
[![agentmods](https://agentmods.dev/badge/commands/zaryab2000/decipher-gas-optimizoor/compare.svg)](https://agentmods.dev/commands/zaryab2000/decipher-gas-optimizoor/compare)
Your own site
<a href="https://agentmods.dev/commands/zaryab2000/decipher-gas-optimizoor/compare"><img src="https://agentmods.dev/badge/commands/zaryab2000/decipher-gas-optimizoor/compare.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,221 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.00000 $0.01221
Opus 5 $0.00000 $0.00611
Sonnet 5 $0.00000 $0.00244
Haiku 4.5 $0.00000 $0.00122

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

Security

Grade A, and why

compare 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 6d 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.

commands/compare.md · 183 lines

How it starts

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

/decipher-gas-optimizoor:compare [ref1] [ref2]

Compare gas snapshots between two git references to identify regressions and improvements.

Arguments

  • [ref1] — base git reference (default: HEAD~1)
  • [ref2] — target git reference (default: HEAD)

Workflow

Step 1: Verify forge and git

Run:

forge --version
git --version

If either command fails, report the missing tool and its install URL, then stop:

Step 2: Check for uncommitted changes

Run:

git status --porcelain

If the output is non-empty, warn:

Warning: working tree has uncommitted changes. These will be stashed before checkout and restored afterward. Any stash conflicts must be resolved manually.

Step 3: Stash uncommitted changes

Only if Step 2 found a dirty working tree, run:

git stash

Record whether a stash was created (true/false) for use in Step 6.

Step 4: Snapshot ref1

Run:

git checkout [ref1]
forge snapshot --snap /tmp/gas-snapshot-ref1.txt

If forge snapshot fails (e.g., build error on ref1), report the error, restore working state (Step 6 cleanup), and stop.

Step 5: Snapshot ref2

Run:

git checkout [ref2]
forge snapshot --snap /tmp/gas-snapshot-ref2.txt

If forge snapshot fails on ref2, report the error, restore working state, and stop.

Step 6: Restore original state

Run in sequence:

git checkout -

If a stash was created in Step 3, then run:

git stash pop

If git stash pop fails due to a conflict, warn the user:

Warning: git stash pop failed due to merge conflict. Your stashed changes are still in the stash. Run git stash show to inspect and git stash pop to retry manually.

Continue to Step 7 regardless — the comparison data is already collected.

Step 7: Parse snapshots and compute deltas

Read both snapshot files. Each line has the format:

ContractName:functionName() gas: 12345

Read the full file on GitHub · 183 lines

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. 6d ago First seen · 183 lines · 0 tokens per session scan A 98f1cd00221c

Subscribe to this mod's changes

compare is a command published in the GitHub repository zaryab2000/decipher-gas-optimizoor (7 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,221 tokens. 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.