claude-mem

thedotmackApache-2.0活跃维护

给 AI 编程代理加上跨会话的长期记忆:自动记录会话过程,用 AI 压缩后把相关上下文注入后续会话,兼容 Claude Code、Codex、Copilot 等多种代理。

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. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

v15.16.0发布于 2026-11-11 00:34 UTC115,802star +1,668 / 7 天10,048fork同步于 2026-11-10 23:18 UTC

怎么上手

由 README 提炼,执行前请确认
npx claude-mem install
硬件要求按 README 说明

README 未说明硬件要求;为本地 Node 服务,依赖 Node ^20.19 或 >=22.12,未提及 GPU 或显存。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给编码 Agent 加跨会话持久记忆,自动记录并压缩会话内容,下次自动注入相关上下文

给 AI 编程代理加上跨会话的长期记忆:自动记录会话过程,用 AI 压缩后把相关上下文注入后续会话,兼容 Claude Code、Codex、Copilot 等多种代理。

核心能力

  • 用 hooks 捕获每次工具调用交给本地 worker
  • 由观察者 Agent 把活动压缩成简短观察与总结
  • 新会话注入项目相关观察索引,按需拉取详情
  • 提供 search/timeline/get_observations 三步 MCP 检索
  • SQLite 存会话与观察,Chroma 提供语义检索

容易踩的坑

