claude-mem: Persistent Context Across Sessions for AI Agents
This repository profile is provided by osrepos.com, an open source repository discovery platform.
Summary
claude-mem is an innovative GitHub repository designed to provide persistent context across sessions for various AI agents. It intelligently captures agent activities, compresses them using AI, and injects relevant information into future interactions. This powerful tool supports a wide range of AI platforms, including Claude Code, OpenClaw, Gemini, and Copilot.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
claude-mem is a powerful open-source repository by thedotmack that provides persistent context across sessions for various AI agents. It addresses a critical challenge in AI development: enabling agents to retain and leverage knowledge from past interactions. By automatically capturing agent activities, compressing them with AI, and injecting relevant context into future sessions, claude-mem ensures a continuous and intelligent workflow. This system is designed to work seamlessly with a wide array of AI platforms, including Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, and OpenCode, making it an invaluable tool for developers building sophisticated AI applications.
Installation
Getting started with claude-mem is straightforward. The primary installation method is via npx:
npx claude-mem install
For specific IDEs, you can use the --ide flag:
# For Gemini CLI (auto-detects ~/.gemini)
npx claude-mem install --ide gemini-cli
# For OpenCode
npx claude-mem install --ide opencode
If you are using Claude Code, you can install it directly from the plugin marketplace:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
After installation, restart your AI environment (e.g., Claude Code or Gemini CLI) for the changes to take effect. Context from previous sessions will then automatically appear in new sessions.
Note: While claude-mem is also on npm, npm install -g claude-mem only installs the SDK/library and does not set up the necessary plugin hooks or worker service. Always use npx claude-mem install or the /plugin commands for full functionality.
For OpenClaw Gateway integration, use the dedicated installer:
curl -fsSL https://install.cmem.ai/openclaw.sh | bash
Examples
claude-mem enhances AI agent capabilities with intelligent memory search through a token-efficient, 3-layer workflow pattern. This approach optimizes context retrieval, saving tokens and improving performance.
The 3-Layer Workflow:
search: Get a compact index with IDs (e.g., ~50-100 tokens per result).timeline: Get chronological context around interesting results.get_observations: Fetch full details ONLY for filtered IDs (e.g., ~500-1,000 tokens per result).
Here's an example of how to use these tools:
// 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])
This method allows AI agents to efficiently query their memory, focusing on relevant information and significantly reducing token usage compared to fetching full details upfront.
Why Use It
claude-mem offers a suite of features designed to elevate the performance and intelligence of your AI agents:
- Persistent Memory: Ensures context survives across sessions, allowing agents to build on past knowledge.
- Progressive Disclosure: Provides layered memory retrieval with clear token cost visibility, optimizing resource usage.
- Skill-Based Search: Query your project history using natural language with the
mem-searchskill. - Web Viewer UI: A real-time memory stream available at http://localhost:37777 for easy monitoring and debugging.
- Privacy Control: Use
<private>tags to exclude sensitive content from storage, maintaining data confidentiality. - Automatic Operation: Requires no manual intervention, seamlessly integrating into your agent's workflow.
- Token Savings: The 3-layer search workflow provides approximately 10x token savings by filtering before fetching full details.
By integrating claude-mem, developers can empower their AI agents with robust, long-term memory capabilities, leading to more coherent, efficient, and intelligent interactions.
Links
- GitHub Repository: https://github.com/thedotmack/claude-mem
- Official Documentation: https://docs.claude-mem.ai/
- Official X Account: @Claude_Memory
- Official Discord: Join Discord
Related repositories
Similar repositories that may be relevant next.

Loop Engineering: Orchestrating AI Agents with Practical Patterns and Tools
June 25, 2026
Loop Engineering is a GitHub repository offering practical patterns, starters, and CLI tools for building robust AI coding agent systems. It shifts the focus from individual prompt crafting to designing control systems that orchestrate agents over time. This project empowers developers to create autonomous, iterative AI workflows for various development tasks.
My Virtual World: A Self-Hosted 3D AI Virtual World for Agent Harnesses
June 16, 2026
My Virtual World is an innovative self-hosted 3D AI virtual environment designed for agent harnesses such as OpenClaw and Hermes. It allows AI agents to live, work, move between buildings, and interact with objects in a persistent voxel-style world. This project offers a unique platform for developing and observing AI agent behaviors in a rich, customizable 3D setting.
Deliberation: Multi-Agent LLM Consensus for Code and Plan Review
June 15, 2026
Deliberation is an innovative GitHub repository that enables Claude Code to leverage multiple LLMs like GPT, Gemini, Grok, and 400+ OpenRouter models for expert second opinions and arbiter-mediated consensus. It provides specialized AI agents for tasks such as code review, security analysis, and architectural design, ensuring comprehensive and reliable feedback. This project helps developers get diverse perspectives and achieve higher quality in their work.

Zeroboot: Sub-millisecond VM Sandboxes for AI Agents
June 11, 2026
Zeroboot is an innovative open-source project that delivers sub-millisecond VM sandboxes, primarily designed for AI agents and other applications requiring extremely fast, isolated code execution environments. It leverages copy-on-write forking and Firecracker microVMs to achieve hardware-enforced isolation with minimal overhead. This approach enables rapid, secure code execution, ideal for high-performance AI applications.
Source repository
Open the original repository on GitHub.
7 counted GitHub visits