claude-mem
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
- 102.4k stars
- 9k forks
- 132 open issues
- Language: TypeScript
- License: Apache-2.0
- updated
Install
git clone https://github.com/thedotmack/claude-mem && cp claude-mem/*.md ~/.claude/agents/- Clone the repository and copy the agent .md definitions into ~/.claude/agents (or .claude/agents inside a project).
- Start a new Claude Code session to load the agents.
- Delegate work to them with the Task/Agent tool or by name.
Editor's note
Claude-Mem is a persistent memory compression system for Claude Code that captures tool usage observations during a session, compresses them into semantic summaries using AI, and automatically injects relevant context into future sessions so an agent retains knowledge of previous work across restarts. It installs via a single `npx claude-mem install` command and integrates with Claude Code as a plugin, available through the built-in plugin marketplace with `/plugin install claude-mem`. Beyond Claude Code, it also supports Gemini CLI and OpenCode through IDE-specific install flags. Storage is handled via SQLite and ChromaDB with embeddings-based retrieval, allowing relevant memories to be surfaced through MCP search tools rather than loading everything at once. The system targets developers running long-running agentic workflows who lose project context when sessions disconnect or restart. A notable detail is that memory retrieval uses RAG rather than full-context replay, keeping token usage contained while still surfacing accurate historical details.
22 items in this repository
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.
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 (so `npx claude-mem@X.Y.Z` resolves) is handed off to the human maintainer, who raised npm security.
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.
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 design", "design audit", or asks for a critique that should lead to a plan.
Execute a phased implementation plan using subagents. Use when asked to execute, run, or carry out a plan — especially one created by make-plan.
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?".
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.
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".
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.
Search claude-mem's persistent cross-session memory database. Use when user asks "did we already solve this?", "how did we do X last time?", or needs work from previous sessions.
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 or change a mode, track domain-specific notes, add observation types or tags, or send Telegram notifications for particular memories—even if they do not use the word "mode.
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 to triage / consolidate / cluster / dedupe issues, when asked to build a plan series or roadmap from open issues, or when routing a new incoming bug into an existing plan.
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 prompts.
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.
Facilitate a read-only standup across git worktrees, branches, or PRs to compare changes and produce one consolidation plan.
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.
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 the final human-required handoff because the maintainer raised npm security.
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 "weekly digests", "week-by-week story", "serial timeline", or "narrative chapters" of a project's history.
What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when.
Turn one document into a kawaii NotebookLM slide-deck PDF. 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.
Subagents overview
🇨🇳 中文 • 🇹🇼 繁體中文 • 🇯🇵 日本語 • 🇵🇹 Português • 🇧🇷 Português • 🇰🇷 한국어 • 🇪🇸 Español • 🇩🇪 Deutsch • 🇫🇷 Français • 🇮🇱 עברית • 🇸🇦 العربية • 🇷🇺 Русский • 🇵🇱 Polski • 🇨🇿 Čeština • 🇳🇱 Nederlands • 🇹🇷 Türkçe • 🇺🇦 Українська • 🇻🇳 Tiếng Việt • 🇵🇭 Tagalog • 🇮🇩 Indonesia • 🇹🇭 ไทย • 🇮🇳 हिन्दी • 🇧🇩 বাংলা • 🇵🇰 اردو • 🇷🇴 Română • 🇸🇪 Svenska • 🇮🇹 Italiano • 🇬🇷 Ελληνικά • 🇭🇺 Magyar • 🇫🇮 Suomi • 🇩🇰 Dansk • 🇳🇴 Norsk
Persistent memory compression system built for Claude Code.
src="https://raw.githubusercontent.com/thedotmack/claude-mem/main/docs/public/cm-preview.gif" alt="Claude-Mem Preview" width="500" > media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=thedotmack/claude-mem&type=date&theme=dark&legend=top-left" /> media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=thedotmack/claude-mem&type=date&legend=top-left" /> alt="Star History Chart" src="https://api.star-history.com/image?repos=thedotmack/claude-mem&type=date&legend=top-left" width="500" />
Quick Start • How It Works • Search Tools • Documentation • Configuration • Troubleshooting • License
Claude-Mem seamlessly preserves context across sessions by automatically capturing tool usage observations, generating semantic summaries, and making them available to future sessions. This enables Claude to maintain continuity of knowledge about projects even after sessions end or reconnect.
Quick Start
Install claude-mem for Grok Bot:
npx claude-mem install --ide grok-botGrok 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.
Awareness push pilot (LFG + Orifice): 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. Disable with CLAUDE_MEM_GROK_BOT_AWARENESS_ENABLED=false.
Install with a single command:
npx claude-mem installThe installer sets everything up first, then asks you to sign in to claude-mem in your browser (email magic link — no card required). Signing in provisions a memory key for your account and unlocks the claude-mem observer with a 30 Day Free Trial: 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.
Or install for OpenCode:
npx claude-mem install --ide opencodeThis works with OpenCode 1.3.4 or later, including OpenCode 2. Restart OpenCode after installing.
Or install for T3 Code (Codex and Claude Code providers):
npx claude-mem install --ide t3codeThe 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.
Or install for Antigravity CLI (setup guide):
npx claude-mem install --ide antigravityOr install for OMP (Oh My Pi):
npx claude-mem install --ide ompOr install the native Pi extension or DeepSeek Harness plugin:
npx claude-mem install --ide pi
npx claude-mem install --ide dsh --dsh-profile tuiPi and DeepSeek Harness use the worker runtime. See native harness setup for capture, recall, and troubleshooting.
Or install from the plugin marketplace inside Claude Code:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-memRestart 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-meminstalls the SDK/library only — it does not register the plugin hooks or set up the worker service. Always install vianpx claude-mem installor the/plugincommands above.
🦞 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 | bashThe 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.
Key Features:
🧠 Persistent Memory - Context survives across sessions
📊 Progressive Disclosure - Layered memory retrieval with token cost visibility
🔍 Smart Search (Default) - Query your project history with the three-step mem-search skill
🖥️ Local My Work - 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.
What people ask about claude-mem
What is thedotmack/claude-mem?
thedotmack/claude-mem is subagents for the Claude AI ecosystem. 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 It has 102.4k GitHub stars and its last recorded update is dated 2026-10-23.
How do I install claude-mem?
You can install claude-mem by cloning the repository (https://github.com/thedotmack/claude-mem) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is thedotmack/claude-mem safe to use?
Our security agent has analyzed thedotmack/claude-mem and assigned a Trust Score of 100/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains thedotmack/claude-mem?
thedotmack/claude-mem is maintained by thedotmack. The last recorded GitHub activity is dated 2026-10-23, with 132 open issues.
Are there alternatives to claude-mem?
Yes. On ClaudeWave you can browse similar subagents at /categories/agents, sorted by popularity or recent activity.
Maintain this repo? Show its Trust Score in your README
The badge shows this repository's current Trust Score and verdict, and links back to this page. It follows the catalogue data: nobody can buy or edit the score it displays.
[](https://claudewave.com/en/repo/thedotmack-claude-mem)<a href="https://claudewave.com/en/repo/thedotmack-claude-mem"><img src="https://claudewave.com/api/badge/thedotmack-claude-mem" alt="ClaudeWave Trust Score for thedotmack/claude-mem" width="320" height="64"></a>