[BUG] Session summaries propagate across unrelated project directories via parentSessionId chain
Resolved 💬 3 comments Opened Nov 28, 2025 by LaurieScheepers Closed Dec 2, 2025
Description
Session summary records from one project directory appear in the JSONL session files of completely unrelated project directories stored under ~/.claude/projects/.
Observed Behaviour
When searching for a specific summary string across all project directories:
rg '"summary":"[Summary Text]"' ~/.claude/projects/
The same summary appears in multiple unrelated project subdirectories, despite:
- Never working on that topic in those projects
- The projects being completely unrelated codebases
- No corresponding user/assistant messages related to that summary existing in those sessions
Root Cause Analysis
- Sessions have
parentSessionIdorparentUuidreferences creating continuation chains - When sessions are continued and the working directory changes, the session chain crosses project boundaries
- Summary records are inherited/propagated along the parent chain without validating project scope
- This causes summaries to "leak" into unrelated project directories
Steps to Reproduce
- Start Claude Code in
/path/to/project-a - Work normally, allowing summary generation
- Continue/resume the session
- Change working directory to
/path/to/project-b(different codebase) - Continue working (session continuation maintains parentSessionId link)
- Check
~/.claude/projects/-path-to-project-b/*.jsonlsession files - Observe: Summary records from project-a appear in project-b's session files
Expected Behaviour
- Summaries should be scoped to their originating project directory
- Session continuation should not propagate summaries across project boundaries
- Each
~/.claude/projects/{project}/directory should only contain summaries relevant to that project
Actual Behaviour
- Summaries propagate via parentSessionId chain regardless of project boundaries
- The same summary text appears in multiple unrelated project subdirectories
- Session files contain
summaryrecords with no corresponding content in that session
Distinction from #2597
Issue #2597 (closed as duplicate) describes cross-SESSION contamination within the same project directory. This bug describes cross-PROJECT contamination across different ~/.claude/projects/ subdirectories - a distinct and potentially more severe manifestation.
Impact
- Misleading session history when using
/resume - Incorrect context when examining session files programmatically
- Privacy concern: one project's context visible in another project's session directory
- Storage pollution with irrelevant summary data
Environment
- Claude Code version: 1.0.128
- Platform: macOS Darwin 24.6.0
Suggested Fix
- Validate that parentSessionId references are within the same project directory before inheriting summaries
- Scope summary generation to current project context only
- Do not write summaries to session files if the working directory differs from the parent session's directory
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