# AI use cases for Optimaizr (blendbunjaku/optimaizr)

Repo: [blendbunjaku/optimaizr](https://github.com/blendbunjaku/optimaizr) | Use cases: 4 | Page: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/

A local CLI that finds wasted tokens in Claude Code, Codex, opencode and your own API calls, and fixes some of it.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Find where Claude Code tokens are wasted: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/find-wasted-claude-code-tokens/
- Hold expensive Claude Code messages before they go: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/hold-expensive-claude-code-messages/
- Track token use in your own Anthropic or OpenAI app: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/add-token-tracking-to-own-api-app/
- Check whether compacting at 200K actually saved money: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/check-context-compaction-results/

## How to find where Claude Code tokens are wasted with Optimaizr

Repo: [blendbunjaku/optimaizr](https://github.com/blendbunjaku/optimaizr) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Run one report on your local logs to see savings ranked by how sure they are, in dollars.

**Who it is for:** A developer on a Claude Pro or Max plan whose usage limits run out early and who wants to know why.

**The problem:** In a long session most of the spend goes to re-reading the conversation, which is hard to see from the bill.

**The outcome:** A ranked list of savings from your own logs, split into clear waste, likely and up to, with spend broken down by model, project and kind of work.

### Steps

1. Run `npx optimaizr` in a terminal.
2. Read the Savings found section and the Where it goes breakdown.
3. Run `optimaizr sessions` to see your costliest conversations.
4. Run `optimaizr why` to see spend by model, project and kind of work.

### Prompt to paste into your agent

```text
Run `npx optimaizr` from the optimaizr repo (github.com/blendbunjaku/optimaizr) on this machine and report the Clear waste and Re-reading the conversation figures. Verify that the savings are reported per month and that the three savings tiers are not added together.
```

### Caveat

All figures come from logs on your machine, and the README's sample numbers are the author's own usage, not yours.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/find-wasted-claude-code-tokens/

## How to hold expensive Claude Code messages before they go with Optimaizr

Repo: [blendbunjaku/optimaizr](https://github.com/blendbunjaku/optimaizr) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Guard holds a message to an idle long conversation once, with its cost, and a cache countdown shows time left.

**Who it is for:** A Claude Code user who returns to a long conversation after a break and gets a surprise bill from the first message.

**The problem:** After the cache expires, the next message writes the whole conversation again, at up to twice the input price.

**The outcome:** Expensive messages are held once with their price, and you decide whether to send them, clear the conversation or switch to a cheaper model.

### Steps

1. Run `optimaizr statusline on` to show the cache countdown under Claude Code's prompt.
2. Run `optimaizr guard on` to hold expensive messages.
3. When a message is held, read its cost, then send it again to go ahead or type /clear to start fresh.
4. Run `optimaizr guard` to list what was held.

### Prompt to paste into your agent

```text
In the optimaizr repo (github.com/blendbunjaku/optimaizr), run `optimaizr guard on` and then `optimaizr guard` on this machine. Report how many messages were held and the cost each would have written. Verify that a held message was not sent until it was sent again.
```

### Caveat

Guard depends on Claude Code's own hooks, and the README does not say how it behaves in other tools.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/hold-expensive-claude-code-messages/

## How to track token use in your own Anthropic or OpenAI app with Optimaizr

Repo: [blendbunjaku/optimaizr](https://github.com/blendbunjaku/optimaizr) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Wrap your existing API client in one line so optimAIzr can read your app's calls.

**Who it is for:** A developer building an app on the Anthropic or OpenAI API who wants to see which calls spend the most tokens.

**The problem:** An API bill shows totals but not which calls re-send too much context or repeat work.

**The outcome:** Your app's API calls are wrapped so that the same optimAIzr report covers them alongside your other usage.

### Steps

1. Install the package with `npm install optimaizr` in your app's project. (inferred, check the README)
2. Wrap your client with `optimaizr.wrap(new Anthropic())` or `optimaizr.wrap(new OpenAI())`. (inferred, check the README)
3. Run your app once so it makes its usual API calls.
4. Run `npx optimaizr` to see where your tokens go.

### Prompt to paste into your agent

```text
In the optimaizr repo, wrap the API client in <app path> with optimaizr.wrap, run the app once, then run `npx optimaizr` and report the Where it goes breakdown. Verify that the app still returns the same responses it returned before the wrap.
```

### Caveat

The README does not say exactly what the wrapped client reports, so check the output after one run.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/add-token-tracking-to-own-api-app/

## How to check whether compacting at 200K actually saved money with Optimaizr

Repo: [blendbunjaku/optimaizr](https://github.com/blendbunjaku/optimaizr) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Apply the change, wait several days, then compare cost per prompt and each trade-off to the days before.

**Who it is for:** A Claude Code or Codex user who wants proof that a context-size change cut cost before keeping it.

**The problem:** A cost saving can come with more tool calls, errors or waiting, and it is unclear whether the change caused them.

**The outcome:** A before and after table where every worse row is marked as a trade-off, plus a one-command way to undo the change.

### Steps

1. Run `optimaizr apply context-compaction`.
2. Use Claude Code or Codex normally for several days.
3. Run `optimaizr results` to compare the days after with the days before.
4. If the trade-offs are not worth it, run `optimaizr undo context-compaction`.

### Prompt to paste into your agent

```text
In the optimaizr repo, after context compaction has been applied for several days, run `optimaizr results` on this machine and report cost per prompt before and after. Verify that every row that got worse is marked as a trade-off before you draw a conclusion.
```

### Caveat

The README says part of any saving may already have been under way, because the baseline is the days before the change.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/blendbunjaku-optimaizr/check-context-compaction-results/
