half-clone
Reduces token usage by discarding the start of a conversation and cloning only the most recent context.
Install
mkdir -p .claude/skills/half-clone && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4198" && unzip -o skill.zip -d .claude/skills/half-clone && rm skill.zipInstalls to .claude/skills/half-clone
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Clone the later half of the current conversation, discarding earlier context to reduce token usage while preserving recent work.Key capabilities
- →Identifies session history paths
- →Runs automated conversation cloning scripts
- →Previews session history before execution
- →Generates [HALF-CLONE] references for traceability
How it works
Executes a shell script that reads the history log, truncates the message history based on metadata, and initializes a new instance with the recent segment.
Inputs & outputs
When to use half-clone
- →Reducing context window size for better performance
- →Starting a fresh session from a long-running chat
- →Managing large development session history
About this skill
Clone the later half of the current conversation, discarding earlier context to reduce token usage while preserving recent work.
Steps:
- Get the current session ID and project path:
tail -1 ~/.claude/history.jsonl | jq -r '[.sessionId, .project] | @tsv' - Find half-clone-conversation.sh with bash:
find ~/.claude -name "half-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
- Preview the conversation to verify the session ID:
<script-path> --preview <session-id> <project-path>- Check that the first and last messages match the current conversation
- Run the clone:
<script-path> <session-id> <project-path>- Always pass the project path from the history entry, not the current working directory
- The script prints the new session ID (the
New session: <id>line). Give the user the exact command to resume it directly, no picker needed:
The script automatically appends a reference to the original conversation at the end of the cloned file. (The new session is also markedclaude --resume <new-session-id>[HALF-CLONE <timestamp>], e.g.[HALF-CLONE Jan 7 14:30], soclaude -rand picking it works as a fallback.)
When not to use it
- →When full historical context is required for future auditing
- →When the current session is small and doesn't impact performance
Prerequisites
Limitations
- →Discards context from the first half of the conversation
- →Depends on the presence of local history files
How it compares
Instead of manual copy-pasting, it preserves metadata and session state for the agent while cleaning up the context window.
Compared to similar skills
half-clone side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| half-clone (this skill) | 1 | 6mo | No flags | Beginner |
| pptx | 393 | 6mo | Review | Advanced |
| nano-pdf | 63 | 2mo | Review | Beginner |
| video-downloader | 101 | 7mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ykdojo
View all by ykdojo →You might also like
pptx
anthropics
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
nano-pdf
openclaw
Edit PDFs with natural-language instructions using the nano-pdf CLI.
video-downloader
ComposioHQ
Downloads videos from YouTube and other platforms for offline viewing, editing, or archival. Handles various formats and quality options.
youtube-transcript
michalparkola
Download YouTube video transcripts when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.
using-superpowers
obra
Use when starting any conversation - establishes mandatory workflows for finding and using skills, including using Skill tool before announcing usage, following brainstorming before coding, and creating TodoWrite todos for checklists
browser-automation
browserbase
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Triggers include "browse", "navigate to", "go to website", "extract data from webpage", "screenshot", "web scraping", "fill out form", "click on", "search for on the web". When taking actions be as specific as possible.