{"id":48296958,"url":"https://github.com/zaryab2000/decipher-gas-optimizoor","last_synced_at":"2026-04-04T23:37:35.460Z","repository":{"id":339925287,"uuid":"1163860590","full_name":"zaryab2000/decipher-gas-optimizoor","owner":"zaryab2000","description":"An advanced claude code plugin that seamlessly optimizes any EVM smart contracts. MAKES NO MISTAKE","archived":false,"fork":false,"pushed_at":"2026-02-22T09:36:13.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-22T15:28:59.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaryab2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-22T09:09:55.000Z","updated_at":"2026-02-22T09:36:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zaryab2000/decipher-gas-optimizoor","commit_stats":null,"previous_names":["zaryab2000/decipher-gas-optimizoor"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zaryab2000/decipher-gas-optimizoor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2Fdecipher-gas-optimizoor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2Fdecipher-gas-optimizoor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2Fdecipher-gas-optimizoor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2Fdecipher-gas-optimizoor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaryab2000","download_url":"https://codeload.github.com/zaryab2000/decipher-gas-optimizoor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaryab2000%2Fdecipher-gas-optimizoor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31419538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T23:37:33.628Z","updated_at":"2026-04-04T23:37:35.451Z","avatar_url":"https://github.com/zaryab2000.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# decipher-gas-optimizoor\n\n![version](https://img.shields.io/badge/version-1.0.0-blue)\n![solidity](https://img.shields.io/badge/solidity-0.8.4%2B-lightgrey)\n![forge](https://img.shields.io/badge/requires-foundry-orange)\n\nDedicated Solidity Smart Contract Gas optimizoor for your Solidity projects.\n- 11 domain-specific EVM gas-optimization skills,\n- 5 slash commands,\n- 1 agent\n- and a per-save regression guard\n\nAll you need to optimize your smart contracts.\n\n\n---\n\n## Installation\n\nInside Claude Code, run:\n\n**Step 1: Add the marketplace**\n```\n/plugin marketplace add zaryab2000/decipher-gas-optimizoor\n```\n\n**Step 2: Install the marketplace**\n\n```\n/plugin install decipher-gas-optimizoor@decipher-gas-optimizoor-marketplace\n```\n\n---\n\n## Quickstart\n\n**Prerequisites:** [Foundry](https://getfoundry.sh) installed · Claude Code installed · a Solidity project with `foundry.toml` and at least one test\n\n### Step 1 — Create a gas baseline\n\nThe regression guard compares every future save against this snapshot. Run once, then commit it.\n\n```\n/decipher-gas-optimizoor:baseline --update\n```\n\n```bash\ngit add .gas-snapshot \u0026\u0026 git commit -m \"chore: gas baseline\"\n```\n\n\u003e Do not add `.gas-snapshot` to `.gitignore` — it must be committed for the regression guard to work.\n\n### Step 2 — Run your first analysis\n\n```\n/decipher-gas-optimizoor:analyze src/\n```\n\nYou'll get a prioritized findings report: severity, file + line, estimated gas saving, before/after code, and a top-3 action list.\n\n### Step 3 — Enable real-time annotations while editing\n\n```\n/decipher-gas-optimizoor:watch\n```\n\nAfter activation, every Solidity edit Claude makes gets a gas impact note appended to the response. Turn it off with `/decipher-gas-optimizoor:watch --off`.\n\n---\n\n## Commands\n\n| Command                                                   | What it does                                                                                                                                 |      Forge      |\n| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | :-------------: |\n| `/decipher-gas-optimizoor:analyze [path] [--threshold N]` | Full gas analysis of a contract or directory. Reports all findings sorted by estimated gas saving.                                           |        ✅        |\n| `/decipher-gas-optimizoor:compare [ref1] [ref2]`          | Compares gas snapshots between two git refs (default: `HEAD~1` vs `HEAD`). Shows per-function delta split into regressions and improvements. |        ✅        |\n| `/decipher-gas-optimizoor:baseline [--update\\|--show X]`  | Manages the `.gas-snapshot` baseline. `--update` regenerates it; `--show X` filters to matching functions; no args prints the full summary.  | `--update` only |\n| `/decipher-gas-optimizoor:explain \u003cpattern\u003e`              | EVM mechanic, exact gas numbers, before/after code, and when NOT to apply — for any listed pattern.                                          |        ❌        |\n| `/decipher-gas-optimizoor:watch [--off]`                  | Toggles per-edit gas annotation mode. Session-scoped.                                                                                        |        ❌        |\n\n**`--threshold`** — suppress findings below a minimum gas saving. Default is 100:\n\n```\n/decipher-gas-optimizoor:analyze src/ --threshold 500\n```\n\n**Patterns for `:explain`** — `cold-sload` · `slot-packing` · `unchecked` · `custom-errors` · `calldata` · `external-vs-public` · `immutable` · `loop-caching` · `unbounded-loop`\n\n---\n\n## Skills — Auto-Applied\n\nSkills fire automatically as you write Solidity. You never invoke them directly.\n\n| Skill                    | Code  | Catches                                                                                                  | Fires when                                                  |\n| ------------------------ | :---: | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |\n| `storage-layout`         |  SL   | Unpacked structs, wasted slots, suboptimal field ordering, redundant SLOADs, expensive reentrancy guards | Writing `struct` definitions or state variable declarations |\n| `loop-optimization`      |  LO   | Storage reads inside loops, uncached array lengths, missing unchecked counters                           | Writing `for`/`while` loops                                 |\n| `calldata`               |  CD   | `memory` params on `external` functions that should be `calldata`                                        | Writing external function parameters                        |\n| `deployment`             |  DP   | Suboptimal `optimizer_runs`, proxy pattern opportunities, payable admin savings, bytecode size           | Writing constructors, factories, or `foundry.toml`          |\n| `type-optimization`      |  TY   | Unnecessary downcasting, `string` where `bytes32` fits, bool bitmap opportunities                        | Writing variable declarations                               |\n| `custom-errors`          |  CE   | Every `require(cond, \"string\")` and `revert(\"string\")` without exception                                 | Writing any `require` with a string message                 |\n| `compiler-optimizer`     |  CO   | `optimizer_runs` not tuned for usage, missing `via_ir`, outdated Solidity version                        | Writing or reviewing `foundry.toml`                         |\n| `immutable-and-constant` |  IC   | Constructor-set variables that should be `immutable`; runtime `keccak256` of a literal                   | Writing constructor-set state variables                     |\n| `unchecked-arithmetic`   |  UA   | Arithmetic in bounded loops where overflow is provably impossible                                        | Writing arithmetic in loops                                 |\n| `visibility`             |  VI   | `public` functions only called externally; duplicate manual getters                                      | Writing function declarations                               |\n| `event-logging`          |  EV   | Storage used for historical data that should be events; wrong `indexed` parameter choices                | Writing storage-backed history arrays                       |\n\n---\n\n## Agents \u0026 Hook\n\n### `gas-optimizer` agent\n\nFull-codebase audit. Applies all 11 skill domains across every contract in `src/`, deduplicates findings, and produces a prioritized fix sequence. Use before mainnet deployment or a pre-audit gas pass.\n\n### Regression hook\n\nFires automatically on every `.sol` save. Runs `forge snapshot --diff` against the committed baseline and warns on any regression above the threshold:\n\n```\nGAS_GUARD: REGRESSION DETECTED\n  ↑ VaultTest::testDeposit() (gas: 38400 → 39640 | +1240 3.2%)\nGAS_GUARD: Threshold: 500 gas | Run /decipher-gas-optimizoor:analyze to investigate\n```\n\nAlways exits 0 — never interrupts your session. Silently skips if forge is missing or no baseline exists. Threshold configurable via `GAS_REGRESSION_THRESHOLD` env var (default: `500`). Full config reference: [`docs/configuration.md`](docs/configuration.md).\n\n---\n\n## Contributing\n\n**Found a wrong gas figure or missing EIP citation?**\nOpen an issue with the pattern ID (e.g. `SL-003`), the incorrect value, and a source (EIP number or opcode reference).\n\n**Want to add a new optimization pattern to an existing skill?** Every pattern needs:\n1. An exact gas number backed by an EVM opcode reference or EIP citation\n2. A before/after Solidity example in ≤20 lines\n3. A \"When NOT to apply\" condition — patterns without safety guardrails won't be merged\n\n**Want to add a new skill domain?** Open an issue first to discuss scope. New domains must cover ≥3 distinct patterns and must not overlap with an existing skill.\n\n**Found a bug in the regression hook?** The script is 42 lines at [`hooks/scripts/gas-regression-guard.sh`](hooks/scripts/gas-regression-guard.sh) — read it in full before filing.\n\n[Open an issue →](https://github.com/zaryab2000/decipher-gas-optimizoor/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaryab2000%2Fdecipher-gas-optimizoor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaryab2000%2Fdecipher-gas-optimizoor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaryab2000%2Fdecipher-gas-optimizoor/lists"}