quarter-clone

Clones the last quarter of a Claude Code conversation to reduce token usage.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long Claude Code sessions accumulate large conversation histories that consume excessive context tokens, slowing responses and risking context limits. This Skill trims the conversation to its most recent quarter while preserving the latest work.

Core Features & Use Cases

  • Context Reduction: Discards the oldest three-quarters of the current conversation, keeping only the most recent quarter.
  • Session Continuity: Generates a new session ID and provides the exact claude --resume command to continue working immediately.
  • Traceability: Appends a reference to the original conversation and marks the new session with a [QUARTER-CLONE <timestamp>] label for easy identification.
  • Use Case: After hours of iterative debugging in a single session, the context window is nearly full. Run this Skill to keep only the recent debugging context and resume in a fresh, lighter session.

Quick Start

Ask Claude to quarter-clone the current conversation to reduce context usage and continue in a new session.

Frequently Asked Questions about quarter-clone

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

FAQPage Schema
How do I reduce context usage in a long Claude Code session?

Use quarter-clone to discard the oldest three-quarters of the conversation and keep only the most recent quarter. The script creates a new session and prints a claude --resume command so you can continue working with a much smaller context.

How do I clone part of a Claude Code conversation?

Run the half-clone-conversation.sh script with the --quarter flag, passing the session ID and project path from ~/.claude/history.jsonl. The same script also supports half cloning when the flag is omitted.

Does quarter-clone work with plugin-installed and manually installed scripts?

Yes. The Skill searches ~/.claude for half-clone-conversation.sh using find, so it locates the script whether installed via plugin or manual symlink. Version sort selects the latest version when multiple copies exist.

What happens to the original conversation after quarter cloning?

The original conversation is left untouched. The cloned session automatically appends a reference to the original conversation and is labeled [QUARTER-CLONE <timestamp>], so you can still find it via claude -r as a fallback.

Why should I preview the session before running quarter-clone?

Previewing with --preview verifies that the session ID matches the current conversation by checking the first and last messages. This prevents accidentally cloning the wrong session when multiple sessions exist in the history.