SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor · Updated 2026-08-29

Claude memory dey cost extra? Na so billing work

Claude memory no get separate token price. You pay when remembered text enter requests as input tokens, unless prompt caching reduce how much replay dey cost.

Claude memory features dey cost extra?

Claude memory features no get separate price. Anthropic published rates dey based on per million input tokens and per million output tokens, with extra rates for prompt caching. None of these rates dey call memory token. Storing the memory itself no cost anything for Claude API (application programming interface), because memory tool dey for client side and the file dey for storage wey you own.

Memory still fit enter your bill, because remembered fact only changes answer when e dey inside the request wey Claude reads. To remember something means say you go send am again. That text go enter as input tokens, and dem go charge am with the model normal input rate. Two things determine the cost: how many tokens of remembered text you replay for every turn, and whether prompt cache fit serve that replayed text.

For Pro or Max subscription, dem no bill you per token at all. Memory go use your usage allowance instead of your money. The mechanism below remain the same. Na only the unit change. That allowance get limit, so e good make you know how much Claude Pro cost and when its limits go stop you before you decide how much memory every turn suppose carry. Claude Enterprise different again, because e measure every token with API rates on top of the seat price, so oversized memory block go turn back to money instead of allowance. If pruning memory bring your usage well below smaller plan ceiling, moving from Max down to Pro na the next step worth taking, and the change go happen at the end of the period wey you don already pay for. If the comparison wey you dey consider na between providers, instead of between Anthropic own tiers, start with Claude plans compared with ChatGPT at current prices.

Wetin “memory” mean for each Claude surface

Three different products dey use this word, and na mixing dem up dey make this question confusing pass.

The memory tool for Claude API. You add one entry to the tools array and write the file operations for your own code.

{"type": "memory_20250818", "name": "memory"}

As of August 2026, this tool dey generally available for Messages API without beta header, for Claude 4 and later models. Na client-side e dey work: Claude go ask for operation like view /memories, your handler go run am against storage wey you control, then you go return the result inside tool_result block. Anthropic no dey keep the file, so no storage charge dey pass to you. You pay for the round trip instead. The tool definition dey sent for every request, and the file content wey come back go remain for the conversation from that point.

Anthropic publish the fixed part of this overhead. For Claude Opus 5 with tool choice of auto, the tool-use system prompt na 286 tokens, as documented for August 2026. You pay am once for every request whenever any tool dey present, whether na memory or another tool.

Claude Code. Two mechanisms dey load when every session start. CLAUDE.md files hold instructions wey you write. Auto memory hold notes wey Claude write for itself, under ~/.claude/projects/<project>/memory/. Only the first 200 lines or 25KB of MEMORY.md dey load, whichever limit come first. The topic files wey dey beside am dey read on demand, not when startup happen. Everything wey load for startup become part of the prefix wey every later request for that session carry. How Claude Code dey recall memory between sessions explain the loading order file by file.

Claude for web. For claude.ai, memory na set of entries wey Claude write and update as una dey chat, with separate memory space for every project. Settings > Memory show wetin dey stored, and the toggle there get Pause memory or Reset memory. Subscription dey bill this surface, so memory dey use the usage limits here.

Why text wey system remember dey bill as input tokens

Messages API dey stateless. E no keep anything between calls, so your client go send the complete conversation for every turn, and model go read everything again. Memory no be exception to this rule. Na one more block of text inside the same request.

You fit see the split inside the usage object for any response.

"usage": {
  "input_tokens": 412,
  "cache_creation_input_tokens": 0,
  "cache_read_input_tokens": 18240,
  "output_tokens": 236
}

input_tokens dey count only the tokens wey model no read from cache and no use create cache. For practical purpose, na the tokens after the last cache breakpoint. Total input for the request na cache_read_input_tokens plus cache_creation_input_tokens plus input_tokens. Memory file wey Claude open three turns ago dey inside that total for every turn since then. E go enter under cache_read_input_tokens while cached prefix still hold, and under input_tokens when e no hold. Na the same text, but the price fit different well-well. Input and output tokens get different prices, and memory dey always enter the input side.

