home / skills / ykdojo / claude-code-tips / clone
This skill clones the current conversation to let you branch off and test alternative approaches without losing context.
npx playbooks add skill ykdojo/claude-code-tips --skill cloneReview the files below or copy the command above to add this skill to your agents.
---
name: clone
description: Clone the current conversation so the user can branch off and try a different approach.
---
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]`)
This skill clones the current Claude conversation so you can branch off and try a different approach without losing the original thread. It uses your local Claude history to locate the session and a helper script to create a timestamped cloned conversation you can reopen with the CLI. The result is a separate session labeled with a [CLONED <timestamp>] tag for easy discovery.
The skill reads the latest history entry to extract the session ID and project path, then finds the helper script clone-conversation.sh in your Claude configuration directory. It runs the script with the session ID and the recorded project path (not your current working directory). The script creates a cloned conversation and timestamps it; you reopen clones using claude -r and look for the [CLONED <timestamp>] marker.
How do I get the session ID and project path?
Run tail -1 ~/.claude/history.jsonl | jq -r '[.sessionId, .project] | @tsv' to extract the latest session ID and project path.
How do I find the clone-conversation.sh script?
Use find ~/.claude -name "clone-conversation.sh" 2>/dev/null | sort -V | tail -1 to locate the most recent script installation.
How do I open the cloned conversation?
Run claude -r and look for the conversation labeled [CLONED <timestamp>] to reopen the cloned session.