by blendbunjaku
Spend fewer tokens on the same work. A local CLI that finds wasted tokens in Claude Code, Codex, opencode and your own API calls.
# Add to your Claude Code skills
git clone https://github.com/blendbunjaku/optimaizrGuides for using cli tools skills like optimaizr.
Last scanned: 10/14/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-10-14T09:21:16.206Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how optimaizr compares with popular alternatives.
optimaizr is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by blendbunjaku. Spend fewer tokens on the same work. A local CLI that finds wasted tokens in Claude Code, Codex, opencode and your own API calls. It has 184 GitHub stars.
Yes. optimaizr passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/blendbunjaku/optimaizr" and add it to your Claude Code skills directory (see the Installation section above).
optimaizr is primarily written in TypeScript. It is open-source under blendbunjaku on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh optimaizr against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
Spend fewer tokens on the same work.
In a long Claude Code session, most of what you pay for isn't Claude writing code. It's Claude re-reading your conversation on every call, cheap per token but paid again and again (41% of my last 30 days), and writing it into the cache again after a break, at up to twice the input price: 58 of those cost me $98.83 in the same 30 days, where a warm cache would have read it for $2.48. optimAIzr shows where your tokens go, holds the expensive message before it is paid, and fixes what it can in one command. For Claude Code, Codex and opencode.
npx optimaizr
Runs locally: nothing leaves your machine. No account, no upload, no
telemetry. It reads the logs your agents already keep (~/.claude, ~/.codex,
opencode's database), keeps what it learns in ~/.optimaizr/, and by default
never reads your prompts or Claude's answers, only token counts. Guard, once you
turn it on, keeps a short note from your last prompt for /clear, deleted once
read or after 30 minutes. More under Privacy below.
Your Claude Pro did $801.89/mo of work at API prices: 40x what you pay
Up to 30% of it can be saved: about 1.4x the work per 5-hour window and per
week, if you take every step below.
Where the 30% comes from
Compact earlier 18%
Cold cache returns 8%
Smaller default model 3%
6 smaller ones 1%
Each is taken from what the ones above leave, so nothing counts twice.
Where it goes
Re-reading the conversation 41% ████████░░░░░░░░░░░░
Loading context into cache 34% ███████░░░░░░░░░░░░░
Answers, code and thinking 25% █████░░░░░░░░░░░░░░░
The cache countdown. Claude Code keeps a conversation cached for an hour. Come back later and your first message writes all of it again. One command puts a countdown under Claude Code's prompt, with what coming back will cost.
optimaizr statusline on
◉ optimAIzr · 161.0K context, $0.032/call to re-read · cache warm 12m, then $1.29 to write again · leaving? handoff note, then /clear · 5h 61%
Guard: the expensive message, held once. With optimaizr guard on, a
message to a long conversation whose cache has expired is held once, with what
sending it would cost: on a Claude plan, its share of your 5-hour limit first.
Mine, after 3 days away:
optimAIzr held this message once. The conversation has been idle 3 days and its
cache expired, so sending it writes all 162K tokens again: about 3% of your
5-hour limit ($1.30 at API prices, Opus 5.5).
It was not sent: copy it from Original prompt below. Send it again to go ahead,
or type /clear and send it there: the new conversation starts from a short note
of where this one stood.
On Sonnet 5.5 the same rewrite is about 2% ($0.65): /model sonnet, then send it again.
Send it again and it goes through. Over my last 30 days, 40 messages like this
one wrote their conversation into the cache again for $90.26, where a warm
cache would have read it for $2.26. Guard also stops Claude reading a big file
whole, or running a command that failed twice a third time unchanged, nudges
/compact before a conversation compacts in the middle of a task, and warns
once when your pace will run out the 5-hour limit before it resets. It uses
Claude Code's own hooks, no mod, and optimaizr guard lists what it held.
Live, beside your agent. optimaizr live keeps a row for each open
conversation: a spinner and the cost so far while Claude works, how long the
cache stays warm once it stops. It warns when context jumps or passes 200K, and
5 minutes before a cache expires. ? shows what it checked, n the next
step for the biggest finding, a applies it. After each turn it says what
that turn cost and how much of your 5-hour window it took, and --notify sends
a system notification when the terminal is out of sight.
Where long sessions turn expensive. optimaizr sessions opens with your
costliest conversations, by the title Claude Code gave them, and what each one
took of your 5-hour window (mine, with the titles changed):
Costliest conversations (subagents included)
cost of 5h worked conversation
$91.16 ~220% 1h 53m Refactor payment webhook handling
$89.81 ~217% 2h 21m Migrate auth to session tokens
$74.40 ~179% 2h 36m Build analytics dashboard filters
$71.99 ~174% 2h 25m Add search indexing pipeline
$62.39 ~150% 3h 37m Fix flaky checkout integration tests
The top 5 of 80 conversations, 48% of spend.
5h share at $0.415 per 1%, learned from 8 windows of your plan meter.
Then it finds the context size where re-reading takes over, what each cache write was for, which conversations shared each 5-hour window, and every time a cache expired before the next call, with who was waiting:
Cold cache returns
58 times a long conversation's cache had expired by its next call, and
all of it was written again: 12.4M tokens for $98.83, where a warm
cache would have read it for $2.48.
you were away 51 $93.72
Claude was waiting on a tool 7 $5.11
optimaizr apply context-compaction # Claude Code and Codex compact at 200K
optimaizr undo context-compaction # and back
optimaizr results # did it work?
results compares the days after a change with the days before it, on your
own usage, and marks every row that got worse, so you see what a saving cost.
Every finding says what happened, why it matters and what it saves, in dollars from your own logs. Savings are split into clear waste, likely, and "up to". The total takes each one from what the others leave, so no saving is counted twice: a plain sum of mine would have said 33%, not 30%.
The numbers above are one person's history: mine. npx optimaizr card makes
an image of your last 30 days with totals only, no project names, paths or
prompts, to post wherever you compare notes. If you applied a fix, add
optimaizr results, even when it says the fix didn't work.
The optional optimAIzr mod runs inside the session: the cost of each answer and
your 5-hour window as you work, Y in live moves the session you're in to a
cheaper model, and /optimaizr handoff writes a note to start fresh from.
⏺ optimaizr: this turn $0.18 · 2m 10s · 4 requests · ~0.4% of 5h
optimAIzr █████████░░░░░░░ 56% of 5h · resets 15:00
/plugin marketplace add blendbunjaku/optimaizr
/plugin install optimaizr@optimaizr
| Command | What it does |
|---|---|
optimaizr |
Where your tokens go, and what to fix first |
optimaizr live |
Watches every open conversation while you work |
optimaizr guard on |
Holds an expensive message once, before it goes |
optimaizr statusline on |
The cache countdown under Claude Code's prompt |
optimaizr sessions |
Where long conversations start to cost more |
optimaizr why |
Spend by model, project and kind of work |
optimaizr apply <rule> |
Applies a fix; undo <rule> takes it back |
optimaizr results |
Did it work? The days after against before |
optimaizr verify <rule> |
Replays your own requests on the cheaper option |
optimaizr card |
Your last 30 days as an image to post |
optimaizr help lists the rest, optimaizr help all every view.
Claude Code, Codex and opencode 1.x with no setup. opencode history is read
from ~/.local/share/opencode/opencode.db (under $XDG_DATA_HOME when that is
set) and needs Node 22.13 or later. History from opencode 2.0 isn't read yet.
Reports, live and the steps in apply cover all three;
apply context-compaction changes Claude Code and Codex only.
Your Claude plan (Pro, Max, Team) and ChatGPT plan are detected. Your own app
with one line, optimaizr.wrap(new Anthropic()) or new OpenAI(), and CSV or
JSON usage exports. Node 20.11 or later.
/clear starts fresh from a short note of where it stood.
live shows every open conversation with its cache countdown, results marks
every trade-off, and open models in opencode are priced. In 0.12.1: the
profile opens with everything it found, together and never counted twice (up
to 30% of my usage, about 1.4x the work per 5-hour window and per week), your
5-hour limit is learned from Claude Code's own transcripts, and guard warns
when your pace will run it out. Tried on my history, it came before all 7 of
my stops, 67 minutes ahead on the median.