← 返回
未分类 中文

Pre-Compact Resume Card

Generates an operational resume card before Claude context compaction — so the next session knows exactly where it left off, what mode it was in, and what to...
在 Claude 上下文压缩前生成操作恢复卡,以便下一次会话准确知道上次停止的位置、当时的工作模式以及接下来需要做什么。
nadalpiantini nadalpiantini 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 367
下载
💾 0
安装
1
版本
#latest

概述

Pre-Compact Resume Card

Claude forgets when context compacts. This skill installs a PreCompact hook that captures real operational state before compaction fires — branch, commit, last user intent, last assistant action, detected mode, and next step. The next session loads it automatically via SessionStart.

What It Does

Before every context compaction, the hook:

  1. Backs up the transcript to thinking/session-logs/ (keeps last 30)
  2. Parses the JSONL transcript to extract the last user intent and assistant action
  3. Detects the current work mode (coding / debugging / deploy / ideation / git workflow)
  4. Writes .claude/session-resume-card.md with all of this

At session start, the card is injected into context automatically — no manual copy-paste needed.

Install

npx clawhub@latest install @openclaw/pre-compact-resume-card

Or manually: copy scripts/pre-compact.sh and scripts/session-start.sh into your project's .claude/scripts/, then register the hooks in .claude/settings.json using references/settings-example.json as template.

Hook Registration

{
  "hooks": {
    "PreCompact": [{ "matcher": "", "hooks": [{ "type": "command", "command": "bash .claude/scripts/pre-compact.sh" }] }],
    "SessionStart": [{ "matcher": "", "hooks": [{ "type": "command", "command": "bash .claude/scripts/session-start.sh" }] }]
  }
}

The Insight

Written rules get forgotten. Mechanical hooks don't. This skill is the difference between Claude starting fresh (useless) and Claude starting exactly where you left off (valuable). The resume card costs ~200 tokens per session start — cheap insurance against rebuilding context from scratch.

Files

  • scripts/pre-compact.sh — fires before compaction: backup + parse transcript + write resume card
  • scripts/session-start.sh — inject the resume card at session start
  • references/settings-example.json — hook registration template

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 11:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 859 📥 339,730
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,153 📥 925,198
dev-programming

Config Sync — 16 AI Tools, 1 Source

nadalpiantini
从单一来源同步AI编程助手配置文件,生成CLAUDE.md、AGENTS.md、GEMINI.md、.cursor/rules/、.github/copilot-instructions.md等配置文件。
★ 0 📥 451