Skip to content

Long-term, self-managed memory for Claude Code using hooks, MCP tools, and SQLite

License

Notifications You must be signed in to change notification settings

codenamev/claude_memory

Repository files navigation

ClaudeMemory

Long-term memory for Claude Code - automatic, intelligent, zero-configuration

Gem Version

What It Does

ClaudeMemory gives Claude Code a persistent memory across all your conversations. It automatically:

  • ✅ Extracts durable facts from conversations (tech stack, preferences, decisions)
  • ✅ Remembers project-specific and global knowledge
  • ✅ Provides instant recall without manual prompting
  • ✅ Maintains truth (handles conflicts, supersession)

No API keys. No configuration. Just works.

Quick Start

1. Install the Gem

gem install claude_memory

2. Install the Plugin

From within Claude Code, add the marketplace and install the plugin:

# Add the marketplace (one-time setup)
/plugin marketplace add codenamev/claude_memory

# Install the plugin
/plugin install claude-memory

3. Analyze Your Project

Run the analyze command to bootstrap memory with your project's tech stack:

/claude-memory:analyze

This reads your project files (Gemfile, package.json, etc.) and stores facts about languages, frameworks, tools, and conventions.

4. Verify Setup

claude-memory doctor

Use with Claude Code

Just talk naturally! Memory happens automatically.

You: "I'm building a Rails app with PostgreSQL, deploying to Heroku"
Claude: [helps with setup]

# Behind the scenes:
# - Session transcript ingested
# - Facts extracted automatically
# - No user action needed

Later:

You: "Help me add a background job"
Claude: "Based on my memory, you're using Rails with PostgreSQL..."

👉 See Getting Started Guide → 👉 View Example Conversations →

How It Works

  1. You chat with Claude - Tell it about your project
  2. Facts are extracted - Claude identifies durable knowledge
  3. Memory persists - Stored locally in SQLite
  4. Automatic recall - Claude remembers in future conversations

👉 Architecture Deep Dive →

Key Features

  • Dual Scope: Project-specific + global user preferences
  • Privacy First: <private> tags exclude sensitive data
  • Progressive Disclosure: Lightweight queries before full details
  • Semantic Shortcuts: Quick access to decisions, conventions, architecture
  • Truth Maintenance: Automatic conflict resolution
  • Claude-Powered: Uses Claude's intelligence to extract facts (no API key needed)
  • Token Efficient: 10x reduction in memory queries with progressive disclosure

Privacy Control

Exclude sensitive data from memory using privacy tags:

You: "My API key is <private>sk-abc123</private>"
Claude: [uses it during session]

# Stored: "API endpoint configured with key"
# NOT stored: "sk-abc123"

Supported tags: <private>, <no-memory>, <secret>

Documentation

For Developers

  • Language: Ruby 3.2+
  • Storage: SQLite3 (no external services)
  • Testing: 583 examples, 100% core coverage
  • Code Style: Standard Ruby
git clone https://github.com/codenamev/claude_memory
cd claude_memory
bin/setup
bundle exec rspec

👉 Development Guide →

Support

License

MIT - see LICENSE.txt


Made with ❤️ by Valentino Stoll

About

Long-term, self-managed memory for Claude Code using hooks, MCP tools, and SQLite

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages