继续克劳德的工作
- 作者仓库星标 0
- 作者更新于 2026年8月24日 07:33
- 作者仓库 claude-code-skills
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @daymade · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:提取上下文(单个脚本调用)
运行捆绑的提取脚本。它在一次调用中处理会话发现、紧凑边界解析、噪声过滤和工作区状态:该脚本输出结构化的 Markdown 简报,其中包含:来自`sessions-index.json`的会话元数据紧凑摘要 - Claude 自己从最后一个压缩边界(最高信号上下文)中提取的摘要最后的用户请求 - 最近的明确询问
第 2 步:按会话结束原因进行分支
简报包括会议结束原因。用它来选择正确的继续策略:结束原因·策略干净退出·会话正常完成。读取已解决的最后一个用户请求。继续待处理的工作(如果有)。中断 · 已调度工具调用但从未得到结果(可能是 ctrl-c 或超时)。重试中断的工具调用或评估是否仍然需要它们。
第 3 步:协调并继续
进行更改之前:确认当前目录与会话的项目匹配。如果 git 分支已从会话分支更改,请注意这一点并决定是否切换。检查与待处理工作相关的文件 - 验证旧的声明仍然有效。不要在未经检查的情况下假设旧的声明是有效的。
第四步:报告
简洁地回应: 上下文已恢复:哪个会话、简报中的主要发现 已执行的工作:已更改的文件、运行的命令、测试结果 剩余:待处理的任务(如果有)
# Continue Claude Work
## Overview
Recover actionable context from a prior Claude Code session and continue execution in the current conversation. Use local session files as the source of truth, then continue with concrete edits and checks — not just summarizing.
**Why this exists instead of `claude --resume`**: `claude --resume` replays the full session transcript into the context window. For long sessions this wastes tokens on resolved issues and stale state. This skill **selectively reconstructs** only actionable context — the latest compact summary, pending work, known errors, and current workspace state — giving a fresh start with prior knowledge.
## File Structure Reference
For directory layout, JSONL schemas, and compaction block format, see `references/file_structure.md`.
## Workflow
### Step 1: Extract Context (single script call)
Run the bundled extraction script. It handles session discovery, compact-boundary parsing, noise filtering, and workspace state in one call:
```bash
# Latest session for current project
python3 scripts/extract_resume_context.py
# Specific session by ID
python3 scripts/extract_resume_context.py --session <SESSION_ID>
# Search by topic
python3 scripts/extract_resume_context.py --query "auth feature"
# List recent sessions
python3 scripts/extract_resume_context.py --list
```
The script outputs a structured Markdown **briefing** containing:
- **Session metadata** from `sessions-index.json`
- **Compact summary** — Claude's own distilled summary from the last compaction boundary (highest-signal context)
- **Last user requests** — the most recent explicit asks
- **Last assistant responses** — what was claimed done
- **Errors encountered** — tool failures and error outputs
- **Unresolved tool calls** — indicates interrupted session
- **Subagent workflow state** — which subagents completed, which were interrupted, their last outputs
- **Session end reason** — clean exit, interrupted (ctrl-c), error cascade, or abandoned
- **Files touched** — files created/edited/read during the session
- **MEMORY.md** — persistent cross-session notes
- **Git state** — current status, branch, recent log
The script automatically skips the currently active session (modified < 60s ago) to avoid self-extraction.
### Step 2: Branch by Session End Reason
The briefing includes a **Session end reason**. Use it to choose the right continuation strategy:
| End Reason | Strategy |
|-----------|----------|
| **Clean exit** | Session completed normally. Read the last user request that was addressed. Continue from pending work if any. |
| **Interrupted** | Tool calls were dispatched but never got results (likely ctrl-c or timeout). Retry the interrupted tool calls or assess whether they are still needed. |
| **Error cascade** | Multiple API errors caused the session to fail. Do not retry blindly — diagnose the root cause first. |
| **Abandoned** | User sent a message but got no response. Treat the last user message as the current request. |
If the briefing has a **Subagent Workflow** section with interrupted subagents, check what each was doing and whether to retry or skip.
### Step 3: Reconcile and Continue
Before making changes:
1. Confirm the current directory matches the session's project.
2. If the git branch has changed from the session's branch, note this and decide whether to switch.
3. Inspect files related to pending work — verify old claims still hold.
4. Do not assume old claims are valid without checking.
Then:
- Implement the next concrete step aligned with the latest user request.
- Run deterministic verification (tests, type-checks, build).
- If blocked, state the exact blocker and propose one next action.
### Step 4: Report
Respond concisely:
- **Context recovered**: which session, key findings from the briefing
- **Work executed**: files changed, commands run, test results
- **Remaining**: pending tasks, if any
## How the Script Works
### Compact-Boundary-Aware Extraction
The script finds the **last** compact boundary in the session JSONL and extracts its summary. This is the single highest-signal piece of context in any long session -- Claude's own distilled understanding of the entire conversation up to that point. For details on compaction format and JSONL schemas, see `references/file_structure.md`.
### Size-Adaptive Strategy
| Session size | Strategy |
|-------------|----------|
| Has compactions | Read last compact summary + all post-compact messages |
| < 500 KB, no compactions | Read last 60% of messages |
| 500 KB - 5 MB | Read last 30% of messages |
| > 5 MB | Read last 15% of messages |
### Subagent Context Extraction
When a session has subagent directories (`<session-id>/subagents/`), the script parses each subagent's JSONL to extract agent type, completion status, and last text output. This enables recovery of multi-agent workflows -- e.g., if a 32-subagent evaluation pipeline was interrupted, the briefing shows which agents completed and which need retry.
### Session End Reason Detection
The script classifies how the session ended:
- **completed** -- assistant had the last word (clean exit)
- **interrupted** -- unresolved tool calls (ctrl-c or timeout)
- **error_cascade** -- 3+ API errors
- **abandoned** -- user sent a message with no response
### Noise Filtering
These message types are skipped (37-53% of lines in real sessions):
- `progress`, `queue-operation`, `file-history-snapshot` -- operational noise
- `api_error`, `turn_duration`, `stop_hook_summary` -- system subtypes
- `<task-notification>`, `<system-reminder>` -- filtered from user text extraction
## Guardrails
- Do not run `claude --resume` or `claude --continue` — this skill provides context recovery within the current session.
- Do not treat compact summaries as complete truth — they are lossy. Always verify claims against current workspace.
- Do not overwrite unrelated working-tree changes.
- Do not load the full session file into context — always use the script.
## Limitations
- Cannot recover sessions whose `.jsonl` files have been deleted from `~/.claude/projects/`.
- Cannot access sessions from other machines (files are local only).
- Edit tool operations show deltas, not full file content — use `claude-code-history-files-finder` for full file recovery.
- Compact summaries are lossy — early conversation details may be missing.
- `sessions-index.json` can be stale (entries pointing to deleted files). The script falls back to filesystem-based discovery.
## Example Trigger Phrases
- "continue work from session `abc123-...`"
- "don't resume, just read the .claude files and continue"
- "check what I was working on in the last session and keep going"
- "search my sessions for the PR review work"
章节与文件索引
按说明文件中的顺序排列。
概述
文件结构参考
第 1 步:提取上下文(单个脚本调用)
第 2 步:按会话结束原因进行分支
第 3 步:协调并继续
文件/命令 -> claude --resume · references/file_structure.md · sessions-index.json · <session-id>/subagents/ · progress · queue-operation · file-history-snapshot · api_error
内容校验值 -> 2fa932579c44
当前原文的自动摘译,尚未人工审校。
概述
从先前的 Claude Code 会话中恢复可操作的上下文,并在当前会话中继续执行。使用本地会话文件作为事实来源,然后继续进行具体的编辑和检查——而不仅仅是总结。为什么存在这个而不是
claude --resume:claude --resume将完整的会话记录重播到上下文窗口中。对于长时间的会话,这会在已解决的问题和过时的状态上浪费令牌。该技能有选择地仅重建可操作的上下文 - 最新的紧凑摘要、待处理的工作、已知错误和当前工作区状态 - 从而利用先验知识重新开始。文件结构参考
有关目录布局、JSONL 模式和压缩块格式,请参阅
references/file_structure.md。