Blog · AI Agent News · Coding agents VIEN

Claude-Mem saves coding tokens, until day 30 hits your plan

Open-source Claude-Mem hit 121,400 GitHub stars by compressing coding history, yet after 30 days its note-taker bills your plan unless swapped.

Claude-Mem saves coding tokens, until day 30 hits your plan
Images: Oli Dale olidale / Wikimedia Commons (CC0)
In this article
  1. How two-layer memory stops AI from re-reading your codebase
  2. The hidden cost after day 30 and how to protect your main quota
  3. Keep memory local and split your API key from day one

Open a coding project on Monday morning in Claude Code, ask your assistant to pick up an unfinished bug fix, and it often responds like a stranger meeting your codebase for the first time. Explaining your folder structure and past decisions again burns prompts before real work even starts. Every repeated file read drains tokens (the text chunks AI models count to bill usage or reduce daily plan quotas) straight out of your allowance.

That pain pushed the open-source Claude-Mem repository on GitHub past 121,400 stars and 10,600 forks (personal copies of an open-source codebase that other developers clone to modify) by giving persistent memory to 15 coding tools. However, its background note-taker only stays outside your main subscription during a 30-day free trial. Unless you switch providers before day 30 ends, memory generation automatically falls back to your Anthropic plan, making a local setup paired with a cheap external API key the smarter move from day one.

Four key numbers behind Claude-Mem popularity, index size, and 30-day trial pricing
Claude-Mem reached 121,400 GitHub stars by keeping index rows to 50–100 tokens, yet introduces a hidden billing fork after day 30.

How two-layer memory stops AI from re-reading your codebase

Normally, every fresh terminal session starts from zero, forcing your coding agent to scan the same source files again. Rather than making you paste old summaries manually, Claude-Mem installs lightweight hooks (automatic triggers that fire whenever your agent reads a file or runs a command) to hand tool activity off to a local background worker.

A second observer agent filters out noisy terminal output, writes concise observations, and saves them inside ~/.claude-mem on your computer. Your main coding assistant stays focused on editing code, while decisions and fixes accumulate locally instead of vanishing when you close the window.

flowchart TD
  A[Main agent runs tools]:::data --> B[Hooks send events]
  B --> C[Observer writes notes]:::key
  C --> D[Save to ~/.claude-mem]
  D --> E[Load 50-100 token index]
  E --> F{30-day trial ends}:::human
  F --> G[Main plan or own key]:::muted
  classDef key fill:#1d1a10,stroke:#ffd23f,color:#ffd23f,stroke-width:1.6px
  classDef human fill:#181817,stroke:#e8e6df,color:#e8e6df,stroke-dasharray:5 3
  classDef data fill:#1c1c1b,stroke:#8d8b85,color:#cfcdc6
  classDef muted fill:#181817,stroke:#3d3d3a,color:#8d8b85
How Claude-Mem captures memory and where billing splits after 30 days

When the next session opens, the agent searches memory in three progressive steps: scanning the compact index first, checking surrounding timeline context, and fetching full observation records only for matching IDs. According to Claude-Mem's memory cost guide, each index row runs roughly 50–100 tokens compared with 500–1,000 tokens for a full observation, about 10 times smaller.

Even so, the project's own documentation stresses that smaller index rows do not guarantee identical end-to-end savings on your monthly bill. Total spend still includes timeline lookups, whichever full records the agent opens, and every token the observer model burns while summarizing sessions in the background. As we saw when reviewing ways to cut repeated token overhead in Claude Code, headline ratios only hold once you count every intermediate step.

Animated preview of Claude-Mem tracking session timelines and memory observations
Image: thedotmack / GitHub — Claude-Mem logs fixes along a searchable timeline and pulls full observation details only when a new session needs them.Image: thedotmack / GitHub

The hidden cost after day 30 and how to protect your main quota

Although the codebase is free under Apache-2.0, turning raw coding logs into readable summaries still requires calling a language model after every session. Per the official README on GitHub, choosing the hosted claude-mem observer during npx claude-mem install sends you to a checkout page requiring a payment method for a 30-day free trial.

While that trial is active, memory processing runs off-plan, which the developer notes can unlock up to 100% more usage from your main subscription. Once the 30 days expire without a paid plan, however, memory generation automatically falls back to your Anthropic plan and starts eating into your coding quota. On Claude-Mem's pricing page, dedicated hosted-token observer plans cost $30, $49, or $70 per month billed from day one, separate from the $12/month or $99/year Cloud Sync add-on.

Observer setupCost after day 30Where tokens are billed
Hosted claude-mem observer$30–70 per monthDedicated hosted token allowance
Default fallback modeNo extra platform feeDeducted from your Anthropic plan
Own API key (OpenRouter, Gemini)Pay-as-you-go API ratesSeparate external API account

If you want persistent local memory without handing over a card or draining your daily Claude Code limits, skip the hosted sign-in right during setup. Passing CLAUDE_MEM_ONLINE_OPTIN=false or an explicit --provider flag completes installation without an account, letting you route background summarization through an inexpensive OpenRouter or Gemini key instead.

Also readClaude Projects runs tasks in parallel, but projects stay private

Keep memory local and split your API key from day one

Claude-Mem's biggest strength is that it stores your database locally under ~/.claude-mem rather than locking your project history inside a proprietary cloud. Still, its default onboarding funnel nudges users toward a 30-day observer trial that quietly shifts token load back onto their main Anthropic quota once the month ends.

The cleanest setup is installing with CLAUDE_MEM_ONLINE_OPTIN=false, turning off default telemetry, and pointing the observer to a low-cost external API key before your first session. That way, Monday morning in Claude Code still starts with full context from earlier sessions, while your primary subscription stays reserved for writing code rather than paying for background notes.

Sources

  1. thedotmack/claude-mem: Persistent Context Across Sessions for Every Agent GitHub
  2. claude-mem README.md GitHub
  3. Cloud Sync Pricing — Claude-Mem Claude-Mem
  4. AI memory costs: measure the value of lasting context Claude-Mem

Coding agentsClaude & AnthropicMCP & tools

Was this useful?

More on this topic