Commit Graph
13 Commits
Author SHA1 Message Date
tommy0103 89b53d4570 docs: establish helper-first retrieval as default entry point
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.
2026-06-10 03:28:15 +08:00
tommy0103 10b51d8878 fix(indexer): derive project_path from message cwd instead of slug decoding
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.
2026-06-10 03:15:32 +08:00
tommy0103 807e5141fa feat(query): add overview() for project-aware session/memory discovery
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.
2026-06-10 03:04:11 +08:00
tommy0103 34f3a164ab feat(memory): persistent memory layer with remember/recall CodeAct API
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.
2026-06-10 02:05:27 +08:00
tommy0103 dff88bbb37 refactor(skill): extract retrieval-semantics.md, compress pitfalls.md Move query design principles (scope/plan/structure/evidence) and field
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.
2026-06-07 20:31:31 +08:00
tommy0103 0128881d04 docs: add learned-facet detail pass and session-window pitfall
Teach the agent to derive second-pass filters from first-pass evidence
  instead of pulling large message windows. Add the pattern and a pitfall
  warning against defaulting to LIMIT 25 transcript browsing.
2026-06-07 18:35:08 +08:00
tommy0103 700ca0bdd3 docs: sharpen query routing, output budget, and field-name pitfalls 2026-06-07 18:23:00 +08:00
tommy0103 3ded54f642 docs: add one-shot synthesis pattern and turn-cost pitfall
Teach the agent to keep intermediate retrieval inside the query script
  and return compact evidence in a single turn, instead of spending
  multiple conversation rounds showing raw results. Add the pattern to
  query-patterns.md and the rationale to pitfalls.md.
2026-06-07 17:41:24 +08:00
tommy0103 297ef01eaf refactor(docs): restructure SKILL.md into progressive-disclosure layers
Split the monolithic skill prompt into three tiers:
  - Core API (search/context/sql) stays in the first prompt
  - Structured helpers listed as one-liners with filter signatures
  - Detailed patterns and pitfalls extracted to references/

  Add references/query-patterns.md (copyable CodeAct recipes) and
  references/pitfalls.md (scope, FTS, ordering, compactness traps).
  Clarify project scope semantics (slug vs path vs cwd) throughout.
  Add ORDER BY timestamp DESC to failures() for newest-first default.
2026-06-07 16:42:41 +08:00
tommy0103 67513b793f feat(workflow): enrich workflow/agent metadata from workflowProgress;
lightweight workflowTree, build debounce, minor fixes

  - Index phase, label, model, state, duration, tokens per workflow agent
  - Index duration, total_tokens, status, name per workflow run
  - workflowTree returns parsed result + agent summaries instead of
    dumping all messages
  - 30s debounce on buildIndex to avoid repeated directory scans
  - Fix broken BASH_EXIT_PAT (SQLite LIKE has no character classes)
  - Fix SKILL.md step numbering, document FTS5 hyphen limitation
2026-06-04 15:49:57 +08:00
tommy0103 ab828364ad feat(index): capture cwd, skill, turn_duration, is_error from JSONL;
expose FTS5 rank and cwd filter in search()
2026-06-03 19:18:22 +08:00
tommy0103 fb35cca8fe feat(query): unified filter opts across all list-returning APIs
Add sessions() as first-class entry point for session discovery with
  project/time/branch filters. Extend summaries, workflows, failures,
  subagents, fileHistory with the same opts vocabulary that search()
  already had — no more pulling full datasets to filter client-side.
2026-06-02 01:36:47 +08:00
tommy0103 bc9b6dde72 build(obelisk): let Claude Code search its own session history
- SQLite + FTS5 index over ~/.claude JSONL transcripts.
  - Agent writes JS queries at runtime — same sandbox pattern as workflows.
  - Covers sessions, subagents, workflow executions, tool calls, and full-text search.
2026-05-30 03:21:35 +08:00