Skip to content

Searchable data layer over Claude Code session transcripts #12

Description

@DSado88

The Insight

Claude Code generates rich .jsonl session transcripts at ~/.claude/projects/. This is the most complete record of AI-assisted software engineering that exists — every tool call, every file read, every decision, every mistake, every learning. But it's completely opaque:

  • 374 project directories, 9.4 GB of session data on one developer's machine
  • Single sessions can be 99 MB / 21,000 lines (21k structured events)
  • Message types: assistant (8.5k), user (5.9k), progress (6.2k), file-history-snapshot (441), system (242)
  • No search, no index, no way for Claude to learn from its own history

Claude has no persistent memory. But the transcripts ARE the memory — they're just not queryable.

Vision

A data layer (probably DuckDB-backed) that indexes Claude Code session transcripts so Claude can search its own history across sessions and projects. This may be a separate product from Squall, or a major extension of it.

What it could answer

  • "What did we learn about auth last Tuesday?"
  • "Find the session where we fixed the race condition in the review executor"
  • "Which reviews found real bugs vs false positives?"
  • "Show me every time I used tokio::select! — what patterns worked?"
  • "What files do I modify most often across all projects?"
  • "Summarize the 3 sessions I had on the memory module this week"

What it would index

From the jsonl events:

Field Source Value
session_id Filename (UUID) Groups all events in one conversation
project_path Directory name Which codebase
timestamp Event field When
type assistant, user, system, progress, file-history-snapshot What kind of event
tool_name Tool use events Read, Edit, Write, Bash, Grep, Glob, etc.
tool_input Tool use parameters File paths read/edited, commands run, search queries
content Assistant/user text The actual conversation
files_touched Extracted from tool calls Which files were read/modified
git_branch Event metadata Branch context

Derived/computed fields

Field How
session_summary LLM-generated summary of session purpose and outcome
decisions_made Extract key decisions from assistant messages
bugs_found Cross-reference with Squall review results
patterns_learned Extract from memorize calls and skill updates
files_by_frequency Aggregate file access across sessions

Architecture Sketch

~/.claude/projects/**/*.jsonl
        │
        ▼
   [ Indexer ]  ← runs on-demand or watches for changes
        │
        ▼
   ~/.claude/index/sessions.duckdb
        │
        ├── sessions(session_id, project, start_ts, end_ts, summary, git_branch)
        ├── events(event_id, session_id, ts, type, tool_name, content_preview)
        ├── file_access(session_id, file_path, access_type, count)
        └── search_index(event_id, content_fts)  ← DuckDB full-text search
        │
        ▼
   [ MCP Tool: "recall" ]
        │
        ├── recall search "race condition fix"
        ├── recall session <uuid> --summarize
        ├── recall files "src/memory/global.rs" --history
        └── recall week --summary

Open Questions

  1. Separate product or Squall extension? Squall is a model dispatch + memory server. This is a session intelligence layer. Different concerns, maybe different binary.
  2. Indexing strategy? Full ingest (9.4 GB) vs incremental (watch for new sessions) vs on-demand (index when queried).
  3. Privacy/security? Session transcripts contain everything — API keys, file contents, passwords. Index must be local-only, encrypted at rest?
  4. LLM summarization? Generating session summaries requires sending content to an LLM. Use local models? Squall's existing dispatch?
  5. Scale? 374 projects × N sessions × 21k events per session. DuckDB handles this fine, but FTS index size?
  6. Integration with Claude Code? Could this be an MCP server that Claude Code auto-connects to? Or a hook that runs post-session?

Why This Matters

Every Claude Code user generates this data. Nobody can search it. The developer who can query "what did I learn last week across all my projects" has a compounding advantage over the one starting fresh every session.

This is the missing feedback loop: sessions → index → recall → better sessions.

Data Sample

Current session (this Squall project):

21,492 lines / 99 MB
8,494 assistant messages
5,855 user messages
6,181 progress events
441 file snapshots
242 system messages

Full corpus:

374 project directories
~9.4 GB total
47 sessions in Squall alone

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions