2.1.110: title generation creates orphan session files

Status Fixed / completed
Reported on v2.1.110
Maintainer reply None cached
Activity 5 comments · opened Apr 16, 2026 · closed Apr 16, 2026

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
``

  1. 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).

View original on GitHub ↗

5 Comments

github-actions[bot] · 6 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/47089

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

BrentEubanks · 6 months ago

This is not a duplicate. This is a distinct issue with somewhat similar symptoms.
Also the issue described in #47089 is not observed in v2.1.104.

BrentEubanks · 6 months ago

Closing this — further investigation revealed this was a misattribution of the root cause. I originally identified claude --print title generation subprocesses as the orphan creators, but those subprocesses (which I attributed to CC's internal title generation) were actually my own tooling (PAI hooks calling Inference.ts).

The real bug is upstream: --no-session-persistence is broken in 2.1.112 (worked in 2.1.104). Any claude --print --no-session-persistence invocation creates an orphan .jsonl file regardless of flag presence.

Filed a more accurate report at #49565 with a minimal one-line repro.

junaidtitan · 6 months ago

Good root cause analysis — the parallel claude --print subprocesses for title generation creating their own session files makes sense. 60+ orphans in one evening is a real mess for the --resume picker.

Until this is fixed upstream, cozempic doctor can help identify and manage these orphans. The stale-backups check finds small/empty session files, and cozempic list shows all sessions with their sizes so you can quickly spot the 96-134 byte orphans:

pip install cozempic
cozempic doctor          # runs 8 diagnostic checks including stale file detection
cozempic list            # shows all sessions with sizes — orphans are obvious

This is a workaround, not a fix — the real solution is the --no-session-persistence flag on title generation subprocesses as you suggested. But it helps clean up the accumulation in the meantime.

https://github.com/Ruya-AI/cozempic

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.