ClaudeMods
☰
JA
● — 人がオンライン ・閲覧 — 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 blendbunjaku

optimaizr

Claude Code プラグインで、スピナーとプロンプトバンドにターンごとのコストと 5 時間プラン使用量をライブ表示し、`optimaizr live` からのモデル/エフォート切り替えを適用し、会話キャッシュの有効期限前にカウントダウンし、`/optimaizr handoff` ノートを提供し、リトライループを防止します — すべてローカルで実行されます。

blendbunjaku@blendbunjaku

blendbunjaku/optimaizr/tree/main/mods/optimaizr

翻訳済み

この mod について

optimAIzr は、セッションのコストを Claude Code インターフェースに直接表示します。スピナーには現在のターンのコストとウィンドウの埋まり具合が表示され、プロンプトの上のバンドにはプランウィンドウの状態とリセット時間が表示され、各回答には 1 行のコスト概要が付きます。/optimaizr はセッションの支出と節約、プランウィンドウを出力し、/optimaizr hud はゲージとスパークラインを描画し、/optimaizr handoff は Claude が短いメモを書いて、古い会話を読み直さずに新しい会話を開始できるようにします。また、キャッシュの有効期限前にコスト警告付きでカウントダウンし、2 回同じ失敗の後はコマンドを変更せずに保持してリトライループを断ち切ります。optimaizr live で受け入れられた切り替え(モデルまたはエフォート)は、次のリクエストから実行中のセッションに適用されます。インストール: /plugin marketplace add blendbunjaku/optimaizr の後に /plugin install optimaizr@optimaizr。Claude Code 2.1.287+ が必要です。自分自身のセッションを通じて発行されるハンドオフ要求を除き、完全にローカルです。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add blendbunjaku/optimaizr
claude plugin install optimaizr@optimaizr
原文 / README

optimAIzr for Claude Code

A Claude Code mod from optimAIzr. It puts what your session costs where you work, lets optimaizr live switch the model or effort of the session you are in, and shows what each switch saved.

/plugin marketplace add blendbunjaku/optimaizr
/plugin install optimaizr@optimaizr

Needs Claude Code 2.1.287 or later.

What it adds

  • The spinner shows what the turn has cost so far and how full your 5-hour window is: Thinking · $0.18 · 61% of 5h…
  • The band above the prompt shows the window, how long it lasts at this pace and when it resets: 61% of 5h · ~2h 25m left at this pace · resets 01:00
  • Each answer gets one line: optimaizr: this turn $0.18 · 4 requests · 5h 55% → 56%
  • What a switch saved: a switched turn's line leads with it, e.g. saved $0.10 vs Opus 5.5 · this turn $0.10 on Sonnet 5.5 · …, and the band keeps a running total. It is the same tokens priced on both models.
  • /optimaizr prints the session's spend, what it saved, both plan windows and any switch. /optimaizr hud shows it as gauges and a sparkline.
  • Switches that pay: subagents switch at once; a long conversation waits until reloading it into the new model pays back, and the band says so.
  • Before the cache expires: Claude Code caches the conversation for an hour. Once it carries 50K tokens or more, the band counts down the last 15 minutes, cache warm 10m more, then 300K is written again ($2.40), and one toast comes 5 minutes before. After it expires, the band says what the next message will cost. Past 200K, it says what each request re-reads.
  • /optimaizr handoff: Claude writes a three-line note (done, next, the file to start from) while the cache is still warm, so it costs cents. /clear, and the next conversation in that project starts from the note instead of re-reading the old one. A note is used once and expires after 12 hours.
  • A guard against retry loops: when the same command fails twice in a row with nothing changed, the next identical attempt is held once and Claude is asked to change something first.
  • Switches. Press Y on a model swap in optimaizr live and running sessions in that project use the new model from their next request. A reasoning-effort finding lowers effort the same way. The first switched request leaves a note, and the band names the model. Harder task? /optimaizr off goes back for this session, /optimaizr on resumes, and optimaizr undo <rule> takes it back everywhere.

Options

| Option | Default | What it does | | ------------ | ------- | --------------------------------------------- | | turnLine | true | The line under each answer with what it cost. | | retryGuard | true | Hold a command that failed twice unchanged. |

Privacy

It reads the usage figures Claude Code already shows you (cost, token counts, context fill, plan windows) and the commands Claude runs, kept in memory for the retry guard. It never reads your prompts or file contents and makes no network calls of its own. It reads ~/.optimaizr/overrides.json and writes one small file per session to ~/.optimaizr/mod/sessions, which is how optimaizr live knows it is running. That file also carries Claude Code's own 5-hour and weekly meters, so optimaizr profile and optimaizr live can show your real windows. /optimaizr handoff is the one exception to "no text": only when you run it, it asks Claude for a note through your own session and saves the reply to ~/.optimaizr/mod/handoffs, one file per project, which the next conversation there reads once. Nothing leaves your machine besides that one request to Claude. claude plugin validate on this folder lists every call it makes.

Develop

claude --plugin-dir mods/optimaizr     # reloads on save
claude plugin validate mods/optimaizr
claude plugin test mods/optimaizr

The tests were last run on Claude Code 2.1.286, where mods still needed CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. From 2.1.287 they are on by default.

関連作品