Where you fit see these numbers for your own usage

No use figure from blog post, including this one. Measure your own memory block. Token counting free and e get its own rate limit, so the measurement no cost anything.

curl https://api.anthropic.com/v1/messages/count_tokens \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "content-type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-opus-5",
    "system": "You are a scientist",
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'

The response na one number, like { "input_tokens": 14 }. Run am once with your memory text pasted inside system field, then run am again without the text. The difference na wetin that memory dey cost you for every turn. Two cautions dey apply. The count na estimate, and extra tokens wey Anthropic add for its own system optimizations no dey bill to you. Also count against the model wey you go actually run, because Claude 4.7 and later dey use newer tokenizer wey dey produce about 30 percent more tokens for the same text.

Inside Claude Code, you fit answer the same question without any curl at all.

  • /context shows wetin load right now, memory files join, so you fit see their share of the window before you type anything.
  • /memory lists your CLAUDE.md files and opens the auto memory folder.
  • /usage prints the session totals, including cache reads and cache writes.
  • The status line fit display context window usage continuously, so you go see the growth as e dey happen.

The /usage session block dey look like this:

Total cost:            $0.55
Total duration (API):  6m 20s
Total duration (wall): 6h 33m 10s
Total code changes:    0 lines added, 0 lines removed
Usage by model:
   claude-sonnet-4-6:  1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)

Read the last line well. The 940.0k cache read figure na the conversation, memory and everything join, wey dey send again for every turn at the cache rate. The 1.2k input figure na only the part wey new. Claude Code dey calculate that dollar amount locally from list prices, so e no include any discount wey you get and e fit differ from your invoice. The Usage page for Claude Console na the authoritative number.

Then run the comparison directly. Ask the same opening question for two fresh sessions, one normal and one with auto memory switched off.

CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 claude

Run /context for each session and compare the memory files entry. The gap na wetin your accumulated memory dey cost for the beginning of every session, before any work start. Full breakdown of where Claude Code token usage dey go worth reading next to those two numbers.

How much replaying memory cost per million tokens?

Prompt caching na the reason why the same memory block fit cost ten times more for one turn than another. Anthropic publishes the cache rates as multiples of each model base input price, so the relationship still hold even when the dollar prices change.

ChartAnthropic's published prompt caching rates, as a multiple of base input price
The data behind this chart
[
  {
    "label": "Base input",
    "price_multiple": 1
  },
  {
    "label": "5 minute cache write",
    "price_multiple": 1.25
  },
  {
    "label": "1 hour cache write",
    "price_multiple": 2
  },
  {
    "label": "Cache read",
    "price_multiple": 0.1
  }
]

A cache read cost 0.1 times the base input price. To write an entry with 5 minute lifetime cost 1.25 times the base price, while 1 hour lifetime cost 2 times the base price. Anthropic explain the break-even point clearly: caching pay after one cache read for 5 minute duration, or after two cache reads for 1 hour duration. The break-even point for prompt caching na the calculation to run before you decide where memory go stay.

Those multiples turn replay count into arithmetic. The next block na arithmetic from the published multiples above, not measurement from any live workload. E price one memory block in three ways over a 100 turn session, expressed as the equivalent number of tokens charged at the plain base input rate.

ChartA memory block over 100 turns, expressed as base-rate input tokens
The data behind this chart
[
  {
    "label": "4,000 tokens, never cached",
    "base_rate_equivalent_tokens": "400,000"
  },
  {
    "label": "4,000 tokens, 1 write and 99 reads",
    "base_rate_equivalent_tokens": "44,600"
  },
  {
    "label": "1,000 tokens, 1 write and 99 reads",
    "base_rate_equivalent_tokens": "11,150"
  }
]

