Who it is forA Claude Code user who returns to a long conversation after a break and gets a surprise bill from the first message.
The problemAfter the cache expires, the next message writes the whole conversation again, at up to twice the input price.
The outcomeExpensive messages are held once with their price, and you decide whether to send them, clear the conversation or switch to a cheaper model.
What you need first
- Node.js 20.11 or later (22.13 or later to read opencode history)
- Existing usage logs from Claude Code, Codex or opencode on this machine
- A terminal
Steps
- Run
optimaizr statusline onto show the cache countdown under Claude Code's prompt. - Run
optimaizr guard onto hold expensive messages. - When a message is held, read its cost, then send it again to go ahead or type /clear to start fresh.
- Run
optimaizr guardto list what was held.
Prompt for your agent
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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for blendbunjaku/optimaizr and "Hold expensive Claude Code messages before they go"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer