Make overview() + memories() + search() the standard first pass for
broad retrieval tasks, with sql() positioned as an escalation path for
exact joins/aggregations. Add a Default First Pass section to SKILL.md,
a copyable first-pass pattern to query-patterns.md, and update
retrieval-semantics.md to reinforce the helper-before-sql principle.
The old slug-to-path conversion (replace hyphens with slashes) was
lossy and wrong for paths containing hyphens. Now infers project_path
from the most-frequent observed cwd across session messages, falling
back to slug decoding only when no cwd data exists. Adds
refreshSessionProjectPaths() to backfill existing sessions on rebuild.
Resolves current project from cwd, lists all known projects with session
and memory counts, and returns the current project's recent sessions and
memories in one call. Enables the agent to orient itself at the start of
a retrieval without multiple exploratory queries.
Add a memories table (survives index rebuilds) for agent-written
conclusions with provenance (session, message range, project). The agent
writes markdown files via Write tool (user-approved), then registers
them via a --remember CodeAct script with remember(). Recall via
memories() in --query scripts, filtered by project/session/time.
Separates query (read-only, assertReadOnlySql) from remember (write)
execution contexts in runtime.mjs.
semantics (context types, ordering, project scopes) out of pitfalls.md
into a new retrieval-semantics.md. Pitfalls.md becomes a compact debug
checklist: missing columns, FTS errors, over-large output, empty results.
SKILL.md query routing updated to point at the three reference tiers.