[BUG] Worktree isolation spams duplicate custom-title entries, causing title 'sticking' across sessions
Resolved 💬 2 comments Opened May 25, 2026 by Woukim Closed May 29, 2026
Summary
When using isolation: "worktree" with the Agent tool, Claude Code writes duplicate custom-title entries to the session JSONL file on every action. This causes:
- Session file bloat (100+ duplicate entries)
- Title "sticking" — the same title appears for multiple unrelated sessions in
/resumepicker
Environment
- Claude Code version: 2.1.143
- OS: Windows 10 Pro
- Shell: Git Bash
Steps to Reproduce
- Start a new session
- Use Agent tool with
isolation: "worktree" - Let the agent perform multiple actions
- Check the session JSONL file for
custom-titleentries
Expected Behavior
custom-titleshould be written once (or deduplicated)- Each session should have its own unique title based on content
Actual Behavior
custom-titlewith(Branch)suffix is written on every action (up to 117 times in one session)- The title "sticks" and appears for multiple different sessions in
/resumepicker - New sessions inherit the previous worktree session's title
Evidence
# Count duplicate custom-title entries per session
for f in ~/.claude/projects/PROJECT/*.jsonl; do
count=$(grep -c '"custom-title"' "$f" 2>/dev/null)
if [ "$count" -gt 5 ]; then
echo "$count duplicates in $(basename $f)"
fi
done
# Output:
# 117 duplicates in 09b4aeea-....jsonl
# 44 duplicates in c53abaa8-....jsonl
# 42 duplicates in 77e2bf9f-....jsonl
# ... (10+ files affected)
Screenshot
Multiple sessions showing the same title in /resume picker:
> попробуй найди агентом репозиторий... (Branch)
10 minutes ago · master · 1.2MB
попробуй найди агентом репозиторий... (Branch)
55 minutes ago · master · 261.2KB
попробуй найди агентом репозиторий... (Branch)
3 hours ago · master · 1.4MB
Workaround
Manually clean duplicate custom-title entries:
# Keep only last custom-title entry in each file
for f in ~/.claude/projects/PROJECT/*.jsonl; do
last=$(grep '"custom-title"' "$f" | tail -1)
grep -v '"custom-title"' "$f" > "$f.tmp"
[ -n "$last" ] && echo "$last" >> "$f.tmp"
mv "$f.tmp" "$f"
done
Related Issues
- #32150 - Session titles revert to last-prompt text
- #53338 - Session auto-titler reverts manual rename
- #36379 - AI-generated titles override custom-title entries
Suggested Fix
- Deduplicate
custom-titlewrites — check if title already exists before writing - Don't propagate worktree session title to parent/sibling sessions
- Clear title cache when starting a new session
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