quarter-clone — Claude Code skill: what it does, how to install
This skill trims an active conversation down to its final quarter. It cuts token consumption while preserving the latest instructions and files.
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a claude-codeWhat quarter-clone does
The skill reads the active session ID and project folder from ~/.claude/history.jsonl using jq. It searches ~/.claude for the half-clone-conversation.sh script, sorting multiple copies by version if present.
A preview step confirms conversation boundaries before executing the clone with the --quarter argument. The tool writes a new session stamped with the current time, appending a note pointing back to the source file. Without jq and the shell script present in ~/.claude, the execution fails.
It yields a ready claude --resume call with the new session identifier. Picking it via claude -r works too.
What it helps with
- drop older dialogue history to decrease token load
- retain immediate context when starting a fresher session
- trace the new branch back to the original transcript
- obtain a direct resume command without manual session selection
Example prompts for the agent
- Clone the last quarter of this chat into a new session
- Trim earlier history and keep only recent context
- Run quarter-clone to prune this conversation
How to install quarter-clone
1Skills CLI (Vercel)
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a claude-code2Manually: put the files in place
~/.claude/skills/quarter-clone/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/quarter-clone/
1Skills CLI (Vercel)
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a codex2Manually: put the files in place
.agents/skills/quarter-clone/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a cursor2Manually: put the files in place
.cursor/skills/quarter-clone/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ykdojo/claude-code-tips quarter-clone2Manually: put the files in place
.github/skills/quarter-clone/SKILL.md1Skills CLI (Vercel)
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a gemini-cli2Platform CLI
gemini skills install https://github.com/ykdojo/claude-code-tips --path skills/quarter-cloneManually: put the files in place
.devin/skills/quarter-clone/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ykdojo/claude-code-tips --skill quarter-clone -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about quarter-clone
How to install quarter-clone in Claude Code?
Run npx skills add ykdojo/claude-code-tips --skill quarter-clone -a claude-code. Alternatively, place the file at ~/.claude/skills/quarter-clone/SKILL.md.
What does quarter-clone do?
It duplicates the final quarter of the current transcript into a fresh session while discarding earlier messages. The script appends a reference linking back to the initial conversation.
What dependencies does quarter-clone require?
It relies on bash, jq, and the half-clone-conversation.sh script located inside ~/.claude.