Skip to content

Fix: preserve [CLONED]/[HALF-CLONE] tag in cloned session title#26

Open
Yan-Cheng-Hsu wants to merge 1 commit intoykdojo:mainfrom
Yan-Cheng-Hsu:fix/preserve-cloned-title
Open

Fix: preserve [CLONED]/[HALF-CLONE] tag in cloned session title#26
Yan-Cheng-Hsu wants to merge 1 commit intoykdojo:mainfrom
Yan-Cheng-Hsu:fix/preserve-cloned-title

Conversation

@Yan-Cheng-Hsu
Copy link
Copy Markdown

Summary

Cloned conversations created via /clone and /half-clone were inheriting the source session's auto-generated kebab-case title (e.g. career-reset-strategy) instead of showing the [CLONED ...] / [HALF-CLONE ...] tag in claude -r, terminal tabs, and the TUI title bar.

Root cause

Claude Code 2.1.x persists session titles as custom-title / agent-name records embedded in the jsonl. The clone scripts copy these records (with rewritten sessionId) but do not modify the title string itself — Claude Code reads the last matching record when resuming, so cloned sessions show the source's name.

Fix

After writing the cloned/half-cloned jsonl, append a fresh custom-title and agent-name record with the clone tag prepended (e.g. [CLONED Apr 27 14:11] career-reset-strategy). Because Claude Code reads the last occurrence, this overrides the inherited records.

Files

  • scripts/clone-conversation.sh — append override records after file write
  • scripts/half-clone-conversation.sh — same fix, parallel logic
  • .claude-plugin/plugin.json / .claude-plugin/marketplace.json — bump 0.14.12 → 0.14.13

Test plan

  • Run /clone in an active session; verify new jsonl ends with custom-title + agent-name records containing the [CLONED ...] prefix
  • Resume the cloned session via claude -r; verify session title shows [CLONED ...] prefix
  • Confirm ~/.claude/sessions/<new-pid>.json has name field with [CLONED ...] prefix
  • Repeat with /half-clone

🤖 Generated with Claude Code

Claude Code 2.1.x stores session titles in jsonl as type:custom-title
and type:agent-name records. clone-conversation.sh copies these
unchanged, so cloned sessions inherit the source's auto-generated name
(e.g. "career-reset-strategy") instead of "[CLONED ...] career-reset-
strategy" in claude -r, terminal tabs, and the TUI title bar.

Append a fresh custom-title + agent-name record with the clone tag
prepended after each clone — Claude Code reads the last occurrence,
so this overrides. Same fix applied to half-clone-conversation.sh.

Bumps plugin to 0.14.13.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant