2.1.110: title generation creates orphan session files
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
- Install CC 2.1.110 (native)
cdinto any project directory- Run
claudeand send any message - Exit the session
- List the session directory:
````
ls -la ~/.claude/projects/<encoded-path>/*.jsonl
- 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
--resumesession 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_DIRset 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).
5 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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.
Closing this — further investigation revealed this was a misattribution of the root cause. I originally identified
claude --printtitle 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 callingInference.ts).The real bug is upstream:
--no-session-persistenceis broken in 2.1.112 (worked in 2.1.104). Anyclaude --print --no-session-persistenceinvocation creates an orphan.jsonlfile regardless of flag presence.Filed a more accurate report at #49565 with a minimal one-line repro.
Good root cause analysis — the parallel
claude --printsubprocesses for title generation creating their own session files makes sense. 60+ orphans in one evening is a real mess for the--resumepicker.Until this is fixed upstream,
cozempic doctorcan help identify and manage these orphans. Thestale-backupscheck finds small/empty session files, andcozempic listshows all sessions with their sizes so you can quickly spot the 96-134 byte orphans:This is a workaround, not a fix — the real solution is the
--no-session-persistenceflag on title generation subprocesses as you suggested. But it helps clean up the accumulation in the meantime.https://github.com/Ruya-AI/cozempic
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.