← All open source projects

claude-mem

thedotmack/claude-mem

claude-mem is a persistent memory system for AI agents that captures session context and injects relevant fragments into future runs.

Forks 7,028
Author thedotmack
Language JavaScript
License Apache-2.0
Synced 2026-06-10

What it is

claude-mem is a project for persistent context across AI-agent sessions. Agents often forget previous commands, decisions, and fixed errors; claude-mem tries to preserve that information between runs.

It supports Claude Code, Gemini CLI, Codex, OpenClaw, and similar agent environments. It uses lifecycle hooks, a worker service, search, and compression to bring relevant fragments into new sessions.

What is inside

The repository contains installation scripts, hook architecture, a local worker service, web viewer, search, documentation, beta features, and integrations. It describes hooks such as SessionStart, UserPromptSubmit, PostToolUse, Stop, and SessionEnd.

A practical flow is to install claude-mem, restart the agent tool, use it across several sessions, and check whether useful context appears without manual note copying.

Lifecycle idea

This snippet shows which session moments can be captured and later returned as context.

Language: Plain text
SessionStart -> load relevant memory
PostToolUse -> capture action
Stop -> summarize session
Next session -> inject context

Strengths and limits

The strength is reducing context loss. Long coding tasks need memory of decisions, local project details, and already investigated dead ends.

The limitation is privacy and noise. The system observes agent work, so storage, cleanup, and secret handling matter. Bad memory can confuse the agent instead of helping.