跳到正文
Skillpedia
其他10k · #11903

quarter-clone

它能做什么

这个技能把你当前对话的最后四分之一复制成一个新会话,丢弃较早的上下文。适合对话很长、只需保留最新工作的人。

适用场景

  • ✓当你的对话非常长,而目前只有最新的工作重要的时候。
  • ✓当你想要比半克隆更短的对话副本的时候。
  • ✓当你需要一个更短的会话,以使每条新消息使用更少词元的时候。

技能链接

https://github.com/ykdojo/claude-code-tips/blob/main/skills/quarter-clone/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ykdojo/claude-code-tips/blob/main/skills/quarter-clone/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为这段对话做一个四分之一克隆,以便我在更少的上下文下继续工作。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能会找到当前会话,预览副本以确认消息是否匹配,然后运行脚本从最后四分之一的内容创建新会话。之后它会给你一条命令来打开该会话。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.)
常见问题

它与半克隆有什么不同?

它只保留对话的最后四分之一,因此副本比半克隆更短。

我会丢失最新的消息吗?

不会。副本保留的是对话中最近的部分。

如何打开新会话?

该技能会给你一条包含新会话 ID 的命令,便于你直接恢复该会话。

详情

作者的原始描述

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

repo: ykdojo/claude-code-tips

热度

GitHub 星标
10k
排名
#11903
许可证
—
更新时间
2026/9/25

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能