SKILL·33EB1A

quarter-clone

ykdojo
Updated 4 days ago
1 views
9,457
747
9,457
View on GitHub
Designgeneral

About

This Claude skill clones only the last quarter of your conversation to reduce token usage while preserving recent work. It's useful when context windows fill up during long development sessions. The skill uses a bash script that finds your conversation history and handles the selective cloning process.

Quick Install

Claude Code

Recommended
Primary
npx skills add ykdojo/claude-code-tips -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/ykdojo/claude-code-tips
Git CloneAlternative
git clone https://github.com/ykdojo/claude-code-tips.git ~/.claude/skills/quarter-clone

Copy and paste this command in Claude Code to install this skill

Documentation

Clone the last quarter of the current conversation, discarding earlier context to reduce token usage while preserving recent work.

Steps:

  1. Get the current session ID and project path: tail -1 ~/.claude/history.jsonl | jq -r '[.sessionId, .project] | @tsv'
  2. 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
    • The same script handles both half and quarter cloning; --quarter selects quarter mode
  3. 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
  4. Run the clone: <script-path> --quarter <session-id> <project-path>
    • Always pass the project path from the history entry, not the current working directory
  5. 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:
    claude --resume <new-session-id>
    
    The script automatically appends a reference to the original conversation at the end of the cloned file. (The new session is also marked [QUARTER-CLONE <timestamp>], e.g. [QUARTER-CLONE Jan 7 14:30], so claude -r and picking it works as a fallback.)

GitHub Repository

ykdojo/claude-code-tips
Path: skills/quarter-clone
0
agenticagentic-aiagentic-codingagentic-workflowaiclaude
FAQ

Frequently asked questions

What is the quarter-clone skill?

quarter-clone is a Claude Skill by ykdojo. Skills package instructions and resources that Claude loads on demand, so Claude can perform quarter-clone-related tasks without extra prompting.

How do I install quarter-clone?

Use the install commands on this page: add quarter-clone to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does quarter-clone belong to?

quarter-clone is in the Design category, tagged general.

Is quarter-clone free to use?

Yes. quarter-clone is listed on AIMCP and free to install.

Related Skills

executing-plans
Design

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

View skill
requesting-code-review
Design

This skill dispatches a code-reviewer subagent to analyze code changes against requirements before proceeding. It should be used after completing tasks, implementing major features, or before merging to main. The review helps catch issues early by comparing the current implementation with the original plan.

View skill
connect-mcp-server
Design

This skill provides a comprehensive guide for developers to connect MCP servers to Claude Code using HTTP, stdio, or SSE transports. It covers installation, configuration, authentication, and security for integrating external services like GitHub, Notion, and custom APIs. Use it when setting up MCP integrations, configuring external tools, or working with Claude's Model Context Protocol.

View skill
web-cli-teleport
Design

This skill helps developers choose between Claude Code Web and CLI interfaces based on task analysis, then enables seamless session teleportation between these environments. It optimizes workflow by managing session state and context when switching between web, CLI, or mobile. Use it for complex projects requiring different tools at various stages.

View skill