首页龙虾技能列表 › Session回溯 — 技能工具

Session回溯 — 技能工具

v1.0.0

基于 OpenClaw 会话历史提取关键信息、查询关键词上下文,管理和回溯对话内容以辅助记忆和跟进。

0· 280·0 当前·0 累计
by @noir-hedgehog (Noir)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/5
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
medium confidence
The skill's instructions match its stated purpose (reading session history and saving summaries), but it directs the agent to read and write local session files which is privacy-sensitive and should be used only with trusted agents and environments.
评估建议
This skill is internally consistent with its stated goal, but it instructs the agent to read and persist local conversation history, which can contain sensitive information. Before installing or using it: (1) Confirm you trust the agent and environment where it will run; (2) Verify that the sessions_list / sessions_history / read / write tools are safe and limited to the intended agent scope; (3) Remove or replace hard-coded example agentId/sessionId lines to avoid accidentally targeting another...
详细分析 ▾
用途与能力
Name/description match the actions the SKILL.md describes: extracting key info from session history, searching keywords, and saving summaries to memory/*.md. The described use of sessions_list, sessions_history, read and write tools is coherent with this purpose.
指令范围
The runtime instructions explicitly instruct reading JSONL session files under ~/.openclaw/agents/<agentId>/sessions/ and writing memory/YYYY-MM-DD.md. This is expected for a session-recall skill, but it grants access to potentially sensitive conversation history and instructs the agent to surface or persist that content. The SKILL.md also contains hard-coded example agentId/sessionId values (lin_xiaoman, a UUID) which could reflect another user's data or be confusing; the skill gives direct file paths and commands that, if executed, will access local user data.
安装机制
No install spec and no code files: instruction-only skill. Nothing is downloaded or written to disk by an installer, which minimizes supply-chain risk.
凭证需求
No environment variables, credentials, or config paths are declared beyond the local session file paths the skill needs to operate. The requested access (reading/writing session and memory files) is proportionate to the described functionality.
持久化与权限
always is false and the skill is user-invocable. It does not request persistent or privileged platform-level presence. Its behavior (reading/writing local files) is limited to the agent's file area and memory files described in the instructions.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/5

Session-recall skill initial release. - Enables extraction of key information from OpenClaw session history and saves it to dated memory files. - Provides tools and methods to search for keywords and context within sessions. - Supports recalling and adding segments from previous sessions to the current conversation. - Specifies session and memory file structures and file locations. - Includes usage examples and important notes for typical workflows.

● 无害

安装命令 点击复制

官方npx clawhub@latest install session-recall
镜像加速npx clawhub@latest install session-recall --registry https://cn.clawhub-mirror.com

技能文档

概述

Session 回溯技能,用于从 OpenClaw 的会话历史中提取信息、管理记忆和回溯对话。

功能

1. 提取关键信息写入 memory/YYYY-MM-DD.md

将 session 中的关键信息提取并保存到记忆文件中。

使用方式:

  • 调用 write 工具将内容写入 memory/YYYY-MM-DD.md 文件
  • 日期格式:当天日期,如 memory/2026-03-05.md

提取内容建议:

  • 对话中的重要决策
  • 关键信息点
  • 待办事项
  • 学习到的关于主人的信息

示例:

# 2026-03-05 记忆

重要信息

  • 主人想要了解如何回溯 session
  • 主人让我发布了一个飞书文档技能到 ClawHub

待办

  • [ ] 创建 session 回溯 skill

对话摘要

今天主人问了关于 session 的问题...

2. 查询关键词在 session 中的出现次数/上下文

工具:

  • 使用 sessions_list 工具列出所有 session
  • 使用 sessions_history 工具获取特定 session 的历史
  • 使用 read 工具直接读取 JSONL 文件

方法:

方法一:使用 sessions_list

# 列出最近所有 session
sessions_list

方法二:使用 sessions_history

# 获取特定 session 的历史
sessions_history --sessionKey "agent:lin_xiaoman:feishu:direct:ou_xxx"

方法三:直接读取 JSONL 文件

# 读取 session 文件
# 路径格式:~/.openclaw/agents//sessions/.jsonl

# 示例:查找关键词 "外卖" # 使用 read 工具读取文件,然后分析内容

查找关键词的上下文:

  • 使用 sessions_list 获取所有 session 的基本信息
  • 根据 sessionKey 确定目标 session
  • 使用 sessions_history 获取完整历史
  • 在内容中搜索关键词并记录上下文

3. 回溯某段 session 并添加到当前对话

方式一:使用 sessions_history 工具

  • 找到目标 session 的 sessionKey
  • 使用 sessions_history 获取历史
  • 将需要回溯的内容通过对话方式告诉模型

方式二:直接读取 JSONL 文件

  • 确定 sessionId(可以从 sessions.json 或 sessions_list 获取)
  • 读取 JSONL 文件:
   ~/.openclaw/agents/lin_xiaoman/sessions/.jsonl
   
  • 提取需要的对话片段
  • 将内容告诉用户或添加到当前上下文

重要提示:

  • 当前 session 的 sessionKey 格式:agent:lin_xiaoman:feishu:direct:ou_2545d3b430b99a135bdab87d5a09b68a
  • 当前 session 的 sessionId:3fefc0bb-b7e9-4736-b374-d1be9d12caec
  • JSONL 文件路径:~/.openclaw/agents/lin_xiaoman/sessions/3fefc0bb-b7e9-4736-b374-d1be9d12caec.jsonl

Session 文件位置

  • 索引文件:~/.openclaw/agents//sessions/sessions.json
  • 对话记录:~/.openclaw/agents//sessions/.jsonl
  • 被 reset 的记录:~/.openclaw/agents//sessions/.jsonl.reset.<时间戳>
  • 被删除的记录:~/.openclaw/agents//sessions/.jsonl.deleted.<时间戳>

使用示例

示例 1:查找今天关于"外卖"的对话

  • 列出所有 session:
   sessions_list
   
  • 获取当前飞书会话的历史:
   sessions_history --sessionKey "agent:lin_xiaoman:feishu:direct:ou_2545d3b430b99a135bdab87d5a09b68a"
   
  • 分析内容,找到关于"外卖"的对话

示例 2:保存今天的重要对话到记忆

将今天的对话摘要写入 memory/2026-03-05.md

示例 3:回溯之前的某个 session

  • 列出所有 session:sessions_list
  • 找到目标 session 的 sessionKey
  • 使用 sessions_history 获取历史
  • 将需要的片段告诉用户

注意事项

  • 使用完 sessions_history 后,需要在回复中告诉用户找到的内容
  • JSONL 文件可以直接用 read 工具读取
  • 被 reset 的 session 文件后缀包含 .reset.
  • 被删除的 session 文件后缀包含 .deleted.
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务