claude code plugin that turns every session into a deterministic knowledge graph.
.claude-plugin/plugin.json- plugin manifesthooks/hook.py- unified hook dispatcher (all events, one file)hooks/hooks.json- hook event registrationsscripts/mine.py- bulk session parser (backfill, incremental, export). canonical filename retained for source-import compatibility through v2.x; will be renamedlore.pyonce the bun port landsscripts/notes.py- CRUD for the user-controllednotestable (schema v3); backs/lore:rememberscripts/anthropic_canonical.py- parallel ingest of Anthropic-canonical session sources so /usage and /lore agreescripts/_common.py- shared helpers (CLAUDE_DIR, LORE_DIR, now_iso, prefer, safe_load_json, migrate_legacy_files, log_stderr)scripts/schema.sql- database schema (v3: addsnotestable +file_cooccurrencesview)commands/lore.md-/loreslash command (entry point, routes to skills/query)commands/remember.md/commands/graph.md/commands/export.md- knowledge-graph commandsskills/query/SKILL.md- intent routing (dashboard, search, health, costs, patterns)skills/help/SKILL.md-/lore:helpskills/remember/SKILL.md-/lore:remember(capture decisions/lessons/reminders into the notes table)skills/graph/SKILL.md-/lore:graph(file cooccurrence, project files, sibling sessions)skills/export/SKILL.md-/lore:export(json/csv/markdown snapshots)tests/- pytest suite (test_mine.py, test_hooks.py, test_notes.py)
- all hooks handled by hook.py - no bash, no jq
- stdout = visible to claude (warnings, search recall)
- stderr = debug logging only
- database at
~/.claude/lore/lore.db(v2.0+); legacy~/.claude/mine.dbis migrated automatically on first run, kept as backup - ignore file at
~/.claude/lore/.loreignore(legacy~/.claude/.mineignorehonored as fallback) - all SQL uses parameterized queries
- no cross-plugin paths: lore is standalone, never reaches into
~/.claude/cc/or~/.claude/time/
The graph has two storage modes plus one deferred:
- derived from JSONL -- sessions, messages, tool_calls, errors. Built by
mine.py, fully recomputable. - user-tagged -- the
notestable, populated only by/lore:remember. Schema v3. - computed views --
file_cooccurrences(pairs of files touched in the same session). Recomputed live, no pipeline. - deferred --
session_resumes(no clean marker in JSONL),error_resolutions(too heuristic without tagged ground truth). Reconsider once/lore:rememberdata accumulates.