Why
/resume lists sessions by title only. After a few weeks of use, finding "that session where we fixed the auth race" means opening files one by one. Also no way to branch a session to try a different approach.
What
Two related features:
- Full-text session search — index session titles + message content in SQLite FTS5 (Bun has built-in
bun:sqlite). /resume <query> filters the picker by content match; klaatai sessions search <query> works headlessly. Index lives under ~/.klaatai/, built lazily/incrementally on session save.
/fork [directive] — start a new session seeded with a copy of the current history, recording parent_session_id in the new session's metadata. Optional directive string becomes the first user message of the fork.
Where to start
- Session JSONL store +
/resume picker: src/screens/repl.ts
- There is already a local SQLite usage example in
src/tools/local-db.ts
Acceptance criteria
- Search returns matches on message content, not just titles; stale index entries cleaned when sessions are deleted
- Fork produces an independent resumable session; parent untouched
- typecheck + tests green
Why
/resumelists sessions by title only. After a few weeks of use, finding "that session where we fixed the auth race" means opening files one by one. Also no way to branch a session to try a different approach.What
Two related features:
bun:sqlite)./resume <query>filters the picker by content match;klaatai sessions search <query>works headlessly. Index lives under~/.klaatai/, built lazily/incrementally on session save./fork [directive]— start a new session seeded with a copy of the current history, recordingparent_session_idin the new session's metadata. Optional directive string becomes the first user message of the fork.Where to start
/resumepicker:src/screens/repl.tssrc/tools/local-db.tsAcceptance criteria