exportlisted
Install: claude install-skill anipotts/claude-code-tips
<!-- tested with: claude code v2.1.122 -->
When the user runs `/lore:export`, write a portable snapshot of the lore data they care about. Default destination is the current working directory; respect any path the user gives.
## locate the database
`````bash
DB="$HOME/.claude/lore/lore.db"
[ -f "$DB" ] || DB="$HOME/.claude/mine.db"
if [ ! -f "$DB" ]; then echo "no lore.db -- run /lore once to seed it"; exit 0; fi
`````
## intents
| user phrasing | export | format |
|---|---|---|
| "export notes", "save my notes" | notes table | json (default) or markdown |
| "export sessions" | sessions table | json or csv |
| "export project X" | project slice (sessions + notes + file list) | json bundle |
| "export cooccurrences" | file_cooccurrences view | csv (large -- prefer csv) |
| "export everything", "full snapshot" | all tables | json bundle in a directory |
If the user doesn't specify a format, infer: bulk graph data → csv (smaller), structured/nested → json, anything they'll read by eye → markdown.
## destination
Default: `./lore-export-<YYYYMMDD>.<ext>` in cwd. If the user gives a path, use it. If a file already exists at the destination, ask before overwriting.
## queries
### notes (json)
`````bash
OUT="${1:-./lore-notes-$(date +%Y%m%d).json}"
sqlite3 -json "$DB" "SELECT * FROM notes ORDER BY created_at DESC;" > "$OUT"
echo "wrote $OUT ($(wc -l < "$OUT") lines)"
`````
### notes (markdown)
`````bash
OUT="${1:-./lore-notes-$(date +%Y%m%d).md}"
{
echo "# lore notes ex