Skip to content
NewMinniCode is out now, in Experimental Beta.Get MinniCode→
Minni AI
DemoEvidenceService
Products
Products
  • MinniMemoryMCPFlagship, early accessMemory for your AI agentSplits your agent’s memory into a small always-on part and files that load only when a task needs them.
  • MinniCodeExperimental BetaOpen-LLM optimized, low token coding agentA low token terminal coding agent, optimized for open LLMs. Reads, edits, tests and opens pull requests.
  • MinniTunerExperimental Beta, WindowsHardware optimization agentTunes how your PC uses its CPU, GPU and RAM. One plan you approve, every change undoable.
DocsMinniMemoryMCP docsInstall it, the commands, undoMinniCode docsInstall it, pick a model, the commandsMinniTuner docsThe tiers, Ask Minni, what is sent
See it workDemoThe full tour in one videoHow it worksEach product, step by step
Resources
LearnGuidesFAQnpm package
CompanyContactSupportPrivacyTermsData handlingSecurity

Guides

How to lower a Claude Code or Codex API bill

On an API key you pay per token, and a coding agent sends the whole session again with every request. So the bill follows the size of the context more than the number of questions you ask. To lower it, keep sessions short, load less memory on every turn, match the model to the job, and measure the same task before and after each change.

Updated 2026-11-16

What you are billed for#

A request is made of four kinds of token. Fresh input is text the model has not seen in this session. A cache write stores the start of the request so the next one can reuse it. A cache read is that reused part, billed at a small fraction of the input price. Output is what the model writes back, its thinking included, and it costs the most per token.

In an agent session the cache lines carry most of the volume, because the same session is read back on every turn. That is why two people asking the same question can pay very different amounts: one asks it in a fresh session, the other at the end of a long one.

Where a high bill usually comes from#

Anthropic’s cost docs name the two usual causes of unexpectedly high spend on an API plan: long sessions that were never cleared, and the largest model left as the default. The rest of the list is the same in any coding agent:

  • Memory files that grew. CLAUDE.md and AGENTS.md are sent with every request, whether the task needs them or not.
  • Long tool output. A full log read into context is paid for again on every later turn.
  • Cache misses. The first message after a long break processes the whole context again at the write price.
  • Parallel agents. Subagents and agent teams each send their own requests.
  • Unused MCP servers. Each one adds to what the model carries.

The levers, in each tool#

LeverClaude CodeCodex
Start fresh between tasks/clear; /rename first to come back with /resumeStart a new session
Shrink the history/compact with what to keepA short handoff note into a new session
Use a smaller model/modelPick the model per task; avoid the fast modes for routine work
Lower reasoning effort/effortLower the reasoning effort
Shorten memoryCLAUDE.md under 200 lines; workflows into skillsA shorter AGENTS.md, nested per folder
Drop unused servers/mcp, and /context to see what fills the windowDisable the MCP servers you do not use
See the numbers/usage/status

Asking for shorter answers helps in both.

For a team on the Claude API, the Claude Console has workspace spend limits and per-member cost reporting, so one runaway session does not become a surprise at the end of the month.

A measured before and after#

Memory is the lever that pays on every turn, so it is the one we measured. We asked the same 30 questions in Claude Code 2.1.325 on Claude Sonnet 5.5, three full sessions a side: once with a test memory in the layout Claude Code itself writes, as it was, and once after MinniMemoryMCP 1.6.0 sorted it, with its server and hook on.

Token kindBeforeAfterChange
Fresh input490256-47.8%
Cache write134,04196,034-28.4%
Cache read4,133,0842,152,150-47.9%
Output46,52028,142-39.5%

Measured 15 November 2026: at API rates, a Claude Code session on our test memory cost $0.47 before MinniMemoryMCP 1.6.0 and $0.29 after on average, 37.7% less, for the same 30 questions (each of three sessions 33.9% to 40.0% less). A blind judge found 80 of 87 answers correct before and 81 after. The method, the date and the build are on the Evidence page.

The change was made by MinniMemoryMCP, an MCP server for Claude Code and Codex. It sorts your memory files into a small part that loads on every turn and files the agent opens only when a task needs them. Every line is kept, and undo puts the originals back.

install it for Claude Code
$ npm i -g minnimemory
$ minnimemory install

Measure your own#

Pick one task you do often. Run it in a fresh session, note the token counts and cost, change one thing, and run it again. In Claude Code the Session block of /usage lists input, output, cache read and cache write tokens with an estimated cost. Comparing two different days of work tells you nothing; the same task twice does.

More detail per tool: How to reduce Claude Code token usage, How to reduce Codex token usage and Why Claude Code sessions get expensive.

Try MinniMemoryMCP

Free, runs on your computer, and every change can be undone. Two commands install it for Claude Code; the docs cover Codex and the rest.

install it for Claude Code
$ npm i -g minnimemory
$ minnimemory install

More guides

  • How to reduce Claude Code token usage

    Where the tokens go each turn, and eight ways to spend fewer.

    Updated 2026-11-16 · Minni AI

  • Claude Code usage limit reached: what to do, and how to hit it less

    What each limit message means, what to do now, and how to send less every turn.

    Updated 2026-11-16 · Minni AI

  • CLAUDE.md too long: what Claude Code does with it, and how to split it

    What a long CLAUDE.md costs, the real size limits, and four ways to cut it.

    Updated 2026-11-16 · Minni AI

  • Claude Code context window keeps filling up: why it compacts, and what to do

    What fills the window, what compaction keeps, and how to compact less often.

    Updated 2026-11-16 · Minni AI

  • How to reduce Codex token usage

    Where Codex spends tokens, and seven ways to spend fewer.

    Updated 2026-11-16 · Minni AI

  • Codex usage limits: why they drain and how to use fewer tokens

    How the windows work, how to check what is left, and what uses the allowance up.

    Updated 2026-11-11 · Minni AI

  • AGENTS.md too large: what Codex cuts off and how to split it

    The 32 KiB cap, how to see which files load, and five ways back under it.

    Updated 2026-11-11 · Minni AI

  • Why Claude Code sessions get expensive

    Every turn re-sends the whole session. What makes that grow.

    Updated 2026-11-05 · Minni AI

  • Claude Code memory: CLAUDE.md vs MinniMemoryMCP

    What belongs in CLAUDE.md, and splitting the rest out by hand or with a tool.

    Updated 2026-11-16 · Minni AI

  • MinniMemoryMCP vs Mem0, Zep, supermemory and Letta

    Four tools add memory to an agent. MinniMemoryMCP cuts what the agent already loads. When each fits.

    Updated 2026-11-16 · Minni AI

  • How Claude Code remembers across sessions

    What carries over between sessions, what does not, and how to keep it small.

    Updated 2026-11-16 · Minni AI

  • Where Claude Code keeps its memory

    Every memory path on your machine, what each file is for, and which ones load every turn.

    Updated 2026-11-07 · Minni AI

  • How to run a coding agent on free, open models

    What a free key gets you, what a local model can do, and where the tokens go.

    Updated 2026-10-25 · Minni AI

  • Get a free NVIDIA API key for a coding agent

    Where the key comes from, where to keep it, and how to run a coding agent on it.

    Updated 2026-11-07 · Minni AI

  • What a Windows PC optimization agent should and should not touch

    The settings worth changing, the ones that are placebo, and the ones that break things.

    Updated 2026-10-25 · Minni AI

GuidesMinniMemoryMCPHome
© 2026 Minni AI. All rights reserved.