d2a8k3u/claude-code-memory

7 stars · Last commit 2026-06-24

A Claude Code plugin that gives Claude fully automatic, per-project cognitive memory with hybrid search, session lifecycle hooks, and local embeddings.

README preview

# Claude Code Memory

A [Claude Code](https://claude.ai/download) plugin that gives Claude fully automatic, per-project cognitive memory — powered by local embeddings and hybrid search.

## Features

- **Autonomous hook loop (v1.2)** — the plugin searches memory on every user prompt, before every file edit, before every Bash command, and when Claude uses Read/Grep/WebFetch. Claude doesn't need to remember to call `memory_search`.
- **Auto-saves** per turn with a prose summary (no meta-prefix boilerplate); user corrections automatically become `pattern` memories.
- **Auto-recalls** matching memories when Bash errors occur.
- **Auto-merges** near-duplicate memories on store (≥95% cosine similarity) and **auto-creates relations** on every write path.
- **Relation graph grows over time** — co-injected memories promote to `relates_to`; a periodic sweep (every 20 sessions) finds connections missed at insert time; relation weights evolve with usage.
- **Type-aware decay** — patterns decay slowly and boost aggressively on recall; episodics fade fast; semantic and procedural are permanent unless you delete them.
- **Cluster-aware retrieval** — when a memory is injected, its strongest neighbours (weight ≥ 0.5) come along.
- **Compact, markdown-stripped injection format** — no section headers; one line per memory with high-importance patterns starred.

## How Claude uses memory

| When this happens | The plugin does |
|---|---|
| You send a prompt | Searches semantic, pattern, and (if recall-style) episodic memory in parallel; injects ≤ 6 compact matches. |

View full repository on GitHub →