Skip to main content
← Blog/Tutorial

Give Claude Code
Persistent Memory

OMEGA team7 min read

Install OMEGA as an MCP server with pip install omega-memory. OMEGA stores decisions, preferences, lessons, and project context in local SQLite with semantic search. Your Claude Code agent remembers everything it learned — conventions, debugging insights, architectural decisions — across every session. No API keys, no cloud accounts, no Docker.

The Problem: Claude Code Forgets Everything

Claude Code ships with two persistence mechanisms: CLAUDE.md and MEMORY.md. They are plain markdown files that your agent reads at session start and occasionally appends to. That is the entire memory system.

The limitations are significant. MEMORY.md is capped at 200 lines. There is no semantic search — your agent has to read the entire file and hope the relevant information is near the top. There is no deduplication, so the same lesson gets written multiple times until it crowds out everything else. There is no contradiction detection, so a decision from Monday and a conflicting decision from Thursday coexist without any flag.

The result is predictable. Session 1: your agent figures out that your project uses Tailwind v4 with CSS-based configuration, not tailwind.config.js. Session 2: it generates a tailwind.config.js anyway, because the note about v4 either was not saved, was buried in 200 lines of other notes, or was overwritten by a newer, less useful observation.

What OMEGA Adds

OMEGA is a persistent memory engine that runs as an MCP server. It gives your Claude Code agent 25 memory tools that replace the flat-file approach with a structured, searchable, intelligent memory system. Here is what changes:

Semantic Search
Memories are embedded with bge-small-en-v1.5 (384-dim, ONNX). Your agent searches by meaning, not string matching. "How do we handle auth?" finds the decision about JWT tokens even if the word "auth" was never stored.
Auto-Capture
Session hooks detect decisions, corrections, and lessons as your agent works. No manual omega_store() calls needed for routine context — it captures what matters automatically.
Contradiction Detection
When a new memory conflicts with an existing one, OMEGA flags it and tracks which supersedes. Your agent never silently acts on outdated information.
Intelligent Forgetting
Time decay ensures old, unreferenced memories lose ranking weight. Recent and frequently accessed memories surface first. Stale context does not crowd out current decisions.
Graph Relationships
Memories link to each other with typed edges: related, supersedes, contradicts. Your agent can trace how a decision evolved over time.
Multi-Agent Coordination
Multiple Claude Code sessions can share the same memory database. Parallel agents see each other's file locks, intent announcements, and completed work.

Installation: Three Steps, Five Minutes

Step 1: Install OMEGA

terminal
$ pip install omega-memory

This installs the omega-memory package from PyPI. It includes the MCP server, SQLite storage engine, ONNX embedding model (bge-small-en-v1.5, ~33MB), and all 25 memory tools. Python 3.11+ required.

Step 2: Configure MCP

Add OMEGA as an MCP server in your Claude Code settings. Open your project's .claude/settings.json or your global ~/.claude.json and add:

settings.json
{
  "mcpServers": {
    "omega": {
      "command": "python3",
      "args": ["-m", "omega", "serve"]
    }
  }
}

That is the entire configuration. No environment variables, no tokens, no connection strings. OMEGA creates its data directory at ~/.omega/ on first run and stores everything in a local SQLite database.

Step 3: Verify

Start a new Claude Code session. If OMEGA is configured correctly, your agent will have access to memory tools like omega_welcome, omega_store, and omega_query. You can verify by asking your agent:

Claude Code session
> Do you have access to OMEGA memory tools?

Claude: Yes, I can see the OMEGA MCP server is connected.
I have access to omega_welcome, omega_store, omega_query,
and 22 other memory tools. Let me call omega_welcome()
to load context...

How It Works

OMEGA organizes memories by type. Each type has different retention rules, retrieval weights, and behavior:

Memory TypeWhat Gets StoredRetention
decision"Use Zustand instead of Redux for this project"Permanent
lesson_learned"pytest-asyncio needs mode=auto in pyproject.toml"14 days
user_preference"User prefers single quotes in Python"Permanent
error_pattern"CORS fails on Vercel preview deploys without explicit origin"14 days
fact"The API rate limit is 100 req/min per key"30 days
session_summary"Migrated auth from NextAuth to Clerk"7 days

Your agent stores memories explicitly with omega_store and retrieves them with omega_query. Here is what those calls look like in practice:

Storing a decision
omega_store(
  content="Use Tailwind v4 with CSS-based config. Do not
  generate tailwind.config.js — this project uses
  @theme in app/globals.css instead.",
  event_type="decision"
)
Querying memory
omega_query(
  query="How is Tailwind configured in this project?",
  mode="semantic"
)

# Returns:
# [0.94] "Use Tailwind v4 with CSS-based config..."
# [0.71] "Global styles are in app/globals.css..."
# [0.65] "Design tokens use CSS custom properties..."

The score next to each result is semantic similarity. Your agent gets the most relevant memories first, ranked by a combination of semantic match, recency, access frequency, and memory type priority. This is not keyword search — it understands what you mean, not just what you typed.

Before vs. After

The difference is most visible in repeated interactions. Here are concrete examples of how agent behavior changes with OMEGA:

You correct a wrong import path
Without OMEGA

Agent makes the same mistake next session. The correction was never persisted.

With OMEGA

OMEGA auto-captures the correction as a lesson. Next session, the agent retrieves it before writing imports.

You choose Prisma over Drizzle
Without OMEGA

Agent suggests Drizzle again two sessions later. MEMORY.md was full and the note was dropped.

With OMEGA

Stored as a permanent decision. Any query about ORM, database, or schema returns this decision first.

Two parallel agents edit the same file
Without OMEGA

Both agents write conflicting changes. You manually resolve the mess.

With OMEGA

OMEGA's coordination layer shows file locks and intent announcements. The second agent sees the conflict before writing.

Your agent debugs a CORS issue for the third time
Without OMEGA

Agent re-discovers the fix from scratch each time. 10 minutes of wasted context window.

With OMEGA

The error pattern from Session 1 surfaces instantly. Agent applies the known fix in seconds.

95.4%
LongMemEval score
25
MCP tools
0
API keys required
AES-256
Encryption

Frequently Asked Questions

How do I give Claude Code persistent memory across sessions?

Install OMEGA with pip install omega-memory, add it as an MCP server in your Claude Code settings, and start a new session. Your agent will automatically have access to 25 memory tools for storing and retrieving context across sessions.

Does Claude Code have built-in memory?

Claude Code has CLAUDE.md and MEMORY.md files that persist basic notes. These are limited to 200 lines of flat text with no semantic search, no deduplication, no contradiction detection, and no auto-capture. OMEGA replaces these limitations with a full memory engine.

Does OMEGA require an API key or cloud account?

No. OMEGA runs entirely locally using SQLite for storage and ONNX for embeddings. There are no API keys, no cloud accounts, and no Docker required. Everything stays on your machine, encrypted with AES-256.

Can OMEGA work with other tools besides Claude Code?

Yes. OMEGA is an MCP server, so it works with any MCP-compatible client: Claude Code, Cursor, Windsurf, Claude Desktop, and others. The same memory database is shared across all of them.

What is OMEGA's accuracy on memory benchmarks?

OMEGA scores 95.4% on LongMemEval, the standard benchmark for long-term AI memory. This measures retrieval accuracy across temporal reasoning, knowledge updates, and multi-session recall.

Your agent should remember what it learned.
One install. One config line. Persistent memory across every session.
pip install omega-memory

OMEGA is free, local-first, and Apache 2.0 licensed.