Purpose: Claude Code sessions are ephemeral; discussion content is lost after closing the terminal. context-memory provides long-term memory for Claude Code, saving each session to a local SQLite database and supporting retrieval, avoiding repeated explanations or re-debugging.
Main capabilities: cross-session saving and recall; /remember generates structured AI summaries (brief/detailed text, key decisions, problems solved, technologies used, result classification success/partial/abandoned); full-text search based on FTS5 and Porter stemming; two-level retrieval (summary ranking <10ms, deep content <50ms); filtering by project or global; automatic topic extraction; saving code snippets with language and context; Stop hook automatically saves sessions (head-tail sampling preserves questions and conclusions, and captures git branch); PreCompact hook saves full conversation checkpoints, recoverable via the context_load_checkpoint MCP tool; session deduplication and loop protection; web dashboard (17 REST APIs, chart analysis, code highlighting); optional MCP server provides six tools (context_search, context_save, context_stats, context_init, context_load_checkpoint, context_dashboard); CLI scripts support database saving, searching, pruning, and initialization; cross-platform and pure Python standard library implementation.
Usage: The installer copies the skill, commands, and hooks to ~/.claude/ and initializes the database, and can be run repeatedly to upgrade. Common commands include /remember [note] to save a session, /recall <query> [--project] [--detailed] [--limit N] to search. The core scripts db_save.py, db_search.py, db_prune.py, db_init.py all have argparse CLIs. The database is located at ~/.claude/context-memory/context.db.
Applicable scenarios: finding historical work on a topic, reviewing details of a session, searching only the current project, locating sessions by git branch. Limitations: the core requires Python 3.8+; the MCP server requires Python 3.10+ and pip install mcp; the web dashboard requires pip install flask flask-cors; installation and specific flag details are not yet fully provided.