larvling/skills/query/SKILL.md
Query, insert, update, or inspect tables in the larvling SQLite database (larvling.db). Use when the user asks to search sessions, messages, topics, statements, tasks, or updates, run reports, or interact with the larvling database.
npx skillsauth add athrael-soju/larvling queryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Schema:
sessions (id TEXT PK, started_at TEXT, ended_at TEXT, duration_min REAL, title TEXT, agent_summary TEXT, exchange_count INT, summary_at TEXT, summary_msg_count INT, tags TEXT, summary_offered INT DEFAULT 0)messages (id INT PK AUTO, session_id TEXT FK, timestamp TEXT, role TEXT, content TEXT, metadata TEXT)topics (id INTEGER PK AUTO, title TEXT NOT NULL, domain TEXT NOT NULL, tags TEXT NOT NULL, created TEXT, updated TEXT)statements (id INTEGER PK AUTO, topic_id INTEGER FK→topics(id), claim TEXT NOT NULL, created TEXT, updated TEXT)tasks (id INTEGER PK AUTO, title TEXT NOT NULL, domain TEXT NOT NULL, status TEXT DEFAULT 'open', priority TEXT DEFAULT 'medium', horizon TEXT DEFAULT 'later', metadata TEXT, created TEXT, updated TEXT)updates (id INTEGER PK AUTO, task_id INTEGER FK→tasks(id), content TEXT NOT NULL, timestamp TEXT)JSON metadata columns (query with json_extract(metadata, '$.field')):
tasks.metadata — optional; {"source_session_id": "<sid>"} from add_task when a session id is known, else NULLmessages.metadata — user: {"cwd", "permission_mode", "usage": {...}}; assistant: {"tool_calls": {<tool>: <count>}, "usage": {...}}; system: analysis telemetryquery.py runs your SQL as-is — no template, no required shape. Let the question scope the query: "today/now" → horizon='now', "overview/how many" → COUNT/GROUP BY, detail → narrow columns (substr(claim,1,160) for long text), sized to what's asked — add a LIMIT only when the result would otherwise be excessive, not by reflex. Table mode does not truncate — a result over ~16KB is refused with an error asking you to re-scope; pass --full only when you genuinely want every row.
Execute the SQL directly. Append --json for JSON output.
$PY "${CLAUDE_PLUGIN_ROOT}/scripts/query.py" "$ARGUMENTS"
testing
Audit and consolidate Larvling's knowledge base, tasks, and sessions
tools
Generate or view a session summary
tools
Show a quick overview of Larvling's state
tools
Browse and search past sessions