context-memory CLAUDE.md

Repository instructions for context-memory, a Claude Code plugin that saves and searches information between sessions using SQLite, a local database, and FTS5 text search.

In plain words
What is it for?
Use them when working on session saving, recall searches, database setup and cleanup, the dashboard, or automatic context-saving hooks.
Why use it?
They explain how the plugin stores context and how its files, commands, and conventions fit together, so changes do not break saved session data.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/erebusenigma/context-memory/claude-md
Clone the repo
git clone --depth 1 https://github.com/ErebusEnigma/context-memory
Per session 742 This file is loaded in full into every session.
When invoked 742 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00742 $0.00742
Opus 5 $0.00371 $0.00371
Sonnet 5 $0.00148 $0.00148
Haiku 4.5 $0.00074 $0.00074

Measured 2d ago against content hash 0fdd76bb2bbf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-memory CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — context-memory

Project Overview

A Claude Code plugin that provides persistent, searchable context storage across sessions using SQLite + FTS5. Users save sessions with /remember and search with /recall.

Structure

.claude-plugin/plugin.json   # Plugin manifest (version, metadata)
.mcp.json                    # MCP server config (project-level)
skills/context-memory/        # Skill definition (SKILL.md)
  scripts/
    __init__.py              # Package init, version, public API re-exports
    db_init.py               # Schema creation, verification, stats, migrations
    db_save.py               # Session storage logic, deduplication
    db_search.py             # FTS5 search (tier 1 + tier 2)
    db_prune.py              # Database pruning (by age/count)
    db_utils.py              # Connection management, helpers, VALID_TABLES
    mcp_server.py            # MCP server (FastMCP, stdio transport)
    dashboard.py             # Web dashboard (Flask REST API + SPA)
    auto_save.py             # Stop hook: cross-platform auto-save wrapper
    pre_compact_save.py      # PreCompact hook: saves full context before compaction
    static/                  # Dashboard frontend (vanilla JS, CSS)
  references/
    schema-reference.md      # Full database schema reference
commands/                     # /remember and /recall command definitions
hooks/                        # Auto-save stop hook + PreCompact checkpoint hook

Dev Commands

python skills/context-memory/scripts/db_init.py --verify  # Verify schema
python skills/context-memory/scripts/db_init.py --stats   # DB statistics
python skills/context-memory/scripts/db_prune.py --max-sessions 100 --dry-run  # Preview prune
python skills/context-memory/scripts/dashboard.py          # Launch web dashboard (localhost:5111)
python -m pytest tests/ -v                                # Run tests
ruff check .                                              # Lint

Conventions

  • Python >= 3.8 compatibility required
  • Line length: 120 characters
  • SQLite FTS5 for full-text search with summary-ranked BM25 + multi-source boost
  • VALID_TABLES is defined once in db_utils.py — import it, don't redefine
  • STATS_TABLES excludes internal tables (like schema_version) from user-facing stats
  • Use get_connection() context manager for all DB access
  • All table names in SQL must be validated against VALID_TABLES (no raw f-strings)
  • Bare except: is not allowed — always catch specific exceptions
  • Schema changes require a new migration in MIGRATIONS dict and CURRENT_SCHEMA_VERSION bump

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 72 lines · 742 tokens per session scan A 0fdd76bb2bbf

Subscribe to this mod's changes

context-memory CLAUDE.md is an instructions file published in the GitHub repository ErebusEnigma/context-memory (5 stars, last pushed 6mo ago), licensed MIT. It adds 742 tokens to every session, about $0.0037 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.