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

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

Claude Code compacts when the conversation gets close to the size of the context window: it replaces the history with a summary so the session can go on. If that keeps happening, something is filling the window faster than it should. Part of the window is taken before you type anything, by your CLAUDE.md, auto memory and tool lists. The rest fills with file reads and command output. Shrink what loads at the start, keep long output out, and clear between tasks.

Updated 2026-11-16

What fills the window#

Anthropic’s context window page lists what is in context before you type: CLAUDE.md, auto memory, the names of your MCP tools, and the descriptions of your skills. That part is the same size on every turn of every session.

Then the session adds to it. Each file read goes into context and stays. So does the output of every command, every search result and every answer. Path-scoped rules load next to the files they match. A long test log or a large file can take more room than an hour of conversation.

A warning that the context is nearly full is not a usage limit. It is about the size of this one conversation. If you were stopped by a plan limit, see Claude Code usage limit reached.

What survives compaction, and what does not#

Compaction summarizes the conversation and then puts some things back. This is why an instruction can seem to vanish halfway through a session.

WhatAfter compaction
CLAUDE.md at the project root, and rules with no path scopeRead again from disk and put back
Auto memoryRead again from disk and put back
Files Claude read or editedUp to five are read again, most recently changed first
A CLAUDE.md in a subfolder, and path-scoped rulesGone until Claude touches a matching file again
Instructions you gave only in the conversationSummarized with everything else
Text a hook added earlierSummarized with everything else

So an instruction that must hold for the whole session belongs in the root CLAUDE.md, not in a message. And a compaction is not free: /compact has to read the conversation it summarizes, so compacting a large session is itself a large request.

Six ways to compact less often#

1. Look at what is using the room#

Run /context. It shows the window by category with suggestions, including which CLAUDE.md and auto memory files loaded. Fix the biggest line first.

2. Shrink what loads before you type#

Everything in your CLAUDE.md is in the window from the first turn to the last, and it comes back after every compaction. Anthropic suggests keeping each file under 200 lines. CLAUDE.md too long covers how to split it.

3. Clear between tasks#

Run /clear when you switch to unrelated work. Old conversation crowds out the files you need next. Use /rename first if you want to come back with /resume.

4. Compact on your terms#

Before a long new task, run /compact with what to keep, for example /compact focus on the auth bug fix. The summary then keeps what you chose, not what the automatic pass guessed. /rewind can summarize only part of the conversation.

5. Send large reads to a subagent#

A subagent works in its own context window. The files it reads stay there, and only a summary comes back to your session. Use it for research, log reading and documentation lookups.

6. Trim long output before it lands#

Ask for the failing tests, not the whole run. A hook can do this for you: Anthropic’s cost docs show one that keeps only the last lines of a test command’s output.

Shrinking the startup part automatically#

Step 2 pays on every turn and after every compaction. MinniMemoryMCP does it for you: it sorts your CLAUDE.md or AGENTS.md, MEMORY.md and the files they import into a small part that loads on every turn and files Claude 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

With MinniMemoryMCP 1.6.0 on our test memory, the agent went looking in its memory 17 times instead of 89 over the same 87 answers, and the run used 47.2% fewer tokens. The method is on the Evidence page. For the token side of the same problem, see How to reduce Claude Code token usage.

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

  • 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

  • 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.