From agent-memory
Provides persistent memory for Claude Code across context compactions using session dumps to markdown, QMD vault search, and re-injection. Use for memory architecture discussions, context loss debugging, or agent-memory explanations.
npx claudepluginhub k3nnethfrancis/agent-utils --plugin agent-memoryThis skill uses the workspace's default tool permissions.
This plugin provides persistent memory across context compactions using three components:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Performs token-optimized structural code search using tree-sitter AST parsing to discover symbols, outline files, and unfold code without reading full files.
This plugin provides persistent memory across context compactions using three components:
Before Claude Code compacts context, the hook dumps the full conversation to a markdown file at $SESSIONS_DIR/{session_id}.md. It tracks how many lines have been processed so subsequent compactions append incrementally.
Configuration: Set SESSIONS_DIR env var (defaults to ~/sessions). Works best pointed at a directory inside a markdown vault so the notes become searchable.
QMD indexes your markdown vault locally (BM25 keyword search, semantic vector search, hybrid rerank). Runs entirely on-device using Metal GPU. The MCP server exposes search tools Claude can use during sessions.
Requires: qmd installed (bun install -g @tobilu/qmd or npm install -g @tobilu/qmd), vault indexed (qmd index /path/to/vault).
After compaction, this hook extracts key terms from the dumped session, queries QMD for relevant vault notes, and injects the results back into Claude's context. The agent maintains continuity without manual re-prompting.
Only fires after compaction (matcher: "compact"), not on fresh session starts.
Session active → context fills up → PreCompact dumps to markdown →
Claude compacts → SessionStart fires → QMD searches vault →
relevant context re-injected → session continues with memory
| Variable | Default | Purpose |
|---|---|---|
SESSIONS_DIR | ~/sessions | Where session dumps are written |
bun install -g @tobilu/qmdqmd index /path/to/vaultSESSIONS_DIR to a directory inside your vault (recommended)SESSIONS_DIR at a vault subdirectory (e.g., ~/notes/sessions/) so session dumps become searchable by QMDqmd index /path/to/vault &