DEV Community

sun young
sun young

Posted on

claude-mem: a Chinese translation of the persistent-memory layer for Claude Code

Every time you open a new Claude Code session, the model starts from zero. It doesn't remember that you already fixed the auth bug two hours ago, or which file holds the retry logic, or why you rejected the first approach. You re-explain, it re-reads, and the loop repeats.

claude-mem is a project that tries to close that gap. The upstream repo is thedotmack/claude-mem, written in TypeScript, Apache-2.0 licensed, with 105,900 stars. A Chinese translation of its documentation was published today at yangshun2005/claude-mem-cn. That translation is what I want to look at here — not because the translation itself is technically interesting, but because of what it changes for a specific group of developers.

What the project actually does

The one-line description from upstream is: "Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions."

Stripped of the marketing, the mechanism is:

  1. Capture. During a Claude Code session, claude-mem records "observations" about tool usage — what the agent read, ran, changed.
  2. Compress. Those raw observations get summarized into semantic form.
  3. Inject. In later sessions, relevant pieces of that compressed memory are fed back into context.

The stated goal is knowledge continuity: Claude keeps a working model of the project across session boundaries and reconnects. It's advertised as working with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode and others.

That's the whole pitch. Whether the compression is good enough to be useful rather than noisy is something you'd have to judge on your own codebase — I haven't benchmarked it, and the README doesn't publish accuracy numbers.

Install path

The primary install command from the README:

npx claude-mem install
Enter fullscreen mode Exit fullscreen mode

For Grok Bot there's a separate invocation:

npx claude-mem install --ide grok-bot
Enter fullscreen mode Exit fullscreen mode

The installer configures the environment first, then asks you to log in through the browser using an email magic link. No credit card. Login assigns your account a memory key and unlocks the claude-mem observer with a 30-day free trial.

After login you pick a memory provider:

  • claude-mem observer (the hosted option)
  • your own OpenRouter key
  • your own Gemini key
  • your Anthropic plan

If you'd rather not log in at all, the README lists three escape hatches: pass --provider explicitly, set CLAUDE_MEM_ONLINE_OPTIN=false, or run in a CI / non-interactive environment. The README text is truncated at that point, so the full non-interactive details aren't documented in what I have.

Node.js >=20.0.0 is the dependency floor. Current version is 15.7.0. The README doesn't state which operating systems are supported or what hardware it wants — that's a gap, not an omission on my part.

The parts that will bite you

Three things in the README are worth reading twice before you install.

The trial expires. The claude-mem observer is a 30-day free trial. When it ends, memory functionality falls back to your Anthropic plan unless you subscribe. If you're evaluating this for a team, that's a cost decision you should make up front rather than discover in month two.

Grok Bot works differently. Grok Bot has no host hooks, so claude-mem watches chat log files instead. It defaults to hosted CMEM Pro; the local observer requires --provider host to be turned on explicitly. Installing that plugin does not install Cursor.

Awareness push writes to disk. For Grok Bot, key observations — decision, bugfix, security_alert, sensitive — get appended as dated - YYYY-MM-DD [awareness] … lines into memory/log/YYYY-MM.md. Grok Bot already re-reads logs from disk. This does not write to profile.md, user memory, or project memory. You can disable it with CLAUDE_MEM_GROK_BOT_AWARENESS_ENABLED=false.

That last one matters if you care about what lands in your repo. A log file accumulating security-flagged observations is exactly the kind of thing you want to know about before it's committed.

Why a Chinese translation is more than a convenience

Here's the part I actually want to argue.

The upstream README is long. It has a 30-language selector strip, a quick start, a "how it works" section, search tools, docs, configuration, and troubleshooting. For an English reader that's a lot of scrolling. For a Chinese-speaking developer it's worse: you're parsing configuration semantics in a second language while simultaneously trying to decide whether the tool fits your workflow. Those are two different cognitive loads, and doing them at once is how people misread --provider host as optional.

The claude-mem-cn repo does something slightly smarter than a straight translation. It splits the page into two layers:

  • A 中文快速上手 section at the top, explicitly marked as supplementary material, not part of the original. This is a curated导读 — what the project is, what problem it solves, the shortest path to running it, environment requirements, and common pitfalls.
  • The translated README body below, which the maintainer states aims to stay faithful to the original.

That distinction is stated openly in the README: "本页顶部的「中文快速上手」为面向中文用户的补充导读(非原文内容)" — the top section is a guide for Chinese users, not original content. And: "如有翻译不准确之处,欢迎提 Issue 或 PR" — inaccuracies should go to issues or PRs.

I like this because it's honest about provenance. A translation that silently blends editorial additions into the source text is worse than useless; you can't tell which claims are the project's and which are the translator's. Here the boundary is drawn in the document itself.

The quick-start section also front-loads the things that would otherwise cost you an hour: that login is required by default, that the free trial has an end date, that Grok Bot has different constraints, that awareness push can be turned off. Those are all in the English README too, but scattered. Collecting them into one screen is the actual value-add, more than the translation itself.

What the translation doesn't solve

Two honest caveats.

First, the quick-start section inherits the same truncation as the source. The non-interactive install path is described as "原文此处被截断,后续细节未说明" — the original is cut off there, details not given. So if you're trying to wire this into CI, the Chinese version won't get you further than the English one. You'll need to read the source.

Second, the translation is dated 2026-10-31 and the project is at 15.7.0. Fast-moving repos drift. If you're reading this much later, check whether the Chinese README still matches upstream before trusting a specific flag name.

Should you try it

If you use Claude Code on a project that spans multiple sessions — which is most real projects — the problem claude-mem addresses is real. Session amnesia is annoying and it costs tokens.

Whether claude-mem is the right fix depends on things the README can't tell you: how well the compression holds up on your codebase, whether the hosted observer is worth a subscription after the trial, and whether you're comfortable with observations being written to log files in your repo. My sample of one README is not enough to answer any of those.

What I can say is that the Chinese translation lowers the entry cost meaningfully. If your team reads Chinese and has been putting off evaluating this because the docs are dense English, the barrier just got smaller. The install is one command, the trial is 30 days, and the pitfalls are now listed in one place at the top of the page.

That's a reasonable place to start.


Chinese documentation: https://github.com/yangshun2005/claude-mem-cn

I'm an independent enterprise AI delivery consultant — private LLM deployment, RAG, agent workflows, AIOps. If your team is stuck somewhere in that stack, my inbox is open.

Top comments (0)