By zhangfengcdt
Version and recall Claude Code sessions with taxonomy-structured memory, supporting branch isolation and time-travel audit via git-based storage, collecting telemetry to enable persistent recall.
Indexes this folder and saves a persistent overview that future sessions pick up automatically. In a git repo this writes `codebase:onboard` (code-shape map). In a non-git folder this writes `project:onboard` (file-shape index built by deterministic extractors — no LLM at index time).
Recall memories from past sessions via memoir. Delegates to the memory-recall skill. Pass --include-metrics to include machine-generated turn statistics (excluded by default).
Manually capture a memory now (independent of Stop-hook auto-capture). Pass -p <path> to skip classification.
Show memoir store status — current branch, commit count, memory count, namespaces.
Launch (or re-open) the memoir web UI for the current project's store.
Populate or refresh a persistent, high-level project snapshot in memoir. In a git repo this writes `codebase:onboard` (code-shape: modules, goals, rules, lessons) — use when: (1) the user asks for onboarding / a codebase tour ('what does this project do', 'give me a codebase overview', 'onboard me to this repo'); (2) the user explicitly runs `/memoir:onboard` or `/memoir:onboard --force`; (3) the SessionStart context hints `no codebase:onboard snapshot yet` or tags the existing snapshot `stale`; (4) a prior `/memoir-sync-branch` suggested refreshing because the merged diff changed code meaningfully. In a non-git folder this writes `project:onboard` (file-shape: per-file structured blobs) using deterministic stdlib extractors instead of LLM passes — use for writing, video editing, bookkeeping, and other mixed-media projects. Snapshot contents seed future sessions via SessionStart injection. Skip for ordinary recall (use memory-recall) or trivial one-file questions.
Recall facts from past sessions via memoir. STORE PATH: ALWAYS compute first via `STORE=$(bash "$CLAUDE_PLUGIN_ROOT/scripts/derive-store-path.sh")` (or `$MEMOIR_STORE`). Pass `-s "$STORE"` on every call — never rely on memoir's connected default (frequently stale). PROCEDURE (single-shot default): ONE `summarize --depth 3 -n default` → pick at most 5–7 keys → batch `get`. Only escalate to drill (batched `--keys`) if the depth-3 response shows `total_memories > 1000` AND the query is broad. Never call `summarize --depth 1` separately — `--depth 3` already returns count + full key listing. EXCLUDE `metrics.*` unless args contain `--include-metrics`. NEVER shell out to `memoir recall` (legacy LLM-bundled, slow, requires OPENAI_API_KEY). First reply line MUST be a mode marker `[mode=get|fast|drill|flat|blame|diff]`. DEFAULT ON: invoke for any question or task that may depend on past preferences, decisions, conventions, or knowledge — questions touching prior state, meta/overview asks, design/implementation prompts where output may reflect prior style, SessionStart hints, or any moment you'd otherwise silently apply remembered facts. SKIP only for mechanical single-symbol lookups, throwaway scratch work, or explicit user opt-out. Defer to memoir-onboard for repo-structure questions (it owns `codebase:onboard`). Cost of an unused recall is low; cost of missing a remembered preference is high.
Runs pre-commands
Contains inline bash commands via ! syntax
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Git for AI Memory
Hierarchical Memory with Git-Like Version Control
Memoir is a high-performance semantic memory system for AI agents that brings Git-like version control to AI memory management. It replaces opaque vector databases with transparent, versioned, cryptographically secure memory storage using hierarchical semantic paths.
Project page: memoir-ai.dev — full overview, demos, and roadmap.
AI memory is a Global Variable anti-pattern. Every production agent hits the same three walls: context contamination, token rent, and memory drift. Memoir brings version control to your agent's mind.
Your agent doesn't respect your git state.
Context contamination happens every time you git checkout. Without branch-aware memory, your agent tries to apply experimental refactor patterns to stable production hotfixes.
You're paying "token rent" on a flat file.
Using CLAUDE.md or MEMORY.md as a global store is a cache-killer. Every minor memory update invalidates your entire prefix cache, forcing you to pay full price to re-process your entire conversation.
Your agent's memory is code without version control.
Today's AI memory — CLAUDE.md, vector stores, scratchpads — is treated like an append-only blob. One bad session poisons every future retrieval. Without memoir blame or memoir checkout, there's no way to audit who taught the agent a rule or revert a hallucination without wiping the whole store.
profile.professional.skills.python.pip install memoir-ai
The distribution name on PyPI is
memoir-ai. The Python import isimport memoirand the CLI ismemoir.
Inside a Claude Code session, run:
/plugin marketplace add zhangfengcdt/memoir
/plugin install memoir@memoir
No manual pip install needed if you have uv on PATH — the plugin auto-resolves to uvx --from memoir-ai memoir when the bare memoir binary isn't installed. Don't have uv? Install it once with the standard one-liner:
curl -LsSf https://astral.sh/uv/install.sh | sh
That's enough — the plugin handles the rest. It registers hooks for session start, user-prompt-submit, and stop, so your project gets automatic context injection and auto-captured memories. See the Claude Code plugin guide for the full slash-command and hook reference.
Memoir's CLI defaults to Anthropic claude-haiku-4-5 as of v0.1.6 — set your key first:
export ANTHROPIC_API_KEY="sk-..."
Then create a store and round-trip a memory:
# 1. Create a memoir store
memoir new my-memoir-store
cd my-memoir-store
# 2. Store with an explicit path (offline, no LLM call)
memoir remember "Sarah prefers tabs and 2-space indents" -p preferences.coding.style
# 3. Store with auto-classification (LLM picks the path; needs API key)
memoir remember "I work in Pacific time"
# 4. Read back by path (offline)
memoir get preferences.coding.style
# 5. Semantic search (LLM-backed)
memoir recall "what does Sarah prefer?"
# 6. Open the visual explorer (auto-opens in your browser)
memoir ui
Curious what the UI looks like before installing? Browse the UI Gallery.
npx claudepluginhub zhangfengcdt/memoir --plugin memoirPersistent memory for AI coding agents. Survives across sessions and compactions.
OpenLTM — Long-Term Memory for AI coding agents: semantic search, context injection, session learning
Automatic semantic memory for Claude Code — remembers what you worked on across sessions
Multi-tiered memory and knowledge base with semantic search, auto-compaction, and built-in evaluation. Works across Claude Code, Copilot CLI, OpenCode, Cline, and Cursor.
Persistent semantic memory for Claude Code — auto-injects relevant context at session start, captures git commits, test results, and research via hooks, and provides 30+ MCP tools for memory management.
Auto-capture high-signal coding context into memctl memory