{"slug": "optimaizr-analyze-and-optimize-your-claude-code-usage", "title": "OptimAIzr – analyze and optimize your Claude Code usage", "summary": "Blend Bunjaku released optimAIzr, an open-source local CLI that profiles Claude Code, Codex and custom API calls to find wasted tokens and quantify savings, first presented September 13, 2026 and open source since September 30, 2026. The tool's sample profile of 4,062 calls and 743.4M tokens ($476.70 spend) flagged 931 calls (22.9%) and estimated $44.59/month, or $542.48/year, in potential savings, and its Claude Code mod requires version 2.1.287 or later. optimAIzr reads token counts and commands but never prompts or file contents, makes no network calls, and requires no account, upload or telemetry.", "body_md": "**Spend fewer tokens on the same work.**\n\noptimAIzr is a local CLI that finds wasted tokens in Claude Code, Codex and your own API calls, shows what each fix would save, and checks it on your own traffic before you switch. No account, no upload, no telemetry. It reads token counts, never your prompts.\n\nFirst presented on September 13, 2026, and open source since September 30, 2026.\n\n```\nnpm i -g optimaizr\noptimaizr profile\n```\n\nOr try it once without installing: `npx optimaizr profile`.\n\nClaude Code now runs mods, plugins that work inside it. The optimAIzr mod puts\nthe numbers where you work, lets **Y** in `optimaizr live` switch the session\nyou are in, and shows what each switch saved.\n\n```\n  ⏺ optimaizr: this turn $0.18 · 4 requests · 5h 55% → 56%\n\n  optimAIzr  █████████░░░░░░░  56% of 5h · resets 15:00\n  ❯\n```\n\nInstall it from a Claude Code session (2.1.287 or later):\n\n```\n/plugin marketplace add blendbunjaku/optimaizr\n/plugin install optimaizr@optimaizr\n```\n\n- **The cost while Claude works.** The spinner shows what the turn has cost so\nfar and how full your 5-hour window is. The band above the prompt shows the\nwindow, how long it lasts at this pace and when it resets, from Claude Code's\nown limit meter. Each answer gets one line with its cost, its requests and\nhow far the window moved.\n- **Switches in the session you are in.** Press**Y** on a model swap in`optimaizr live` and the running session uses the cheaper model from its next\nrequest. No restart, no`/model` . Subagents switch at once; a long\nconversation waits until reloading it into the new model pays back. A\nreasoning-effort finding lowers effort the same way. With`optimaizr live --auto` , confident switches apply without asking.\n- **What a switch saved.** A switched turn's line leads with the saving: the\nsame tokens priced on the original model, less what they cost. The band keeps\na running total.\n- **Back in one command.** Harder task?`/optimaizr off` returns the session you\nare in to its own model and effort;`/optimaizr on` resumes.\n- **A guard against retry loops.** When the same command fails twice in a row\nwith nothing changed, the next identical attempt is held once and Claude is\nasked to change something first.\n- **`/optimaizr`** prints the session's spend, what it saved, both plan windows\nand any switch.`/optimaizr hud` shows it all as gauges and a sparkline.\n\nIt reads usage figures and the commands Claude runs, never your prompts or file\ncontents, and makes no network calls.\nThe source is in [`mods/optimaizr`](https://github.com/blendbunjaku/optimaizr/blob/main/mods/optimaizr).\n\n`optimaizr profile` reads the sessions already on your machine and puts spend,\nwaste and the biggest fix on one screen.\n\n```\n  Spend                     $476.70  $452.56/month at the last 30 days' rate\n  Calls                       4,062\n  Tokens                     743.4M  739.7M in / 3.7M out\n\n  Flagged calls                 931  22.9% of calls\n  Potential savings       $44.59/mo  $542.48/year\n\n  ! Model mismatch\n\n    17% of your requests use a model whose capabilities exceed the\n    detected workload requirements.\n    671 calls affected.\n```\n\n`optimaizr why` breaks spend down by provider, model, project and kind of work,\neach level as a share of the one above.\n\n```\n  $132.47 total  across 1,807 requests\n\n    anthropic                         $132.47  100% 1807 calls\n      -> sonnet-5                         $99.47   75% 1640 calls\n        -> kopshti-back                   $93.34   94% 1541 calls\n          -> Mechanical                   $36.11   39% 746 calls\n          -> Reasoning                    $27.52   29% 335 calls\n          -> Generation                   $15.22   16% 141 calls\n```\n\n`optimaizr live` runs beside your agent and raises a fix the moment a pattern\nshows up. Press **Y** and your app switches from its next request, and so does\nClaude Code with the [optimAIzr mod](#new-in-080-inside-claude-code). Without\nit, Claude Code switches from its next session.\n\n```\n  ⚡ optimAIzr\n\n  This task looks suitable for a cheaper model.\n\n  Current:       Sonnet 5\n  Suggested:     Haiku 4.5\n  Observed cost: $0.202 / 26 calls\n\n  [Y] Apply optimization\n  [N] Continue\n  [D] Why?\n```\n\nEvery finding comes with its own arithmetic: what the traffic costs now, what it\nwould cost after, and how far to trust the figure. `--why` prints the full\ncalculation and every assumption.\n\n```\nMEDIUM  441 mechanical calls ran on an over-specified model\n        $5.76/mo est.  |  $70.12/yr  |  needs verification  |  model-selection\n\n        now    $14.07  ->  after     $6.75  (441 calls, 12% of spend)\n        confidence medium   quality impact medium   basis estimated\n```\n\n`optimaizr verify` replays your own recorded requests on the cheaper option and\nscores the answers against your quality bar, so you never trade cost for worse\noutput.\n\n``` php\n   PASS   40 samples replayed\n\n  cost/call   $0.0121 -> $0.0034\n  projected   $61.40/mo saved\n  this check cost you $0.38\n\n  Quality checks\n    ok   no-refusal               candidate 40/40, baseline 40/40\n    ok   tool-name-matches        candidate 39/40, baseline 39/40\n```\n\nOn Claude Pro, Max or Team, `--plan pro` shows your 5-hour sessions and how much\nof each goes on waste. On ChatGPT plans it reads OpenAI's own meter from Codex.\nOn a company budget, `--budget 300` names the day the money runs out.\n\n```\n  ChatGPT Plus            $20.00/mo  what you pay\n  API-equivalent         $117.72/mo  5.9x what you pay\n  5-hour window                 82%  used · resets 01:49 · a full window ~$4.76\n  Weekly window                 38%  used · resets Sep 25, 22:49\n  Waste                          9%  fix it and you'd hit the limits ~10% later\n```\n\n| Source | Setup | \n|---|---|\n| Claude Code | None. Reads `~/.claude/projects` . | \n| Codex | None. Reads `~/.codex/sessions` . | \n| Your Anthropic/OpenAI app | One line: `optimaizr.wrap(new Anthropic())` | \n| A usage export (CSV, JSON) | `optimaizr import usage.csv` | \n\n13 detectors cover oversized models, cache misses, bloated prompts, repeated file reads, retry loops, runaway reasoning, cost spikes and more.\n\n| Command | What it answers | \n|---|---|\n| `optimaizr profile` | Where am I wasting the most? | \n| `optimaizr why` | Where does the money go? | \n| `optimaizr live` | What is wasting tokens right now? | \n| `optimaizr mod` | Is the Claude Code mod installed and running? | \n| `optimaizr recommend` | What can I change, ranked by saving? | \n| `optimaizr simulate <rule>` | What would the change save? | \n| `optimaizr verify <rule>` | Does the output still hold up on my traffic? | \n| `optimaizr apply <rule>` | What exactly do I change? | \n| `optimaizr report` | A shareable HTML report | \n| `optimaizr card` | Your last 30 days as an image to post | \n\nRun `optimaizr --help` for everything.\n\nEverything runs on your machine and stays in `~/.optimaizr/`. The only network\ncalls are `verify` (to your own provider, with your own key) and the optional\nJev second opinion. [SECURITY.md](https://github.com/blendbunjaku/optimaizr/blob/main/SECURITY.md) lists every file read and\nwritten.\n\n- [Package README](https://github.com/blendbunjaku/optimaizr/blob/main/apps/cli/README.md) : the full usage guide\n- [CLI reference](https://github.com/blendbunjaku/optimaizr/blob/main/docs/CLI.md) : every command, flag and figure explained\n- [Changelog](https://github.com/blendbunjaku/optimaizr/blob/main/CHANGELOG.md)\n- [optimaizr.com/docs](https://www.optimaizr.com/docs)\n\n| Path | Contents | \n|---|---|\n| `apps/cli` | The `optimaizr` command, published to npm | \n| `packages/core` | The analysis engine: pricing, ingestion, rules, reports | \n| `packages/local` | The Node host: `wrap()` , the local ledger, live tailing, replay | \n| `mods/optimaizr` | The Claude Code mod, installed from this repo's marketplace | \n\n```\nnpm install && npm run build && npm test\n```\n\nRequires Node 20.11+. See [CONTRIBUTING](https://github.com/blendbunjaku/optimaizr/blob/main/docs/CONTRIBUTING.md).\n\noptimAIzr Pro, the hosted product coming to\n[optimaizr.com](https://www.optimaizr.com), is separate from this repository.", "url": "https://wpnews.pro/news/optimaizr-analyze-and-optimize-your-claude-code-usage", "canonical_source": "https://github.com/blendbunjaku/optimaizr", "published_at": "2026-10-03 17:54:19+00:00", "updated_at": "2026-10-03 18:06:36.323725+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "large-language-models"], "entities": ["optimAIzr", "Blend Bunjaku", "Claude Code", "Codex", "Anthropic", "npm"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/optimaizr-analyze-and-optimize-your-claude-code-usage", "markdown": "https://wpnews.pro/news/optimaizr-analyze-and-optimize-your-claude-code-usage.md", "text": "https://wpnews.pro/news/optimaizr-analyze-and-optimize-your-claude-code-usage.txt", "jsonld": "https://wpnews.pro/news/optimaizr-analyze-and-optimize-your-claude-code-usage.jsonld"}}