session-history
搜索并浏览所有会话中过去的对话历史记录。当回忆以前的工作、查找旧的讨论、恢复删除的线程或当用户引用以前的对话中不在内存文件中的内容时使用。当要求“记住”之前讨论过的内容、查找“关于 X 的对话”或继续过去会话的工作时也可使用。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~amor71-session-historycURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~amor71-session-history/file -o amor71-session-history.md## 概述(中文)
搜索并浏览所有会话中过去的对话历史记录。当回忆以前的工作、查找旧的讨论、恢复删除的线程或当用户引用以前的对话中不在内存文件中的内容时使用。当要求“记住”之前讨论过的内容、查找“关于 X 的对话”或继续过去会话的工作时也可使用。
## 原文
# Session History
Search through past OpenClaw session transcripts (JSONL files in `~/.openclaw/agents/*/sessions/`).
## Quick Reference
```bash
# Search for conversations about a topic
python3 scripts/search_sessions.py "gclid pipeline error"
# List recent sessions
python3 scripts/search_sessions.py --list --days 3
# Search specific agent's history
python3 scripts/search_sessions.py "flight monitor" --agent main
# Wider time range
python3 scripts/search_sessions.py "quantum encryption" --days 30 --max-results 5
```
## Workflow
1. Run `search_sessions.py` with the user's query terms to find relevant sessions
2. Use `sessions_history` tool with the `sessionKey` to pull full context from a match
3. If `sessions_history` doesn't work (old/closed sessions), read the JSONL file directly with `read`
4. Summarize what was found — don't dump raw transcripts
## When to Use
- User says "remember when we discussed X?" or "we talked about Y last week"
- Resuming a thread that isn't captured in memory files
- Finding a decision, code snippet, or error from a past session
- Cross-referencing what was said vs what's in MEMORY.md
## Tips
- Also check `memory_search` first — it indexes session transcripts too
- Combine both: `memory_search` for semantic matching, `search_sessions.py` for keyword/exact matching
- The script searches user AND assistant messages
- JSONL path format: `~/.openclaw/agents/{agent_id}/sessions/{session_uuid}.jsonl`