clone

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Clone the current conversation so the user can branch off and try a different approach.
Steps:
  1. Get the current session ID and project path:
    tail -1 ~/.claude/history.jsonl | jq -r '[.sessionId, .project] | @tsv'
  2. Find clone-conversation.sh with bash:
    find ~/.claude -name "clone-conversation.sh" 2>/dev/null | sort -V | tail -1
    • This finds the script whether installed via plugin or manual symlink
    • Uses version sort to prefer the latest version if multiple exist
  3. Run:
    <script-path> <session-id> <project-path>
    • Always pass the project path from the history entry, not the current working directory
  4. Tell the user they can access the cloned conversation with
    claude -r
    and look for the one marked
    [CLONED <timestamp>]
    (e.g.,
    [CLONED Jan 7 14:30]
    )
克隆当前对话,以便用户可以分支尝试不同的方案。
步骤:
  1. 获取当前会话ID和项目路径:
    tail -1 ~/.claude/history.jsonl | jq -r '[.sessionId, .project] | @tsv'
  2. 使用bash查找clone-conversation.sh:
    find ~/.claude -name "clone-conversation.sh" 2>/dev/null | sort -V | tail -1
    • 无论该脚本是通过插件安装还是手动软链接创建的,都可以被找到
    • 如果存在多个版本,会通过版本排序优先选择最新版本
  3. 运行:
    <script-path> <session-id> <project-path>
    • 始终传入历史记录条目中的项目路径,而非当前工作目录
  4. 告知用户可以通过
    claude -r
    访问克隆后的对话,寻找标记为
    [CLONED <timestamp>]
    的条目即可(例如:
    [CLONED Jan 7 14:30]