claude-code - 💡(How to fix) Fix 2.1.110: title generation creates orphan session files [4 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49290Fetched 2026-04-17 08:45:27
View on GitHub
Comments
4
Participants
3
Timeline
11
Reactions
0
Timeline (top)
labeled ×5commented ×4closed ×1cross-referenced ×1

Claude Code 2.1.110 creates 2-3 orphan .jsonl session files every time a new session starts. Each orphan contains only a single ai-title JSON entry and no conversation data. These accumulate in the project's session directory and appear in the --resume picker as broken entries.

Not present in 2.1.104.

Root Cause

Root Cause (Observed)

Code Example

ls -la ~/.claude/projects/<encoded-path>/*.jsonl

---

{"type":"ai-title","aiTitle":"<generated title>","sessionId":"<uuid>"}
RAW_BUFFERClick to expand / collapse

Summary

Claude Code 2.1.110 creates 2-3 orphan .jsonl session files every time a new session starts. Each orphan contains only a single ai-title JSON entry and no conversation data. These accumulate in the project's session directory and appear in the --resume picker as broken entries.

Not present in 2.1.104.

Reproduction

  1. Install CC 2.1.110 (native)
  2. cd into any project directory
  3. Run claude and send any message
  4. Exit the session
  5. List the session directory:
    ls -la ~/.claude/projects/<encoded-path>/*.jsonl
  6. Observe 2-3 small files (96-134 bytes) alongside the real session file

Each orphan contains a single line like:

{"type":"ai-title","aiTitle":"<generated title>","sessionId":"<uuid>"}

Root Cause (Observed)

Process monitoring (ps aux) during session creation shows CC 2.1.110 spawns multiple parallel claude --print subprocesses for title generation:

  • 2x claude --print --model haiku --tools --...
  • 1x claude --print --model sonnet --tools --...

These subprocesses appear to create their own .jsonl session files (the orphans) because they do not use the --no-session-persistence flag.

Evidence capture method: filesystem polling script detected new .jsonl files at the same moment ps showed the claude --print title generation processes running. The orphan file UUIDs do not correspond to any interactive session.

Impact

  • Orphan files accumulate over time (we observed 60+ in one project directory over a single evening of work)
  • Orphans appear in --resume session picker, creating confusion
  • Selecting an orphan in the picker fails (no conversation to resume)

Environment

  • CC version: 2.1.110 (native install, macOS arm64)
  • Confirmed NOT present in: 2.1.104
  • macOS 15 (Darwin 24.6.0)
  • CLAUDE_CONFIG_DIR set to a custom path (but issue is path-independent)

Suggested Fix

Add --no-session-persistence to the internal claude --print invocations used for title generation, consistent with how --print mode is used elsewhere (e.g., the --no-session-persistence flag was specifically created for this class of issue).

extent analysis

TL;DR

Adding the --no-session-persistence flag to the internal claude --print invocations for title generation is likely to fix the issue of orphan .jsonl session files.

Guidance

  • Verify that the claude --print subprocesses are indeed creating the orphan files by monitoring the filesystem and process list during session creation.
  • Check the code for the title generation process to confirm that the --no-session-persistence flag is not being passed to the claude --print invocations.
  • Update the code to include the --no-session-persistence flag in the claude --print commands for title generation, consistent with other uses of --print mode.
  • Test the updated code to ensure that the orphan files are no longer created and that the --resume session picker functions correctly.

Example

# Before
claude --print --model haiku --tools ...

# After
claude --print --model haiku --tools --no-session-persistence ...

Notes

The suggested fix assumes that the issue is caused by the missing --no-session-persistence flag in the internal claude --print invocations. If this is not the case, further investigation may be needed to identify the root cause.

Recommendation

Apply the workaround by adding the --no-session-persistence flag to the internal claude --print invocations, as this is a targeted fix that addresses the specific issue of orphan session files.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix 2.1.110: title generation creates orphan session files [4 comments, 3 participants]