安装器需在交互式终端运行,会询问要配置哪些 Agent 及是否关闭 Claude Code 原生自动记忆;记忆注入从项目内第二次会话才开始,首次会话不会注入;需 Node ^20.19 或 >=22.12,版本不符会装不上。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v15.16.0
  1. v15.16.0最新正式版2026-11-11 · 2026-11-11 00:34 UTC

    New

    • My Work refresh on your API provider (opt-in): set CLAUDE_MEM_WORK_VIEW_AGENT=api to run the My Work refresh on the provider you already selected (openrouter, openai-compatible, or the legacy cmem spelling). Installs with no logged-in Claude Code, Codex or Gemini CLI (for example OpenCode or DSH hosts) can now use My Work. With an API provider selected and the setting empty, the refresh no longer falls back to a logged-in Claude Code: no agent runs and nothing is spent until you choose one (#5674, thanks @bulanovk).
    • GitHub MCP pull requests in My Work: pull requests created through GitHub's official MCP create_pull_request tool now show up as My Work products. Only completed results whose URL matches the requested repository are accepted (#5809, thanks @Afloat16).
    • UberLLM preset: uberllm is now a preset of the openai-compatible provider (https://api.uberllm.dev/v1, default model deepseek/deepseek-v4.1-flash) (#5706, thanks @PSA-Team-source).
    • Tunable live handoff timeout: CLAUDE_MEM_HOOK_HANDOFF_TIMEOUT_MS (default 250) sets the budget for the single live handoff from a hook to the worker, and a missed handoff is now logged at WARN instead of DEBUG (#5831, thanks @mohitdixit02).

    Notable fixes

    • Plugin cache cleanup: the worker now prunes old version folders that Claude Code's marketplace updates leave in ~/.claude/plugins/cache/thedotmack/claude-mem/ (one report: 21 versions, about 16 GB). It keeps the running copy and the registered version, and sweeps after boot settles and then hourly (#5685, thanks @MaxWang007).
    • Windows antivirus noise: install, update and launcher rebuilds no longer start a hidden PowerShell when the launcher folder is already on PATH, the pattern Kaspersky flagged (#5835, reported by @Ali-Sabri-0).
    • My Work language: when CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE is empty, every refresh step now writes in the system locale's language, so one run no longer mixes languages (#5669, thanks @0xABCD01).
    • My Work idle cost: idle polling no longer rescans every synced row, and the live overview, focus-area merging and heavy panels do less work per update (#5834).
    • Backups: a declined backup run returns a failure, saved backups are reported separately from retention errors, backup intervals beyond the timer limit are honored, and restore rejects stamped snapshots missing worker tables (#5750, #5781, #5784, #5684, thanks @Kirat0201).
    • Shell setup: the launcher PATH block and the legacy uninstall alias are written atomically, Cowork stages spooled events under $HOME when the host sets it, and Hermes keeps permanent HTTP client errors out of its circuit breaker (#5680, #5679, #5677, #5678, thanks @DeryFerd).
    • OpenCode: the bash tool is reported as Bash, so SKIP_BASH_PATTERNS applies (#5668, thanks @ryrenz).
    • Sync: a failed Chroma cleanup after a delete is retried (#5673, thanks @Zhong-fan).
    • SessionStart: the cache read and compose steps share one body budget, so a cached body is served only when it fits (#5686, thanks @Varshith-Kali).

    More fixes

    About 130 smaller fixes from @Afloat16 across capture, sync, search, context, import, transcripts, media, the server, and the Codex, OpenCode, OpenClaw, Hermes, Grok, Kimi, Gemini, Pi, Goose, Notion and Telegram integrations. Highlights:

    • Search and context: literal project keys and file paths are preserved through recall, merges and caching; Unicode and combining marks survive query words and snippet limits; cached context expires after restores and row replacements; the largest fitting timeline prefix is kept.
    • Sync and memory: session titles commit with their outbox mutation and get receiver redaction; manual saves and new prompts work after a session deletion; note revisions survive title dedup.
    • Transcripts and import: multipart Codex messages, paired patch results and zstd frame seams are read correctly; reasoning stays out of final answers; Ope
  2. v15.15.22026-11-10 · 2026-11-10 19:30 UTC
    查看更新说明

    Critical fix

    • Antigravity no longer denies every tool call after an upgrade from 14.x (#5670): an in-place upgrade from an older install left a PreToolUse hook (and a PreInvocation context hook) in ~/.gemini/config/hooks.json. agy kept firing it before every tool call, the current adapter answered with no decision, and agy denied every call until you re-ran install. Now the Antigravity installer finds those stale entries and migrates the file in place with the same merge install performs. It writes only when something is stale, never throws, and leaves a corrupt file untouched. The worker runs this heal on startup and on Antigravity hook calls, so updating is enough. Thanks to @jiezhiyong for the report (#5665) and to @0xABCD01 for the fix.

    Fixes

    • Antigravity: a model call that only called tools no longer becomes an "AntigravityProvider returned Completed" memory. Only a step with a real reply is recorded, so the observer stops writing false memories like "stuck in a retry loop" (#5667, thanks @ryrenz; reported in #5665 by @jiezhiyong).
    • Redaction: with CLAUDE_MEM_REDACT_ENABLED=true, server capture now applies the configured redactor before the capture leaves your machine, and to session and event metadata before it is stored. Before, an untagged credential in an opening prompt or tool payload could be sent over HTTP unredacted (#5774, thanks @Afloat16).
    • Doctor: claude-mem doctor now checks the macOS launcher's code signature. A launcher macOS would kill gets a clear hint (bun upgrade first when Bun is below 1.4.1, otherwise npx claude-mem install rebuilds it); a launcher that still runs only warns (#5657, thanks @Kirat0201).
    • cmem-pro 0.2.1: the Cowork plugin version is bumped so installed copies pick up the redaction and failed-capture fixes made after 0.2.0.

    New

    • Turkish My Work: the My Work page is now available in Turkish (#5656, thanks @Kirat0201).

    Full changelog: https://github.com/thedotmack/claude-mem/compare/v15.15.1...v15.15.2

  3. v15.15.12026-11-10 · 2026-11-10 07:06 UTC
    查看更新说明

    No replay after an outage

    When the worker was down or refused a capture, some capture paths kept that work and sent it again later, which could start model calls nobody asked for. They now drop what the worker refused and carry on with new work (#5663):

    • Transcript capture: a transcript line the worker refuses or cannot take is skipped. Before, the watcher stopped at that line and, once the worker was back, sent it again with every line after it. A restart no longer resends lines from an outage either.
    • Cowork: a prompt, observation or summary that fails to send is dropped instead of being spooled and sent again by a later hook. Only session start, session end and subagent stop events are still spooled, and prompts, observations and summaries left in an older spool are removed on its next flush.
    • OpenCode: a session start the worker refused is sent once, like observations and summaries, instead of being retried in the background for about 10 seconds.

    Fixes

    • Redaction: Grafana service account tokens (glsa_), Grafana Cloud tokens (glc_) and Postman API keys (PMAK-) are redacted, by the worker and by the Cowork shim. Turn either off by name with CLAUDE_MEM_REDACT_DISABLED_BUILTINS (grafana_token, postman_key) (#5662, thanks @kevin9327).
    • OpenClaw: <private> content is removed from tool output before the output is cut to 1,000 characters. Before, a cut inside a private block dropped its closing tag, so the private text was stored. Text after an unclosed <private> tag is now dropped too (#5663).
    • Status and doctor: claude-mem status names every dependency in words, such as "Observer data directory setup required" instead of observer_dir: setup_required, and its hint points to claude-mem doctor instead of a Settings screen that does not show these. doctor shows a status from a newer worker instead of dropping it (#5661).
    • Work state: Done and Dropped close an item in any letter case, everywhere. Before, saving an owner-goals item as Done was refused although every reader already treated it as closed (#5661).
    • CCS Align: a corrupt exclusion file is refused instead of being read as empty, so excluded observations stay excluded and the file is not overwritten (#5663).
    • Viewer: observations of type sensitive get their own "Sensitive" filter on the session page instead of being counted under "Other" (#5663).

    Also in this release

    • Setup and My Work: each setup, billing, scan and refresh state is defined once and shared by the installer, the worker and the pages, so a new state fails the typecheck until every screen handles it (#5661).
    • Tests: about 60,000 lines of tests removed: tests that only checked their own fixtures, duplicate cases (folded into tables) and four duplicate copies of the agent-cost-report Python tests. Kept regression tests run production code (#5663).
    • CI: Bun is pinned to 1.4.4, ripgrep is installed, the Cowork runner and agent-cost-report Python tests run, and tool-heavy suites moved to the integration lane (#5663).

    Full changelog: https://github.com/thedotmack/claude-mem/compare/v15.15.0...v15.15.1

  4. v15.15.02026-11-10 · 2026-11-10 02:20 UTC
    查看更新说明

    Critical fix

    • The worker no longer freezes on its first image (#5601): a worker started from a plugin root with no node_modules (the Claude Code marketplace clone) could freeze for good. Bun's auto-install loaded sharp's wasm build, whose first call blocks Bun's main thread, so timers and /api/health stopped and hooks kept reclaiming the worker. Now every worker, server and plugin spawn runs bun --no-install, the installer starts the worker from the plugin cache copy where it just ran bun install, and the media converter refuses sharp's wasm build before decoding, so a worker started some other way reports decoder_unavailable instead of freezing (#5653). Thanks to @vieGPT for the report and to @Kirat0201 for reproducing it and proposing the approach.

    New

    • One Rules + Tools line at session start: the SessionStart header (project and time, Mode, Legend, Format, Fetch, Stats) is now one line, Access Claude-Mem Rules + Tools: ~/.claude-mem/RULES-AND-TOOLS.md. That file holds the format, legend, mode, how to fetch details, the work-state rule and memory-use guidance, and is rewritten only when its text changes. The terminal banner now ends on a closing line with the viewer link and how many timeline lines are shown (#5654).
    • Savings settings removed: the context header no longer prints a savings line, so CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT and CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT and their viewer toggle are gone. Settings files that still carry them load as before (#5654).

    Fixes

    • Installer: the setup state is prepared before the browser opens, so a quick first choice is no longer erased and the installer no longer waits for a choice you already made (#5631, thanks @Afloat16).
    • Context: the prior-session reply shown at startup is read from the end of the transcript instead of loading the whole file, so long sessions start faster and very large transcripts keep that context (#5625, thanks @Afloat16).
    • Terminal banner: when the banner cut lands exactly on a line boundary, the whole line that fits is kept, and the line count also counts rows in the plain block format (#5654).
    • Tests: the server's semantic context route probes the embedding model only where pgvector exists, so CI no longer times out on a cold model download (#5659).

    Full changelog: https://github.com/thedotmack/claude-mem/compare/v15.14.0...v15.15.0

  5. v15.14.02026-11-09 · 2026-11-09 22:27 UTC
    查看更新说明

    New

    • Focus areas in My Work: My Work now opens on an overview of your focus areas. Each area gets a card with bundled concept artwork, its goal and live request counts; open one to see its requests. The setup reveal screen uses the same view. Artwork can be set to full, compact or off, and the images ship with the plugin, so nothing is generated or fetched at runtime (#5652).
    • claude-mem can update itself: the worker checks once a day for the release promoted in releases/promoted-release.json, and installs only a newer version that npm shows as published by the release workflow with provenance, only while you have been away for a while. A failed update puts the previous version back. npx claude-mem doctor shows an Auto-update row. Turn it off with CLAUDE_MEM_AUTO_UPDATE=false; Claude Code's own update switches (DISABLE_AUTOUPDATER and friends) also turn it off. New installs register the marketplace with Claude Code's background update off, so only one updater runs. See the new auto-update docs page (#5500).
    • Startup context is the timeline alone: the SessionStart message is now the header lines followed by the timeline, ending on the newest entry. The longer work-state and memory-use instructions moved to the claude-mem MCP server's instructions. The terminal banner has the same shape (#5487).
    • Faster hooks: hooks run from a small hook-only bundle instead of the full worker bundle. One hook takes about half the time and memory; a dozen parallel hooks use about a quarter of the CPU (#5541, thanks @bulanovk).
    • Raw tool evidence search (opt-in, local): with CLAUDE_MEM_TOOL_USES_SEARCH_ENABLED=true, a local search with deep: true looks through stored tool input and output when the observation search finds nothing, and returns #T IDs for get_tool_uses (#5167, thanks @ShitK).
    • Korean UI: the viewer, My Work, setup and Observation TV can be shown in Korean (#5522, thanks @BaeJinSeop).

    Privacy and security

    • Context: privacy filters now also apply to prior-session replies shown at startup (#5626).
    • Backups: SQLite snapshots are created readable only by you (#5642).
    • Media: cloud uploads stop starting after you opt out (#5622).
    • Redaction: cookie header values are redacted, matching the Cowork shim (#5591, thanks @DeryFerd), and the Cowork shim now redacts the key shapes it still sent verbatim (#5543, thanks @DeryFerd).
    • Worker: read routes that resolve a project from cwd are guarded (#5590, thanks @DeryFerd).
    • Auth: stored access tokens that are not strings are rejected (#5506, thanks @Kirat0201).
    • Launcher: macOS signing is verified before the launcher is put in place (#5503, thanks @Kirat0201).
    • Telemetry: a saved consent choice is kept when identifiers are created (#5629).

    Installers and integrations

    • Atomic config writes: Codex, OpenCode, OpenClaw, Kimi, Antigravity, Hermes, Grok Bot and OMP config and hook files are written atomically, so an interrupted install can't leave a broken file (#5592, #5593, #5594, #5595, #5596, #5597, #5598, #5599, thanks @DeryFerd).
    • Cursor: uninstall removes the hooks and MCP server that install --ide cursor adds (#5584, thanks @tanishqbaweja).
    • Installer: tool version probes, browser-setup worker requests and npm child processes are bounded, and npm descendants are terminated on timeout (#5634, #5638, #5644).
    • Installer: existing host installs are found in their configured folders, non-executable paths are skipped during runtime discovery, Roo Code is detected by its marketplace ID, and a compatible tree-sitter on PATH is used during repair (#5552, #5556, #5560, #5576, thanks @Kirat0201).
    • Hooks: hooks dispatch through the installed plugin resolver (#5504, thanks @Kirat0201).
    • OpenCode: one bounded live observer handoff (#5621). Pi: tool results are normalized for evidence (#5605). Goose: executable paths are quoted in the YAML config (#5606). Devin: on

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Quick Start

    Installing for someone as an AI agent? Run npx claude-mem install --runtime worker on their computer in an interactive terminal (enable PTY in your shell tool). It first asks in the terminal which agents to set up and, for Claude Code, whether to disable native auto-memory (and whether to overwrite an existing install). Relay each question to the user and type their answer, or pass --ide <id> to skip the first one. Keep the installer running. When it prints Continue setup in your browser, open that URL in the user's browser if the installer hasn't already opened it. Let the user go through setup and make their own choices, including the usage-analytics question the installer may ask at the end. If you can't run an interactive terminal on their computer, give them the command to run locally.

    npx claude-mem install
    

    The installer finds the agents on your machine and asks which ones to set up. Then just start working: observations stream in from your first prompt, and your second session in a project opens with memory from the first. (Copilot CLI, Goose, Roo Code and Warp get memory search only, so their sessions don't add to it.)

    The installer sets everything up first, then asks you to sign in to claude-mem in your browser (email magic link, no card required to sign in). Choosing the claude-mem observer then starts its 30 Day Free Trial on a checkout page that asks for a payment method; once it completes, the installer saves your memory key. With the observer, memory runs off-plan, so you get up to 100% more usage from your plan. When the free trial ends, memory automatically falls back to your Anthropic plan unless you subscribe. After sign-in you pick your memory provider: the claude-mem observer, your own OpenRouter or Gemini key, or your Anthropic plan.

    Prefer to skip the sign-in? Pass an explicit --provider flag, set CLAUDE_MEM_ONLINE_OPTIN=false, or run in CI/non-interactive shells — the installer completes without any account interaction.

    Your memory lives in ~/.claude-mem on your machine. Cloud sync is opt-in. Anonymous usage analytics are on by default; npx claude-mem telemetry disable turns them off (what's collected).

    Or install from the plugin marketplace inside Claude Code:

    /plugin marketplace add thedotmack/claude-mem
    
    /plugin install claude-mem
    

    Restart Claude Code. Context from previous sessions will automatically appear in new sessions.

    Note: Claude-Mem is also published on npm, but npm install -g claude-mem installs the SDK/library only — it does not register the plugin hooks or set up the worker service. Always install via npx claude-mem install or the /plugin commands above.

    Other agents

    npx claude-mem install covers every supported agent. To set up one agent directly, pass --ide.

    OpenCode (1.3.4 or later, including OpenCode 2). Restart OpenCode after installing.

    npx claude-mem install --ide opencode
    

    T3 Code (Codex and Claude Code providers). The installer discovers T3 Code's enabled providers, registers native Claude-Mem plugins in their configured homes, and supports T3-managed Codex. Restart T3 Code, trust the provider's hooks when prompted, and start a new thread. See the T3 Code integration guide for custom server settings, status, and removal.

    npx claude-mem install --ide t3code
    

    Antigravity CLI (setup guide):

    npx claude-mem install --ide antigravity
    

    OMP (Oh My Pi):

    npx claude-mem install --ide omp
    

    Pi and DeepSeek Harness use the worker runtime. See native harness setup for capture, recall, and troubleshooting.

    npx claude-mem install --ide pi
    npx claude-mem install --ide dsh --dsh-profile tui
    

    Grok Bot: see Grok Bot below.

    npx claude-mem install --ide grok-bot
    

    The full list of --ide values is in npx claude-mem --help.

    Grok Bot

    Grok Bot has no host hooks, so we watch the chat log files. Default is CMEM Pro, the hosted memory. Local observer is opt-in: --provider host. Installing this plugin does not install Cursor.

    Opt-in awareness push: needle observations (decision, bugfix, security_alert, sensitive) are appended as dated - YYYY-MM-DD [awareness] … lines into that bot's memory/log/YYYY-MM.md. Grok Bot already re-reads the log from disk. This does not write profile.md, user-memory, or project memory. Enable with CLAUDE_MEM_GROK_BOT_AWARENESS_ENABLED=true and set CLAUDE_MEM_GROK_BOT_AWARENESS_AGENT_IDS to your agent UUIDs (empty by default).

    🦞 OpenClaw Gateway

    Install claude-mem as a persistent memory plugin on OpenClaw gateways with a single command:

    curl -fsSL https://install.cmem.ai/openclaw.sh | bash
    

    The installer handles dependencies, plugin setup, AI provider configuration, worker startup, and optional real-time observation feeds to Telegram, Discord, Slack, and more. See the OpenClaw Integration Guide for details.

    What You Get

    • 🧠 The next session starts where the last one left off. Each session opens with a compact index of past observations, layered so the agent opens full details only when it needs them, and the header can show what each layer costs in tokens.
    • 🔍 Find anything you worked on. The mem-search skill searches your project history in three steps (index, timeline, details), so the agent spends tokens only on what it opens.
    • 🖥️ Watch it work, and keep track of yours. My Work shows live requests, progress, human handoffs and a saved review queue at the worker URL printed on startup. Guide. Memory, sessions and settings remain at /viewer.
    • 👥 Share with your team, if you want. TeamBrain is an optional shared workspace beside My Work, with real team work lists, member attribution and linked findings. Each person chooses what to share; personal requests and review notes stay separate. Set up a team.
    • 💻 Search from Claude Desktop. Search your memory from Claude Desktop conversations.
    • 🔒 Keep secrets out. Wrap anything in <private> tags and it never gets stored.
    • 🖼️ Screenshots, kept by default. Keep converted copies of tool screenshots under ~/.claude-mem/media-v1/ and show them in My Work, upload them to cmem.ai only when Cloud Sync is on, and send them to the observer model only when image inference is separately enabled. Turn it off with the "Keep images" switch in Settings (details).
    • ⚙️ Choose what gets injected. Fine-grained settings for what context a new session starts with.
    • 🤖 Nothing to remember to do. It runs on its own once installed.
    • 🔗 Point back to past work. Every observation has an ID you can cite through the worker API or open in the web viewer.

    Documentation

    📚 View Full Documentation - Browse on official website

    Getting Started

    • Installation Guide - Quick start & advanced installation
    • Usage Guide - How Claude-Mem works automatically
    • Search Tools - Query your project history with natural language
    • Cloud Sync - Back up your memory to cmem.ai — no daemon, the worker syncs on write

    Best Practices

    Architecture

    Configuration & Development


    How It Works

    1. Your agent works. Hooks in your agent hand each tool call (what it reads, edits and runs) to a small local worker.
    2. The observer takes notes. A second agent turns that activity into short observations, and writes a summary when the session ends.
    3. The next session starts with them. When a session starts, your agent gets a compact index of the observations that matter for this project, and fetches full details only when it needs them.

    Memory injection starts on your second session in a project. To front-load a whole repo instead, run /learn-codebase (~5 minutes on a typical repo, optional).

    See Architecture Overview for details.

    How it fits together

    For contributors, the main parts and where they live:

    • The claude-mem command (src/npx-cli/index.ts): install, repair, doctor, start, search and the rest. The installer puts a small launcher on PATH so hooks can run claude-mem directly.
    • Hooks (src/cli/hook-command.ts, one adapter per agent in src/cli/adapters/): each agent event runs one shell-free command, such as claude-mem hook claude-code <event>. For Claude Code that's Setup (claude --init / --maintenance), SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, Stop, SubagentStop and SessionEnd.
    • The worker (src/services/worker-service.ts, routes in src/services/worker/http/routes/): a local HTTP service managed by Bun. It takes tool activity from the hooks, runs the observer, and serves the viewer and search.
    • The observer (prompts in src/sdk/, one provider per model source in src/services/worker/, such as ClaudeProvider.ts and OpenRouterProvider.ts): turns tool activity into observations and summaries.
    • Storage (src/services/sqlite/): SQLite at ~/.claude-mem/claude-mem.db holds sessions, observations and summaries. Chroma adds semantic search on top of SQLite's keyword search (src/services/worker/search/).
    • Context (src/services/context/): builds the block a new session starts with.
    • Search (src/servers/mcp-server.ts, plugin/skills/mem-search/): the MCP tools and the mem-search skill that drives them.
    • The viewer (src/ui/viewer/ at /viewer, src/ui/my-work/ at /): memory, sessions and settings, plus My Work.
    • The built plugin (plugin/): written by npm run build; edit src/, not the generated scripts.

    The words we use for each of these, and the story they tell, are in docs/story.md.


    MCP Search Tools

    Search runs through three MCP tools in a token-efficient three-step workflow. The mem-search skill drives it for you:

    The three steps:

    1. search - Get compact index with IDs (~50-100 tokens/result)
    2. timeline - Get chronological context around interesting results
    3. get_observations - Fetch full details ONLY for filtered IDs (~500-1,000 tokens/result)

    Step by step:

    • Your agent uses MCP tools to search your memory
    • Start with search to get an index of results
    • Use timeline to see what was happening around specific observations
    • Use get_observations to fetch full details for relevant IDs
    • ~10x token savings by filtering before fetching details

    Available MCP Tools:

    1. search - Search memory index with full-text queries, filters by type/date/project
    2. timeline - Get chronological context around a specific observation or query
    3. get_observations - Fetch full observation details by IDs (always batch multiple IDs)

    Example Usage:

    // Step 1: Search for index
    search(query="authentication bug", type="bugfix", limit=10)
    
    // Step 2: Review index, identify relevant IDs (e.g., #123, #456)
    
    // Step 3: Fetch full details
    get_observations(ids=[123, 456])
    

    The worker also offers tools for code navigation (smart_search, smart_outline, smart_unfold), saving a note on purpose (save_memory) and tracking work in progress. See Search Tools Guide for detailed examples.


    System Requirements

    • Node.js: 20.19 or later in the 20.x line, or 22.12 or later
    • A supported agent: Claude Code (latest, with plugin support) or any agent in Other agents
    • Bun: JavaScript runtime and process manager (auto-installed if missing)
    • uv: Python package manager for vector search (auto-installed if missing)
    • SQLite 3: For persistent storage (bundled)

    Windows Setup Notes

    If you see an error like:

    npm : The term 'npm' is not recognized as the name of a cmdlet
    

    Make sure Node.js and npm are installed and added to your PATH. Download the latest Node.js installer from https://nodejs.org and restart your terminal after installation.

    Claude Code hooks do not need Git Bash. Each hook runs claude-mem directly, and npx claude-mem install places that launcher at %LOCALAPPDATA%\claude-mem\bin\claude-mem.exe and adds the folder to your user Path. Restart your terminal or IDE afterwards so Claude Code picks up the new Path. If hooks report Executable not found in $PATH: "claude-mem", run npx claude-mem doctor and see Troubleshooting.


    Configuration

    Settings are managed in ~/.claude-mem/settings.json (auto-created with defaults on first run). Configure AI model, worker port, data directory, log level, and context injection settings.

    To include observations from every harness in Claude Code and Codex SessionStart context, set "CLAUDE_MEM_SESSION_START_INCLUDE_ALL_SOURCES": "true" in that file, or enable Include all sources at session start in the viewer settings. The default is "false", which limits startup context to the current harness. The observation count limit still applies across the selected sources.

    See the Configuration Guide for all available settings and examples.

    Mode & Language Configuration

    Claude-Mem supports multiple workflow modes and languages via the CLAUDE_MEM_MODE setting.

    This option controls both:

    • The workflow behavior (e.g. code, chill, investigation)
    • The language used in generated observations
    How to Configure

    Edit your settings file at ~/.claude-mem/settings.json:

    {
      "CLAUDE_MEM_MODE": "code--zh"
    }
    

    Modes are defined in plugin/modes/. To see all available modes locally:

    ls ~/.claude/plugins/marketplaces/thedotmack/plugin/modes/
    
    Available Modes
    ModeDescription
    codeDefault English mode
    code--chillRecords fewer observations, keeping only what would be painful to rediscover
    code--[lang]Same as code, with observations and summaries written in another language

    Built-in language codes: ar, bn, cs, da, de, el, es, fi, fr, he, hi, hu, id, it, ja, ko, nl, no, pl, pt-br, ro, ru, sv, th, tr, uk, ur, vi, zh. For example, code--ko writes observations and summaries in Korean.

    See Modes for each language's name, the email investigation mode, and custom modes.

    Note: All of these modes are built in. No additional installation or plugin update is required.

    After Changing Mode

    Restart Claude Code to apply the new mode configuration.


    Development

    See the Development Guide for build instructions, testing, and contribution workflow.


    Troubleshooting

    Start with npx claude-mem doctor. It checks Bun, uv, the hook launcher and the worker, and tells you what to fix.

    See the Troubleshooting Guide for common issues and solutions.


    Bug Reports

    Create comprehensive bug reports with the automated generator:

    cd ~/.claude/plugins/marketplaces/thedotmack
    npm run bug-report
    

    Contributing

    Contributions are welcome! Please:

    1. Fork the repository
    2. Create a feature branch
    3. Make your changes with tests
    4. Update documentation (user-facing words follow docs/story.md)
    5. Submit a Pull Request against main

    Releases ship from main and are published to npm.

    See Development Guide for contribution workflow.


    License

    Claude-Mem is licensed under the Apache License 2.0.

    We chose Apache-2.0 because durable agentic memory should be easy to embed in developer tools, local agents, MCP servers, enterprise systems, robotics stacks, and production agent harnesses.

    See the LICENSE file for full details. See docs/license.md and docs/ip-boundary.md for licensing scope and the open/commercial boundary.


    Support


    Built with Claude Agent SDK | Works with Claude Code, Codex, Cursor, OpenCode and more | Made with TypeScript


    What About CMEM?

    CMEM is a token created by a 3rd party but officially embraced by the creator of Claude-Mem (Alex Newman, @thedotmack). The token acts as a community catalyst for growth and a vehicle for bringing CMEM to the developers and knowledge workers that need it most.

    Official BASE CA: 0x76b1967eec0ccaeb001bbbb2b40dc4badba31ba3