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 reduce Codex token usage

Codex sends more than your prompt. Every request carries your AGENTS.md chain, the earlier conversation, the output of every command still in context, and the tools your MCP servers add. So the biggest savings come from a shorter AGENTS.md, a fresh session for each task, prompts that name the files, and fewer MCP servers. OpenAI gives the same advice on its Codex pricing page.

Updated 2026-11-16

Where a Codex turn’s tokens go#

A model keeps nothing between requests, so Codex sends the context again each time. Four things fill it:

  • The instruction chain. When a session starts, Codex reads your user AGENTS.md, then one file per folder from the repo root down to your working directory, and joins them. That text stays in context for the whole session.
  • The conversation. Every earlier message, and every answer.
  • Tool output. File reads, command output, test logs and search results stay in context after the step that produced them.
  • MCP servers. Each server you attach adds its tools to what the model has to carry.

OpenAI’s pricing page says usage depends on the model and on the size and complexity of the task, and that context, reasoning, tool use and caching all count. It also says prompt length alone is not a reliable estimate. A ten-word prompt in a heavy session can cost more than a long prompt in a fresh one.

Seven things that cut token usage#

1. Shorten AGENTS.md#

Everything in the chain is sent with each request, whether the task needs it or not. Keep the rules the agent needs on every turn. Move the rest out: build steps for one service, a migration checklist, the history of a past decision. For a larger project, OpenAI suggests nesting smaller files inside the folders they apply to, so a session in one folder does not carry the rules for another.

2. Start a new session for a new task#

A long session carries everything that happened in it. When you switch to unrelated work, start fresh. If you need to carry something over, ask Codex for a short handoff note first and paste it into the new session.

3. Name the files and the output#

A broad prompt makes the agent search and read widely. Give it the paths that matter and say what you want back: who it is for, the format and the length. Separate the required work from the optional improvements, so it does not do both by default.

4. Keep long output out of the session#

A full test log or build log read into context stays there. Ask for the failing lines or the last part of the output, not the whole file.

5. Limit MCP servers#

Disable the servers you are not using. This is on OpenAI’s own list of ways to make limits last.

6. Match the model and mode to the job#

Usage depends on the model, and the faster modes draw on your limits at a higher rate than the standard one. Routine edits do not need the largest model or the highest reasoning effort. A local message can also use less of your allowance than a cloud task.

7. Ask for shorter answers#

Output is the most expensive kind of token. Ask for the result, not a walk through how the agent got there.

Doing the first fix with a tool#

MinniMemoryMCP is an MCP server that works in Codex and Claude Code. It reads the AGENTS.md chain a session loads and shows you a map of it: each file, its size, whether it loads, and the cap in force. That alone tells you where the weight is.

install it for Codex
$ npm i -g minnimemory
$ minnimemory install --host codex
  1. Open Codex and run /hooks once to trust the two minnimemory hooks. Codex skips a hook it does not trust.
  2. Ask Codex to run init. It maps the chain and previews the split: what stays in AGENTS.md and what moves to files Codex opens only when a task needs them.
  3. Ask it to apply the plan. One apply covers every file the session loads, each with its own backup, and one undo puts them all back.

A file Codex already loads whole, under the cap, is left as it is, and init says so. In our tests splitting a small file cost recall, so the split is for a chain that has outgrown the cap. AGENTS.md too large explains the cap.

Our measured session result is from Claude Code, where the same split applies to CLAUDE.md: 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 (each of the three sessions 33.9% to 40.0% less). A blind judge found 80 of 87 answers correct before and 81 after. The method is on the Evidence page.

How to check it worked#

Run /status in a Codex session to see your remaining limits, and compare the same kind of task before and after a change, not two different days of work. If you are on a plan and keep running out, Codex usage limits covers how the windows work. The Claude Code version of this guide is How to reduce Claude Code token usage.

Try MinniMemoryMCP

Free, runs on your computer, and every change can be undone. It maps the AGENTS.md chain Codex loads and trims it when it is over the cap. The product page and the docs cover the rest.

install it for Codex
$ npm i -g minnimemory
$ minnimemory install --host codex

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

  • 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

  • How to lower a Claude Code or Codex API bill

    What a coding agent bills on an API key, and the levers that move it.

    Updated 2026-11-16 · 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.