Inspired by thedotmack/claude-mem.
Source: thedotmack/claude-memReverse-engineered from real GitHub workflow.
A Claude Code plugin that automatically captures everything Claude does during your coding sessions, compresses it with AI (using Claude's agent-sdk), and injects relevant context back into future sessions.
Build a persistent memory compression system for Claude Code that captures coding sessions and injects compressed context into future sessions.
claude "Initialize persistent memory for this project"I need you to build Claude-Mem, a TypeScript plugin system that captures and compresses Claude's coding session activities to provide persistent memory across sessions. Here's what this needs to do:
The core idea is that when you're using Claude Code, everything Claude does—file edits, decisions made, problems encountered, solutions implemented—gets automatically captured and stored. This context then gets compressed using Claude's own agent SDK to create a meaningful summary that can be injected back into future coding sessions so Claude remembers what happened before.
The architecture should support multiple integration points: there's a Claude Code plugin interface, a Cursor hooks system, an MCP (Model Context Protocol) server integration, and support for other agents like Windsurf. Think of it as a memory management layer that sits between your IDE and Claude.
For the tech stack, use TypeScript throughout. You'll need Express for running a local server that handles the memory capture and injection. Use the Anthropic Claude Agent SDK for compressing memories intelligently—this is key because you're using Claude to summarize Claude's work. Integrate with the Model Context Protocol to expose memory operations as tools. Use Tree-Sitter for parsing code files across multiple languages (you'll see tree-sitter bindings for Python, JavaScript, TypeScript, Rust, Go, etc.) so you can understand what code changed at a structural level, not just line diffs.
For the UI and configuration, use React and Handlebars for rendering. Use Zod for schema validation since you're dealing with structured memory objects. The system needs to handle transcript watching and replay—there's a transcript-watch system that monitors your coding session and captures meaningful checkpoints.
The plugin should work with Bun as the runtime (see bunfig.toml), and it needs comprehensive language support for parsing and analyzing code. It should have a RAG (retrieval-augmented generation) component called "ragtime" for searching through historical memories. There's also an "openclaw" module which seems to handle specific agent integrations.
Make sure to include a local installation system, Docker support for deployment, and comprehensive documentation in multiple languages. The system needs to be robust enough to handle real coding sessions without losing data, so include proper error handling and a changelog to track breaking changes. Support configuration through YAML and environment variables, and make sure the memory compression is efficient so it doesn't bloat over time—that's why the AI-powered summarization is critical rather than just storing raw transcripts.