claude-mem: Persistent Context Across Sessions for AI Agents

This repository profile is provided by osrepos.com, an open source repository discovery platform.

claude-mem: Persistent Context Across Sessions for AI Agents

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

Analyzed by OSRepos on May 20, 2026

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-search skill.
  • 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

Related repositories

Similar repositories that may be relevant next.

text-to-cad: AI Agent Skills for CAD, CAE, and CAM Workflows

text-to-cad: AI Agent Skills for CAD, CAE, and CAM Workflows

September 24, 2026

text-to-cad is a comprehensive Python library developed by earthtojake, providing a rich set of agent skills for Computer-Aided Design (CAD), Computer-Aided Engineering (CAE), and Computer-Aided Manufacturing (CAM). It enables AI agents to generate, inspect, source, slice, and manage CAD and robot-description artifacts, streamlining complex engineering processes.

agentsai-agentscad
dcc-mcp-blender: AI-Driven 3D Workflows with an Embedded MCP Server

dcc-mcp-blender: AI-Driven 3D Workflows with an Embedded MCP Server

September 24, 2026

dcc-mcp-blender is a powerful Blender addon that integrates an embedded Streamable HTTP MCP server directly into Blender. This allows any MCP-compatible AI client to seamlessly control and automate your 3D modeling, animation, and rendering workflows. It offers over 200 pre-built tools and an extensible skill system for robust production environments.

blenderaiai-agents
Guaardvark: Your Self-Hosted AI Studio for Agents, Media, and Code

Guaardvark: Your Self-Hosted AI Studio for Agents, Media, and Code

September 21, 2026

Guaardvark is a comprehensive, self-hosted AI studio designed for local execution of advanced AI tasks. It integrates coding agents, media generation (video, image, music, voice), and robust RAG capabilities, all running on a single GPU. This platform prioritizes privacy and user control, enabling a full AI workstation experience on your own hardware.

aiai-agentsself-hosted
AgentsKit: The Complete JavaScript Toolkit for Building AI Agents

AgentsKit: The Complete JavaScript Toolkit for Building AI Agents

September 20, 2026

AgentsKit is a comprehensive JavaScript toolkit designed for building AI agents, offering a lightweight core and a modular ecosystem. It provides essential components like UIs, autonomous runtime, tools, memory, and RAG, enabling developers to create sophisticated agents from simple chat interfaces to complex autonomous systems. This framework aims to simplify agent development by offering composable parts and avoiding the need to glue multiple incompatible libraries together.

agent-frameworkai-agentstypescript

Source repository

Open the original repository on GitHub.

16 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️