A 4,000 token memory block wey miss cache for all 100 turns go bill like 400,000 base-rate tokens. The same block behind one 5 minute cache write and 99 cache reads go bill like 44,600. If you prune am to one quarter of the size and keep the caching, e go bill like 11,150. The feature no change across those 3 rows. Na only the replay behaviour change. Dem still be token counts, not money, and turning a token count into a figure on your monthly bill na one multiplication with your model per-million rate. The model wey you run set that rate, so if the agent go run on Claude Fable 5, start from its published per-million rates and the work it suits. If provider still never clear and e no depend on model alone, the same jobs costed on Claude's API and on ChatGPT's show where that multiplication land differently, and agent wey dey use plenty memory go depend heavily on the input side.

The second row assume say each of the 99 later requests arrive while the cache entry still dey active. Na this assumption make plenty real bills no match expectation.

Why same question dey cost more after you take break?

Cache entry get lifetime, and clock start when request write or read am. Default na 5 minutes. The 1 hour option cost the 2x write wey show above. For Claude Code, lifetime na one hour for subscription, but e go drop to five minutes once you dey use usage credits; for API key or cloud provider, default na five minutes. Setting ENABLE_PROMPT_CACHING_1H=1 go keep the one hour lifetime while you dey use usage credits.

So, one-line question wey you type for session wey you leave open during lunch go cost plenty because cache entry expire while you dey away. The whole prefix, including memory, go process again at base input rate, then write to cache again. How long you pause determine the price.

You fit confirm this instead of just believing am. For Pro, Max, Team or Enterprise plan, /usage breakdown dey flag any behaviour wey cause 10 percent or more of recent usage, and e go show both long context and cache misses by name. For API, monitor cache_creation_input_tokens. E go jump back to the full size of your prefix for the first request after quiet period.

Wetín dey quietly make cache invalid

The cached prefix get order: tools first, then system, then messages. If you change one level, e invalidate that level and everything after am. If you edit tool definition, e throw away the whole cache. If you edit system prompt, e throw away the system and message cache.

Na here people wey dey keep memory for system prompt dey fall into trap, especially when dem dey rewrite am as agent dey learn. Every rewrite discard the cached copy of everything behind am, so the next request go pay full write cost again. Keep stable material for the front and no dey change am. Put volatile material late for the message list, where invalidating am no cost much.

Another quieter failure dey. Each model get minimum cacheable prefix: 512 tokens for Claude Opus 5, 1,024 for Claude Sonnet 5, 4,096 for Claude Haiku 4.5, as published for August 2026. Anthropic documentation explain am clearly: "Any requests to cache fewer than this number of tokens will be processed without caching, and no error is returned." So, small memory file wey you mark with cache_control no go do anything at all, and e no go show error. The sign wey you fit see be say cache_creation_input_tokens remain 0 even though your prompt clearly get breakpoint.

Prune memory wey no dey earn im place again

Every line of memory dey cost tokens for every turn wey carry am, so question for each line na whether e recently change any answer. Claude Code make the limits clear. Try keep one CLAUDE.md under 200 lines, because longer files dey use more context and reduce how reliably Claude dey follow dem. MEMORY.md get limit of first 200 lines or 25KB when e load, and anything after that limit dey drop when next session start, so oversized index dey cost tokens but e no dey teach anything.

Two habits fit keep am small. Move details comot from the index put inside topic files, wey Claude go read only when e need dem instead of for startup. Move workflow instructions comot from CLAUDE.md put inside skills, wey go load only when you invoke dem. For memory files wey already start with frontmatter, Claude Code dey record write time for one modified field as ISO 8601 timestamp, for version 2.1.214 or later, and that timestamp na the fastest way to see fact wey don stale. Pruning agent memory wey don stale explain the review process with more detail.

When retrieval dey beat loading everything inside context

Memory tool dey support just-in-time retrieval. Instead make agent load everything from the beginning, agent go record wetin e learn and read file again only when task need am. This change the calculation, because file read cost its tokens once, then e dey inside cached prefix, while permanently loaded block cost tokens for every single turn.

