claude-mem: persistent memory for Claude Code
Gives Claude Code a memory of past sessions by recording tool calls, compressing them with a model, and replaying the useful parts next time.
- Skills
- 30
- included
- MCP servers
- 1
- included
- Hooks
- 11
- included
- Stars
- 109.3K
- on GitHub
- Included
- 29
- listed
claude-mem makes Claude Code remember earlier sessions. Hooks record what Claude reads, runs and edits, a second model boils that down to short notes, and the relevant notes load when you start a new session. The notes live in a database on your machine. The part to check first is who runs the note-taking model, because by default it uses your own Claude plan.
Good for
- Developers who re-explain the same project every new Claude Code session
- Anyone who wants to search what Claude did on a project last week
- Teams comfortable with a background process running on their machine
- People who can spare some Claude plan usage or bring another model key
Install claude-mem
Claude Code
- 1
Copy this prompt.
Install the claude-mem plugin in Claude Code. Run this command: /plugin marketplace add thedotmack/claude-mem /plugin install claude-mem Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Claude Code 2.1.139 or later, Node.js 20 or later.
Use the marketplace commands if you only use Claude Code. The npx installer also sets up other apps and offers a cmem.ai sign-in; npx claude-mem install --provider claude skips that sign-in. Do not use npm install -g claude-mem: it installs the library only, with no hooks.
From the project README. Source.
Key facts
- Author
- Alex Newman (thedotmack)
- License
- Apache-2.0
- Version
- 15.8.1, released 2026-11-01
- Last commit
- 2026-11-01
- Created
- 2025-08-31
- Data location
- ~/.claude-mem/ (SQLite plus Chroma index)
What it includes
Searches past sessions for what you did and decided
Looks up stored notes in three steps: search, then a timeline around a hit, then the full notes. Use it to ask whether something was already solved.
Try: “Did we already solve this? How did we fix the auth bug last time?”
Read ·
mem-searchWrites a story of a project from its memory
Reads a project's whole stored history and writes a narrative report of how it developed.
Try: “Give me a timeline report for this project.”
Write ·
timeline-reportWrites a week-by-week digest of a project
Walks the stored timeline one week at a time and writes a short narrative for each.
Write ·
weekly-digestsWrites a HANDOFF.md so a new session can continue
Captures the goal, current state, files touched, failed attempts and next steps in one file.
Try: “Write a handoff so a new session can pick this up.”
Write ·
handoffExplains what is captured and where it lives
Describes how claude-mem records tool calls, when notes are injected and where the data sits on disk.
Read ·
how-it-worksBuilds a question-answering knowledge base from notes
Turns stored notes into a knowledge base you can query in plain language.
Write ·
knowledge-agentSearches code structure with fewer tokens
Uses tree-sitter parsing to outline and unfold code instead of reading whole files.
Files ·
smart-exploreSets up, checks or restores database snapshots
Manages local snapshots of the claude-mem database.
Runs code ·
backup-setupSets up or checks Cloud Sync with cmem.ai Pro
Walks through turning on sync, which uploads notes and full prompt text to your cmem.ai account.
Write ·
cloud-syncCreates custom memory modes
Interactively builds a mode with its own note types and tags, and can restart the worker.
Runs code ·
mode-creatorReads every source file to prime Claude
Reads each file in full so the session starts with the whole codebase in view.
Files ·
learn-codebaseWrites a phased implementation plan
Drafts a plan with documentation lookups before any code is changed.
Write ·
make-planRuns a phased plan with subagents
Executes a written plan step by step using subagents.
Runs code ·
doAutomates a coding task end to end
Chains planning, doing and watching a pull request.
Runs code ·
buildWatches a pull request until it can merge
Follows a PR or review cycle and reports when it is ready.
Network ·
babysitAutomates a release
Bumps the version and checks the shipped release.
Runs code ·
releaseBumps the version of a Claude Code plugin
Runs a semantic versioning and release flow for plugins.
Runs code ·
version-bumpReports agent spending for a period
Builds a cost report, by default for the last 7 full days.
Read ·
agent-cost-reportSearches Screenpipe history and saves picks to memory
Queries screen and audio history recorded by Screenpipe and can store selected context.
Write ·
screenpipeThe rest are workflow helpers that mostly do not use memory
standup, pathfinder, design-is, oh-my-issues, owner-goals, request-progress, childhood, ccs-align, wowerpoint, what-the and build-and-release. See the plugin's skills folder for each.
Read ·
11 more bundled skillsLocal search server that reads the worker's notes
Runs on your machine over stdio and exposes search, timeline, get_observations, smart_search, outline, unfold, save_memory and corpus tools. The exact set varies by setup.
Try: “Search my memory for the database migration decision.”
Write ·
mcp-search (MCP server)Used by the assistant behind the scenes
Starts the background worker
Launches the local worker (HTTP API, web viewer, SQLite) if it is not running.
Runs code ·
SessionStart: claude-mem startLoads past notes into the new session
Reads stored notes from the local database and adds them to the session.
Read ·
SessionStart: contextInstalls the claude-mem launcher
Compiles the launcher into ~/.local/bin if missing or old, and may append to your shell PATH.
Runs code ·
SessionStart: ensure-launcherChecks plugin dependencies on init
Runs only with claude --init or --maintenance and runs bun install if needed.
Runs code ·
Setup: version-checkSaves your prompt and opens the session
Strips private tags from the prompt, records it and opens the session in the worker.
Write ·
UserPromptSubmit: session-initAdds file history before reads
Adds a file's memory timeline as context and can block whole-file reads of large code files.
Read ·
PreToolUse: file-contextRecords each tool call
Sends every tool input and output to the worker, which queues it for the note-taking model.
Write ·
PostToolUse: observationRecords failed tool calls
Same capture as PostToolUse for calls that failed.
Write ·
PostToolUseFailure: observationStores an end-of-turn summary
Asks the note-taking model to summarize the turn and saves it.
Write ·
Stop: summarizeRecords subagent completion
Marks a subagent as finished in the worker.
Write ·
SubagentStop: subagent-stopMarks the session complete
Closes the session in the worker.
Write ·
SessionEnd: session-end
From the official docs
Permissions
Medium risk
It records everything Claude does in your sessions and hands it to a model, and the installer path you choose decides whether any of it leaves your machine. Install from the /plugin marketplace, check which provider is selected, and use private tags for anything sensitive.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The npx installer may upload recent prompts to cmem.ai
An open issue reports the interactive npx setup page sends your last 30 days of prompts to cmem.ai before asking. A consent fix is proposed but not merged, and installing from the /plugin marketplace is not described in that issue. github.com
Hooks record every prompt and tool call
UserPromptSubmit saves your prompt, and PostToolUse and PostToolUseFailure send each tool input and output to the local worker. Wrap sensitive text in private tags or exclude projects in settings. github.com
It can block large file reads
The PreToolUse hook (file-context) adds a file history before Read, Bash, Grep and Glob, and can block a whole-file Read of a large code file that has history. Turn this off in settings if Claude seems to skip files. github.com
Captured data goes to a model you choose
Tool events are sent to the note-taking model: Claude through your login by default, cmem.ai if you pick CMEM Pro in the installer, or your own Gemini or OpenRouter key. Check which one the installer picked. docs.claude-mem.ai
The note-taker uses your Claude plan
The default provider runs on your Claude Code login with a Haiku model, and users report it using a large share of their limits. Point it at an API key or another provider to stop that. github.com
The Stop hook asks a model to summarize each turn
On Stop it runs claude-mem to request an end-of-turn summary and store it; SubagentStop and SessionEnd only mark work done. Set the summary-skip option to turn summaries off. github.com
SessionStart hooks start a service and edit your PATH
On session start it launches a local background worker, injects stored notes, and may compile a launcher into ~/.local/bin and append to your shell PATH. The Setup hook can run bun install on claude --init. github.com
The local worker has no sign-in
It listens on 127.0.0.1 without authentication. Binding it to 0.0.0.0 or forwarding its port exposes your settings, including provider API keys, to others. docs.claude-mem.ai
Telemetry is on by default
Anonymous usage counts go to PostHog, with no prompts or paths per the docs. Turn it off with the telemetry disable command or the DO_NOT_TRACK variable. docs.claude-mem.ai
Cloud Sync uploads full prompts when you turn it on
It is opt-in, and the docs say it uploads observation notes and full prompt text to your cmem.ai account. Leave it off if content must stay on your machine. docs.claude-mem.ai
It installs Bun and uv on first run
Missing runtimes are downloaded for you, and a Chroma vector index runs through uvx for search. docs.claude-mem.ai
Security advisories
Technical details
| Turning on read-only | No read-only mode. CLAUDE_MEM_DISABLE_OBSERVATION=1 stops capturing tool calls and CLAUDE_MEM_DISABLE_SUMMARY skips summaries, while stored notes are still injected at startup. |
|---|---|
| Talks to | The note-taking model you pick (Anthropic by default, cmem.ai, Gemini or OpenRouter). PostHog (anonymous telemetry, on by default). cmem.ai (only if you sign in, pick CMEM Pro or turn on Cloud Sync) |
| Sign-in and keys | Provider API keys sit in ~/.claude-mem/settings.json; the local worker API itself has no authentication. |
| Data retention | Notes stay in ~/.claude-mem/claude-mem.db until you delete them in the viewer or with SQL; CLAUDE_MEM_DATA_DIR moves the folder. Cloud Sync copies live on your cmem.ai account. |
| Scopes |
|
Works in
Claude Code is the main target. Other tools are installed through the npx installer.
Tap an app to see how to set it up and any known problems.
Cursor
SupportedRun the installer, pick Cursor, restart Cursor so hooks load. docs.claude-mem.ai
Windsurf
SupportedInstaller writes hooks to ~/.codeium/windsurf/hooks.json. docs.claude-mem.ai
Claude Desktop
SupportedSearch only: add the mcp-search server by hand. It does not capture sessions. docs.claude-mem.ai
Claude Code
Has issuesMain target. Add the marketplace, install the plugin, restart.
Known problems
- Open
Observer can't read Claude Code credentials from the macOS keychain after a token refresh
Since Nov 2026 · GitHub
- Open
On Windows 11 the hook launcher fails with EPERM during install
Since Nov 2026 · GitHub
- Open
Reported: the interactive npx installer uploads 30 days of prompts to cmem.ai
Workaround: The report covers only the interactive npx installer; install from the /plugin marketplace instead.
Since Oct 2026 · GitHub
- Open
Background observer can use a large share of your Claude plan
Workaround: Point the observer at a Gemini or OpenRouter key.
Since Oct 2026 · GitHub
Codex
Has issuesRun the installer with the codex-cli option, then trust the hooks.
OpenCode
Has issuesNeeds OpenCode 1.3.4 or later; restart OpenCode after install.
Known problems
- Open
OpenCode 1.19 shows a "context has no directory" plugin message
Since Nov 2026 · GitHub
Gemini CLI
Not checkedNot in the supported list. Docs cover Antigravity CLI, which reuses the ~/.gemini folder. docs.claude-mem.ai
What people say
People like that it remembers across sessions and dislike how much plan usage the background note-taker can use.
What people like
- Some developers name it among memory tools that actually cut token use.
- Vector search and the web viewer are hard to copy with simple hook scripts.
Common complaints
- The background note-taker can burn as many tokens as your real work on a Claude plan.
- An open issue says the npx installer's setup page uploads recent prompts to cmem.ai without a clear opt-in.
- One builder of a rival memory tool calls capturing every tool call noisy and token-expensive.
- Older versions scattered CLAUDE.md files through project folders; now off by default.
In their words
“The upload starts as soon as the setup page loads, and setup offers no way to stop it.”saltenaslGitHub issueOct 2026
“The observer made more API calls than all my real sessions put together.”youcef-moGitHub issueOct 2026
“The observer then spent the next 7+ hours on that session's backlog.”smrifat1411Hacker NewsMar 2026
“There are actually good tools to reduce token use like https://github.com/thedotmack/claude-mem and https://github.com/ory/lumen that actually work!”aeneas_ory
Included in this plugin
29
- Agent Cost Report
Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus r
109K GitHub stars - babysit
Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.
5.1K installs - backup-setup
Set up, check, or restore local claude-mem database snapshots. Use when the user says "set up backups", "back up my memories", "backup status", or "restore my database".
109K GitHub stars - build-and-release
Fully automate building and releasing a coding task.
109K GitHub stars - ccs-align
Run the CCS Align seat's hourly breathing cycle — prove the local claude-mem worker is healthy, pull needle observations through search → timeline → get_observations, land them in a seat-owned middle cache via atomic grab → append → filter exclude-marks → replace, manage exclude marks, and walk hous
109K GitHub stars - childhood
Babysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.
109K GitHub stars - cloud-sync
Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.
109K GitHub stars - design-is
Audit a design against Dieter Rams' ten "Good design is..." principles, then hand off a /make-plan prompt for one of three outcomes — new design, refine design, or redesign. Use when the user says "audit this design", "design review", "check this UI against Rams", "is this UI good", "critique this d
4.3K installs - do
Execute a phased implementation plan using subagents. Use when asked to execute, run, or carry out a plan — especially one created by make-plan.
109K GitHub stars - handoff
Generate a HANDOFF.md that captures goal, current state, files touched, failed attempts, and next steps — so a fresh Claude session can continue exactly where this one left off. Use when sessions are getting long, Claude keeps retrying the same broken solution, or the user wants to step away and res
109K GitHub stars - how-it-works
Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?".
5.2K installs - knowledge-agent
Build and query AI-powered knowledge bases from claude-mem observations. Use when users want to create focused "brains" from their observation history, ask questions about past work patterns, or compile expertise on specific topics.
5.8K installs - learn-codebase
Prime a codebase by reading every source file in full. Use when starting work on a new or unfamiliar project, or when the user asks to "learn the codebase", "read the codebase", "prime", or "get up to speed".
5.5K installs - make-plan
Create a detailed, phased implementation plan with documentation discovery. Use when asked to plan a feature, task, or multi-step implementation — especially before executing with do.
109K GitHub stars - mem-search
Smart search (default). Search claude-mem's persistent cross-session memory database in three steps: search, timeline, then selected get_observations. Use when user asks "did we already solve this?", "how did we do X last time?", or needs work from previous sessions.
109K GitHub stars - mode-creator
Interactively create, install, activate, and verify custom claude-mem modes, including domain-specific observation types, concept tags, optional Telegram alerts, bot setup, worker restart, and startup-context verification. Use this whenever someone asks to customize what claude-mem remembers, create
109K GitHub stars - oh-my-issues
Cluster a GitHub issue backlog by root cause into a small set of plan-master issues, redirect children with a standardized comment, and bundle architectural-fix PRs that close clusters atomically. Use when an issue tracker has accumulated dozens of reports that share underlying defects, when asked t
4.2K installs - owner-goals
Map what the owner wants from the prompts they typed themselves (prompts an agent wrote are left out), then sort it into focus areas, asks and rules, each with dated quotes, and save them to My Work (areas as My Focus suggestions, rules as My Rules suggestions). Use when asked for "owner goals", "my
109K GitHub stars - pathfinder
Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture. Use when asked to "find the ideal path," unify duplicated systems, or audit architecture before a refactor. Emits a proposed unified flowchart plus per-system /make-plan
5.3K installs - release
Fully automate a release with version-bump and childhood.
109K GitHub stars
Show all 29Show fewer
- request-progress
Group recent conversations into overall requests, review each one's progress from memory, sort each into one of the owner's focus areas, and write the build story, so My Work shows progress meters, shipping velocity and learned working preferences. Use when asked to "group requests", "group by overa
109K GitHub stars - screenpipe
Search screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.
109K GitHub stars - smart-explore
Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
7.4K installs - standup
Facilitate a read-only standup across git worktrees, branches, or PRs to compare changes and produce one consolidation plan.
3.5K installs - timeline-report
Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline. Use when asked for a timeline report, project history analysis, development journey, or full project report.
6.9K installs - version-bump
Automated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. npm publishing is done by the tag-triggered GitHub Actions
109K GitHub stars - weekly-digests
Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "w
4.2K installs - what-the
What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when.
109K GitHub stars - wowerpoint
Turn one document into a kawaii NotebookLM slide deck. Use for "wowerpoint this", "make a deck about <file>", "turn this report into slides", or any request to render a single document as shareable narrative slides.
4.6K installs
Questions
How do I install claude-mem?
Use the install box above. Run both commands in Claude Code, restart it, and you need Claude Code 2.1.139 or later and Node.js 20+. Do not use npm install -g claude-mem; that installs only the library and sets up no hooks.
Is claude-mem safe?
Mostly, with two things to check. It records every prompt and tool call and runs a background service, and an open issue says the npx installer uploaded recent prompts to cmem.ai. Install from the marketplace, check the selected provider, and see the safety section for each hook.
Where does claude-mem store my data?
On your machine in ~/.claude-mem/: a SQLite database, a Chroma vector index, logs and settings.json. Set CLAUDE_MEM_DATA_DIR to move it. The docs say nothing goes to cmem.ai unless you sign in, pick CMEM Pro or turn on Cloud Sync; an open issue disputes that for the npx installer (see below).
Which model compresses my sessions, and who pays?
By default your Claude Code login with the newest Haiku, so it counts against your Claude plan. The npx installer pre-selects CMEM Pro (cmem.ai gateway, 30-day trial, then it falls back to your Anthropic plan unless you subscribe). You can use your own Gemini, OpenRouter, Anthropic API key or Codex login instead.
How do I keep something out of memory?
Wrap it in <private>...</private>. Claude still sees it, but it is not stored. You can also skip tools (CLAUDE_MEM_SKIP_TOOLS), shell commands (CLAUDE_MEM_SKIP_BASH_PATTERNS) or whole folders (CLAUDE_MEM_EXCLUDED_PROJECTS). Auto-redaction of secrets exists but is off by default.
How do I delete stored memories?
Delete an observation, session or project in the web viewer, or delete old rows from claude-mem.db with SQL as the troubleshooting guide shows. With Cloud Sync on, deletes sync to every device. The worker prints the viewer address when it starts.
Does claude-mem send data anywhere?
Tool events go to the note-taking model you chose. Anonymous telemetry to PostHog is on by default and npx claude-mem telemetry disable turns it off. An open issue (#5176) reports that the interactive npx installer's setup page uploads your last 30 days of prompts to cmem.ai without asking; a consent fix is proposed but not merged as of November 2, 2026. Installing from the /plugin marketplace is not covered by that report.
Does claude-mem work in Codex, Cursor or the Claude app?
Codex CLI, Cursor, Windsurf and OpenCode work through the npx installer. The Claude app (Desktop) can only search memory through a hand-added server and does not capture anything. Gemini CLI is not on the supported list.
claude-mem vs Claude Code built-in memory?
Built-in memory (CLAUDE.md and auto memory) is plain files with no extra model calls. claude-mem records every tool call and searches it later, at the cost of a background model and a local service. Recall is a lighter MCP server where you choose what to save.
What is claude-mem-cowork?
A separate plugin in the same marketplace for Claude app cloud (Cowork) sessions. It streams tool use to cmem.ai and is licensed PolyForm Noncommercial, unlike claude-mem's Apache-2.0.
Information
updated Nov 2, 2026
- Runs in
- Claude Code
- Repository
- thedotmack/claude-mem
Sources
Docs, issue trackers and discussions this page is built from.
Show all 31Hide
- README quick start · github.com
- claude-mem installation docs · docs.claude-mem.ai
- Claude Desktop usage · docs.claude-mem.ai
- Platform integration · docs.claude-mem.ai
- Cursor setup · docs.claude-mem.ai
- claude-mem README · github.com
- claude-mem configuration docs · docs.claude-mem.ai
- claude-mem repository · github.com
- v15.8.1 release · github.com
- plugin/skills · github.com
- hooks.json · github.com
- plugin/.mcp.json · github.com
- mcp-server.ts · github.com
- Telemetry · docs.claude-mem.ai
- Cloud Sync (cmem.ai Pro) · docs.claude-mem.ai
- Installing claude-mem uploads your last 30 days of prompts to cmem.ai, no opt-in · github.com
- Claude provider observer drains subscription quota · github.com
- GHSA-5gvr-v6qv-h5mm · github.com
- Private tags · docs.claude-mem.ai
- Claude Code memory docs · code.claude.com
- marketplace.json · github.com
- claude-mem docs (full text) · docs.claude-mem.ai
- Observer can't read Claude Code credentials from macOS keychain after token refresh · github.com
- Windows 11: Hook launcher fails with EPERM during installation (v15.8.0) · github.com
- My Work auto-refresh falls back to codex exec and used up ChatGPT Codex quota · github.com
- Windows / Codex: Kaspersky blocks Worker startup · github.com
- OpenCode 1.19: OpenCode plugin skipped: context has no directory · github.com
- The plugin consume 50% of my tokens · github.com
- Hacker News thread · news.ycombinator.com
- Engram thread · news.ycombinator.com
- Adding persistent memory to Claude Code with claude-mem · dev.to