Episodic memory does not index subagent conversation files
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
- Have a session where Claude dispatches work to subagents (via the Agent tool)
- Subagent conversation is stored in
~/.claude/projects/<project>/<sessionId>/subagents/agent-<id>.jsonl - In a later session, use
episodic-memory:search-conversationsto search for content from that subagent conversation - 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
Wrong repo — episodic-memory is at obra/episodic-memory. Refiling there.