Simple rule dey follow from the two charts above. Text wey nearly every turn dey use belong for stable cached prefix. Text wey one turn for twenty dey use belong behind a view call. Break-even dey change based on how many times you replay am, no be based on anything Anthropic dey charge.

For API, you fit also allow platform trim the conversation. Context editing dey clear old tool results once conversation cross threshold wey you set.

{
  "edits": [
    {
      "type": "clear_tool_uses_20250919",
      "trigger": {"type": "input_tokens", "value": 30000},
      "keep": {"type": "tool_uses", "value": 3},
      "clear_at_least": {"type": "input_tokens", "value": 5000}
    }
  ]
}

The defaults na trigger of 100,000 input tokens and 3 tool uses wey dem keep. Read how interaction dey work with caching before you enable am: clearing content dey invalidate cached prefix for the point wey clear happen, so you go pay cache write for next request. Na wetin clear_at_least dey do. E dey hold clearing until the saving big enough to justify the write. Response dey report exactly wetin happen under context_management, with cleared_tool_uses and cleared_input_tokens, so you fit measure the trade instead make e remain theory. Managing context window for Claude Code dey apply the same idea to coding session.

Wetin get im own line item

Memory no get im own charge, but some features really get charge, and e good make you know which ones. Na these be the published Claude API rates as of August 2026. Some operations no cost anything, but Claude API no get free tier, only small credit when you sign up, so everything below na real spending from your first request.

  • Web search: $10 for every 1,000 searches, plus the normal token cost of everything wey the search put inside context.
  • Code execution: 1,550 free hours for each organization every month, then $0.05 for every hour per container. E free when you use am together with web search or web fetch.
  • Claude Managed Agents: session runtime na $0.08 for each session-hour, on top of the usual token charges.
  • Web fetch: no additional charge, na only the token cost of the content wey e fetch.

Memory no show for any of those lines. E dey inside your input token count, na exactly there you fit measure am, and na exactly there pruning and caching fit reduce am. If you dey budget agent wey dey run unattended for virtual private server (VPS), the cost controls for AI agent for VPS na the next thing to put in place, because agent wey get memory file wey dey grow and no pruning go cost more every week without anything reporting am.

FAQ

Claude's memory features get separate charge?

No. Anthropic price list get rates per million input tokens, per million output tokens and the prompt caching multiples, but e no get separate memory line. For Claude API, memory tool dey client-side, so files dey for storage wey you already dey pay for. Wetin memory add na input tokens, and dem dey bill am with the model normal input rate for every turn wey carry dem.

If I off memory, Claude go cheaper?

E go reduce the token count for each request, so e go reduce the cost of each request. Whether e save money overall depend on wetin happen next. If Claude need read three files again and ask you two questions to rebuild wetin memory already hold, those tokens fit cost pass the memory. Measure am instead of guessing: run /context for one session with auto memory on and another one wey start with CLAUDE_CODE_DISABLE_AUTO_MEMORY=1, then compare the total tokens wey both spend for the same task.

Why my usage increase when I no change anything?

The commonest cause na cache miss after pause. Cache entries dey live for 5 minutes by default, or one hour for the extended setting. So the first request after break go process your entire prefix again at the base input rate and write am again. The second common cause na prefix edit: if you change tool definition, e invalidate the whole cache. If you change system prompt, e invalidate the system and message cache. For subscription plan, the /usage breakdown dey name this behaviour when e account for 10 percent or more of recent usage.

Memory suppose dey inside system prompt or behind tool call?

Put am for system prompt when almost every turn dey use am, because e go sit inside cached prefix and cost the cache read rate. Put am behind a view call when na only some tasks need am, because file wey you read once go cost its tokens once instead of for every turn. The number wey decide na your replay count, and the usage object go give you that number directly.

Memory features count against subscription usage limits?

Yes, indirectly, because subscription limits dey consumed by the tokens wey each request carry. Anthropic help documentation talk say longer conversations wey trigger automatic context management go consume more of your usage limit. Memory make each request slightly longer, and long session go replay that length for every turn. How Claude's usage limits dey work explain wetin dey reset and when.