superpowers icon indicating copy to clipboard operation
superpowers copied to clipboard

Episodic memory does not index subagent conversation files

Open skinnyandbald opened this issue 8 months ago • 1 comments

Bug Description

The episodic-memory plugin (v1.0.15) only indexes top-level .jsonl session files in ~/.claude/projects/<project>/. It does not discover or index subagent conversation files stored in ~/.claude/projects/<project>/<sessionId>/subagents/*.jsonl.

Any conversation that happened via a dispatched subagent (Agent tool) is invisible to episodic memory search, even though the full conversation data exists on disk.

Steps to Reproduce

  1. Have a session where Claude dispatches work to subagents (via the Agent tool)
  2. Subagent conversation is stored in ~/.claude/projects/<project>/<sessionId>/subagents/agent-<id>.jsonl
  3. In a later session, use episodic-memory:search-conversations to search for content from that subagent conversation
  4. No results found

Evidence

Querying the SQLite index directly:

-- Parent session IS indexed (36 exchanges)
SELECT COUNT(*) FROM exchanges WHERE session_id = '24ea1b5d-...';
-- Returns: 36

-- Subagent sessions are NOT indexed
SELECT COUNT(*) FROM exchanges WHERE session_id LIKE 'agent-%';
-- Returns: 0

The content exists in subagent JSONL files on disk (confirmed via grep), but the indexer never scans <sessionId>/subagents/ subdirectories.

Root Cause

In src/indexer.ts, file discovery only scans for *.jsonl at the top level of each project directory. It does not recurse into session subdirectories.

Impact

  • Subagent conversations often contain the most detailed content (deep research, code analysis, exploration)
  • The parent session typically only has a brief summary of what the subagent returned
  • Users may believe session data was lost when it's actually just not indexed
  • Subagent-heavy workflows (research, parallel exploration, code review) are disproportionately affected

Environment

  • Claude Code Desktop (macOS)
  • episodic-memory plugin v1.0.15
  • ~5,193 session files across 48 projects

skinnyandbald avatar Mar 27 '26 00:03 skinnyandbald

Wrong repo — episodic-memory is at obra/episodic-memory. Refiling there.

skinnyandbald avatar Mar 27 '26 00:03 skinnyandbald