session-recover
短期记忆恢复技能。用于快速回顾当前 session 或上一个 session 的完整内容。适用于:想知道"这次 session 聊了什么"、session 被意外重置后需要恢复上下文、或想提取对话精华。
Best use case
session-recover is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
短期记忆恢复技能。用于快速回顾当前 session 或上一个 session 的完整内容。适用于:想知道"这次 session 聊了什么"、session 被意外重置后需要恢复上下文、或想提取对话精华。
Teams using session-recover should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/session-recover/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How session-recover Compares
| Feature / Agent | session-recover | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
短期记忆恢复技能。用于快速回顾当前 session 或上一个 session 的完整内容。适用于:想知道"这次 session 聊了什么"、session 被意外重置后需要恢复上下文、或想提取对话精华。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Session Recover — 短期记忆恢复
## 何时使用
- 想知道"这次 session 聊了什么"
- session 被意外重置,想恢复丢失的上下文
- 想把当前 session 的要点整理成摘要
- 任何人想知道任意一个 session 的完整对话记录
## 核心思想
通过 `sessions_list` + JSONL 文件解析,还原 session 的完整对话内容。无需任何 hook 或预置机制。
## 触发指令
发送 `/recover`
## 执行步骤
### Step 1:确定目标 session
**场景 A — 恢复当前 session(从文件恢复)**
当前 session 的历史不完整,但 JSONL 存档文件通常还在:
```bash
# 找到当前 session 对应的存档文件
AGENT_DIR="$HOME/.openclaw/agents/{当前agent名}/sessions"
ls -lt "$AGENT_DIR" | grep "$(session_status | grep 'sessionId' | awk '{print $2}')"
```
**场景 B — 恢复被重置的上一个 session**
上一个 session 被重置后会变成 `.reset.*` 存档文件:
```bash
# 列出最近的 reset 存档
ls -lt "$HOME/.openclaw/agents/main/sessions/"*.reset.* | head -5
```
**场景 C — 查找特定 channel 的 session**
```javascript
sessions_list({
kinds: ["group"], // group | main | private
limit: 10,
messageLimit: 0 // 不需要摘要,只要 session key
})
```
从返回找到目标 channel 的 session key 和 sessionId。
### Step 2:解析 JSONL 文件
```bash
# 解析最近 N 条消息
python3 skills/session-recover/references/parse_session.py \
/path/to/session.jsonl \
--tail 20
# 关键词搜索(用于找特定内容)
python3 skills/session-recover/references/parse_session.py \
/path/to/session.jsonl \
--keyword "待完成" \
--context 3
```
JSONL 文件结构(跳过头部 metadata 行,只处理 `type=message` 的行):
- 消息内容在 `message.content[].text`
- thinking 内容在 `message.content[].thinking`
- 每条消息有 `timestamp`
### Step 3:综合摘要
从解析结果中提取:
1. **摘要** — 本次 session 的主题(一句话)
2. **要点** — 关键结论、决策、技术细节
3. **未完成** — 任何未解决的事项或后续步骤
4. **下一步** — 最近一条 user message 或明确的 next step
## 输出格式
```markdown
## Session 回忆报告
**来源**:{session key 或文件路径}
**时间**:YYYY-MM-DD HH:mm
### 一句话摘要
[本次 session 核心主题]
### 对话要点
- [要点1]
- [要点2]
- [要点3]
### 未完成事项
- [ ] [事项1]
- [ ] [事项2]
### 关键上下文
[技术细节、配置值、代码片段等]
---
原始素材:{文件路径或 session key}
```
## 常用命令速查
| 需求 | 命令 |
|------|------|
| 最近 10 条 | `parse_session.py {file} --tail 10` |
| 搜关键词+3行上下文 | `parse_session.py {file} --keyword "关键词" --context 3` |
| 找所有 reset 存档 | `ls -lt agents/main/sessions/*.reset.* \| head -10` |
## 参考文件
- `references/parse_session.py` — JSONL 解析器,支持 `--tail N`、`--keyword`、`--context`Related Skills
IT Disaster Recovery Plan Generator
Build production-ready disaster recovery plans that actually get followed when things break.
Debt Collection & Recovery Playbook
Generate compliant debt recovery strategies, collection letter sequences, and payment plan frameworks.
unified-session
Unify all chat channels into one shared AI session for seamless cross-device continuity. Start a conversation on your laptop, continue from your phone — same context, same memory, zero loss. Use this skill whenever: - User wants multiple messaging channels (DingTalk, Feishu/Lark, Telegram, Discord, WhatsApp, Signal, Slack, webchat) to share one conversation - User mentions "shared session", "cross-device", "multi-channel", "unified session", "continue conversation", "seamless", "context lost", "memory lost", "上下文丢失", "记忆丢失", "多端共享" - User says their bot "forgets" what was said when they switch from one app to another - User asks how to make Telegram/Discord/DingTalk/Feishu/WhatsApp share context with webchat - User wants to switch between desktop and mobile without losing conversation history - User mentions dmScope, session routing, channel isolation, or session merging - User describes wanting to pick up where they left off on a different device or chat app - User complains about having separate conversations on each channel when they only have one agent - Even if the user doesn't use technical terms — if they describe the pain of "switching apps and the AI doesn't remember", this is the skill to use
session-guardian
Never lose a conversation again. Auto-backup, smart recovery, and health monitoring for OpenClaw sessions. Protects against gateway crashes, model disconnections, and token overflow. Use this skill when: - User worries about losing conversations after gateway restart or model crash - User mentions session backup, conversation recovery, session protection, or data loss - User's agent is slow or timing out (likely token overflow from large sessions) - User runs multiple agents and needs to track collaboration across sessions - User asks about session health, backup strategy, or disaster recovery - User mentions "对话丢失", "会话备份", "上下文溢出", "token超限", "Gateway重启后记忆丢失" - Even if user just says "my agent lost everything after a restart" — this is the skill
session-rotate-80
Auto-create a new session when OpenClaw context usage reaches 80% without requiring Mem0 or file memory systems. Use when users want default OpenClaw to proactively rotate sessions and avoid context overflow in long chats.
session-health-monitor
Context window health monitoring for OpenClaw agents — threshold warnings via Telegram, pre-compaction snapshots, and memory rotation.
urlsession-code-review
Reviews URLSession networking code for iOS/macOS. Covers async/await patterns, request building, error handling, caching, and background sessions.
session-history
Search and browse past conversation history across all sessions. Use when recalling prior work, finding old discussions, resuming dropped threads, or when the user references something from a previous conversation that isn't in memory files. Also use when asked to "remember" something discussed before, find "that conversation about X", or continue work from a past session.
browser-session-curator
Turn an overwhelming set of tabs, bookmarks, and snippets into a structured session digest with tasks, reading queue, and archive plan.
authorized-session-scrape
Continue searching and extracting within a user-authorized local browser session after the user logs in. Use for pagination, site search, tab-by-tab extraction, and post-login discovery without bypassing access controls.
codex-session-patcher
Clean AI refusal responses from Codex CLI, Claude Code, and OpenCode session files, and inject CTF/pentest prompts to reduce refusals.
---
name: article-factory-wechat