half-clone

Clone the later half of a Claude Code conversation to reduce token usage.

9.6k|760|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/ykdojo/claude-code-tips --skill half-clone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: half-clone
Source: https://github.com/ykdojo/claude-code-tips/tree/main/skills/half-clone
Command: npx skills add https://github.com/ykdojo/claude-code-tips --skill half-clone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables you to prune historical context in Claude Code conversations by cloning the later portion of the current session, helping to reduce token usage while preserving recent work.

Core Features & Use Cases

  • Selective history pruning: Keep the most recent messages while discarding earlier context.
  • Session portability: Applies to ongoing Claude Code sessions and project work across restarts.
  • Use Case: When working on a long-running task, run half-clone to shrink history and keep the latest progress accessible.

Quick Start

Find the latest half-clone-conversation.sh script, preview the session to verify IDs, and run the clone using the session id and project path from your Claude history. After the operation, access the half-clone result via claude -r and look for the label [HALF-CLONE <timestamp>].

Frequently Asked Questions about half-clone

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token usage in Claude Code by trimming conversation history?

You can reduce token usage in Claude Code by cloning the later half of your current conversation, which discards earlier context while preserving recent work and progress.

What is the best way to prune a long Claude Code session without losing recent progress?

The best way to prune a Claude Code session is selective history trimming. By keeping only the most recent messages and discarding earlier context, you shrink history while ensuring recent progress remains accessible for ongoing project work.

How do I execute a half-clone on a Claude Code session?

To execute a half-clone, locate the latest half-clone-conversation.sh script, preview the session to verify IDs, and run the clone using the session ID and project path extracted from your Claude history.

How do I access the results after cloning a conversation history?

After cloning conversation history, access the half-clone result via the claude -r command. Look for the label labeled [HALF-CLONE <timestamp>] to resume your trimmed Claude Code session.

Does selective history trimming work for ongoing Claude Code sessions across restarts?

Yes, selective history trimming works for ongoing Claude Code sessions across restarts. It provides session portability by applying the half-clone to shrink history while keeping the latest progress accessible for project work.