Skip to content

Session full-text search + /fork #33

Description

@aakashrajput

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:

  1. 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.
  2. /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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions