# Claude-Mem — Persistent Memory Plugin > Claude-Mem adds memory across agent sessions. Install with npx, restart your IDE/CLI, then search observations via mem-search or the local viewer. ## Install Copy the content below into your project: ## Quick Use 1. Install the verified entrypoint: ```bash npx claude-mem install ``` 2. Run a first local check: ```bash Restart your CLI/IDE, then continue your normal agent workflow ``` 3. Add a repeatable verification step: ```bash Open http://localhost:37777 (Web Viewer UI) ``` --- ## Intro Claude-Mem is a verified GitHub-backed asset sourced from `thedotmack/claude-mem` with 74,744 stars and a Apache-2.0 license snapshot. Best for: developers who run many short agent sessions and want context continuity without manual copy/paste. Works with: Node.js + npx install flow; integrates with Claude Code, Gemini CLI, OpenCode (per repo). Setup time: 6 minutes. ### Quantitative notes - Local viewer UI on http://localhost:37777 (repo) - Setup time ~6 minutes --- ## Deep Dive ### What it solves Use this when you need a **repeatable, team-shareable workflow** instead of one-off agent prompts. The goal is to make installation, first-run validation, and rollback **predictable**. ### Minimal mental model - Treat the GitHub repo as the source of truth: install instructions, configs, and upgrade paths live there. - Keep your first run small: one command, one verification, one rollback plan. - Capture a baseline: setup time, first successful run, and one real task completed end-to-end. ### Safe rollout checklist 1. **Verify source**: confirm repo URL, stars, and license match what you expect. 2. **Install** using the Quick Use commands above. 3. **Prove it works** with the verification command; save the output in a note or issue. 4. **Operationalize**: document owner, upgrade command, and rollback command. ### Troubleshooting (common) - **Install succeeds but nothing shows up** - Likely cause: the tool needs a restart/reload (CLI/IDE) or a config file in the right path. - Fix: restart the client, then re-run the verification step. - **Works on one machine, fails on another** - Likely cause: Node/Python/Docker versions differ or missing system dependencies. - Fix: pin versions (Node/Python), and copy a minimal known-good config. - **Token cost or latency is worse than expected** - Likely cause: tool schemas or verbose outputs get injected into context. - Fix: prefer smaller steps, cache results, and keep tool responses concise when possible. --- ### FAQ **Q: Is `npm install -g` enough?** A: The repo warns the global npm install is SDK-only; use `npx claude-mem install` to register hooks and worker service. **Q: How do I control what gets stored?** A: Use the repo's privacy controls (e.g., tags) and keep secrets out of logs by default. **Q: How do I validate it is working?** A: Confirm the local viewer loads, then check that new sessions reference recent observations when relevant. --- ## Source & Thanks > GitHub: https://github.com/thedotmack/claude-mem > Owner avatar: https://avatars.githubusercontent.com/u/683968?v=4 > License (SPDX): Apache-2.0 > Stars (verified via `api.github.com/repos/thedotmack/claude-mem`): 74,744 --- # Claude-Mem——跨会话持久记忆插件 > Claude-Mem 为 Claude Code、Gemini CLI 等提供跨会话持久记忆:自动捕获工具观察并压缩总结,在新会话注入相关上下文;支持本地 Web Viewer 与 mem-search 搜索。 ## 快速使用 1. 安装(以仓库为准): ```bash npx claude-mem install ``` 2. 首次运行/检查: ```bash Restart your CLI/IDE, then continue your normal agent workflow ``` 3. 可重复验证: ```bash Open http://localhost:37777 (Web Viewer UI) ``` --- ## 简介 Claude-Mem 已核验来源于 `thedotmack/claude-mem`(74,744 stars,许可证 Apache-2.0)。适合:频繁启动/切换会话、希望上下文可持续而不手动复制粘贴的开发者。兼容:Node.js + npx 安装;可与 Claude Code、Gemini CLI、OpenCode 集成(见仓库说明)。装机时间:6 分钟。 ### 量化信息 - 本地 Web Viewer: http://localhost:37777(仓库说明) - 装机约 6 分钟 --- ## 深度说明 ### 解决什么问题 把“找到项目 → 安装 → 首次验证 → 回滚/升级”变成可复用流程,避免只靠一次性提示词或截图操作。 ### 最小心智模型 - GitHub 仓库是事实来源:安装、配置、升级、已知问题都以它为准。 - 第一次只做最小闭环:一个命令安装、一个命令验证、一个可回滚方案。 - 记录基线:装机耗时、首次成功输出、完成 1 个真实任务的证据。 ### 安全推广清单 1. **核验来源**:确认仓库 URL / stars / license 与预期一致。 2. 按“快速使用”完成安装与首次检查。 3. 跑通“验证命令”,把输出留档。 4. 标注 owner,并写清升级/回滚步骤。 ### 常见排障 - **装了但看不到效果** - 常见原因:需要重启 CLI/IDE 或配置文件路径不对。 - 处理:重启后再跑一遍“验证命令”。 - **一台机器能跑,另一台不行** - 常见原因:Node/Python/Docker 版本差异或缺少系统依赖。 - 处理:固定版本,并拷贝最小可用配置。 - **token 成本/延迟超预期** - 常见原因:工具 schema 或输出过长被塞进上下文。 - 处理:拆小步骤、缓存结果、尽量让工具输出更短。 --- ### FAQ **Q: `npm install -g` 就够吗?** A: 仓库提示全局 npm 安装只装 SDK;要注册 hook/worker 需用 `npx claude-mem install`。 **Q: 怎么控制哪些内容会被保存?** A: 使用仓库提供的隐私控制(如 标签),默认把密钥从日志和观察里排除。 **Q: 怎么验证生效?** A: 先确认本地 viewer 能打开,再观察新会话是否会在合适时机引用最近的观察摘要。 --- ## 来源与感谢 > GitHub:https://github.com/thedotmack/claude-mem > Owner avatar:https://avatars.githubusercontent.com/u/683968?v=4 > 许可证(SPDX):Apache-2.0 > GitHub stars(已通过 `api.github.com/repos/thedotmack/claude-mem` 核验):74,744 --- Source: https://tokrepo.com/en/workflows/claude-mem-persistent-memory-plugin Author: Agent Toolkit