[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

  1. Sessions have parentSessionId or parentUuid references creating continuation chains
  2. When sessions are continued and the working directory changes, the session chain crosses project boundaries
  3. Summary records are inherited/propagated along the parent chain without validating project scope
  4. This causes summaries to "leak" into unrelated project directories

Steps to Reproduce

  1. Start Claude Code in /path/to/project-a
  2. Work normally, allowing summary generation
  3. Continue/resume the session
  4. Change working directory to /path/to/project-b (different codebase)
  5. Continue working (session continuation maintains parentSessionId link)
  6. Check ~/.claude/projects/-path-to-project-b/*.jsonl session files
  7. 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 summary records 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

  1. Validate that parentSessionId references are within the same project directory before inheriting summaries
  2. Scope summary generation to current project context only
  3. Do not write summaries to session files if the working directory differs from the parent session's directory

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