query
Solidquery the lore knowledge graph for sessions, costs, tools, projects, search, and patterns
AI & Automation 27 stars
5 forks Updated today MIT
Install
Quality Score: 80/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
When the user runs /lore (or asks anything that requires reading their session history), interpret their intent and query the lore SQLite database accordingly. The database lives at ~/.claude/lore/lore.db (v2.0+) with a fallback at ~/.claude/mine.db (v1.x). All queries below read from the resolved path.
<!-- tested with: claude code v2.1.122 -->
## ALWAYS use the absolute path
When constructing sqlite3 queries below, ALWAYS use the absolute path. Bare `mine.db` or `lore.db` (without the directory) will create empty stub files in the current working directory. Set `DB="$HOME/.claude/lore/lore.db"; [ -f "$DB" ] || DB="$HOME/.claude/mine.db"` once at the top of any heredoc and use `$DB` everywhere.
## Step 0: Check database exists and is fresh
Run this FIRST:
`````bash
MISSING=""
command -v sqlite3 >/dev/null 2>&1 || MISSING="$MISSING sqlite3"
command -v python3 >/dev/null 2>&1 || MISSING="$MISSING python3"
if [ -n "$MISSING" ]; then echo "MISSING_DEPS|$MISSING"; exit 0; fi
DB="$HOME/.claude/lore/lore.db"
[ -f "$DB" ] || DB="$HOME/.claude/mine.db"
if [ ! -f "$DB" ]; then echo "NO_DB"; exit 0; fi
LATEST=$(sqlite3 -noheader "$DB" "SELECT MAX(start_time) FROM sessions WHERE is_subagent = 0;" 2>/dev/null)
TOTAL=$(sqlite3 -noheader "$DB" "SELECT COUNT(*) FROM sessions WHERE is_subagent = 0;" 2>/dev/null)
FIRST=$(sqlite3 -noheader "$DB" "SELECT MIN(start_time) FROM sessions WHERE is_subagent = 0;" 2>/dev/null)
NEWEST_JSONL=$(find ~/.claude/projects -name "*.jsonl" -newer "$DB" 2...
Details
- Author
- anipotts
- Repository
- anipotts/claude-code-tips
- Created
- 5 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Integrates with
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
graph
explore relationships in the lore knowledge graph - cooccurring files, project sessions, sibling sessions, tagged notes
27 Updated today
anipotts AI & Automation Solid
miner
usage stats, costs, search, tools
3 Updated today
habibbedawi AI & Automation Listed
help
all /lore intents, examples, and setup
27 Updated today
anipotts