Session Persistence 会话上下文持久化 — 技能工具
v1.0.0解决OpenClaw会话重启后上下文丢失的问题,包含3种互补方案:强化记忆恢复机制、外部会话存储、定期摘要压缩,实现零额外API调用的上下文持久化。
0· 229·0 当前·0 累计
安全扫描
OpenClaw
可疑
medium confidenceThe skill appears to implement local, file-based session persistence (no network or secrets), but there are coherence problems (missing patch file and unclear automatic integration) and it will write persistent files into your workspace, so review before installing.
评估建议
This skill is coherent with local session persistence and does not attempt external communication, but there are some issues to resolve before installing: 1) The package references an AGENTS.md.patch that is not included — ask the author for the patch or inspect what AGENTS.md changes are needed before applying them. 2) The SKILL.md promises automatic triggering but provides no install hook; decide how the script will be invoked (agent hooks, wrapper, or cron) and test that integration in a safe...详细分析 ▾
✓ 用途与能力
The name/description (local session persistence) matches the contents: a small shell script that reads/appends/archives session summaries to ./memory/, and SKILL.md describes placing the skill in the workspace. No unrelated credentials, network calls, or binaries are requested.
⚠ 指令范围
SKILL.md claims fully automatic behavior and asks you to modify AGENTS.md using an 'AGENTS.md.patch', but that patch file is not present in the package and there is no install/hook mechanism described to make the script run automatically. The script will create and write files under ./memory/, which may store sensitive conversation contents; SKILL.md gives the agent permission (implicitly) to modify agent config (AGENTS.md) but provides no safe integration steps.
✓ 安装机制
Instruction-only with a small shell script; no install spec or remote downloads. This is low-risk from an installation-code provenance perspective.
✓ 凭证需求
No environment variables, credentials, or external endpoints are requested. The only resources used are local file paths under the working directory, which is proportionate to local session persistence.
ℹ 持久化与权限
The skill persists conversation summaries to disk under ./memory/, and asks you to patch AGENTS.md to integrate it — this grants it ongoing presence in your workspace and the agent's configuration, but 'always' is false and it doesn't request elevated system privileges. Still, modifying AGENTS.md can change agent behavior and should be reviewed.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.0.02026/3/17
Initial release: 解决OpenClaw会话重启上下文丢失问题,包含3种互补方案,零额外API调用
● 无害
安装命令 点击复制
官方npx clawhub@latest install session-persistence
镜像加速npx clawhub@latest install session-persistence --registry https://cn.clawhub-mirror.com
技能文档
解决OpenClaw会话重启后忘记之前对话内容的核心痛点,零额外API调用,自动实现上下文持久化。
核心功能
- 自动记忆恢复:每次新会话启动时自动读取上一个会话的摘要,恢复上下文
- 自动会话存档:每次回复时自动追加有价值的信息到会话摘要,无需手动操作
- 定期摘要压缩:对话超过10轮或手动触发时自动压缩会话要点,避免冗余
- 多层记忆架构:配合AGENTS.md的五层记忆架构,实现95%+的检索命中率
部署方式
- 将本技能目录放入你的OpenClaw工作区的skills目录下
- 按照AGENTS.md中的会话启动规则修改你的AGENTS.md文件(已包含在本技能中)
- 首次使用时创建
memory/sessions/目录用于存储会话摘要
文件说明
SKILL.md:本说明文档session-manager.sh:会话管理脚本,自动处理摘要的读写和压缩AGENTS.md.patch:需要添加到你的AGENTS.md中的规则补丁
使用方法
无需手动操作,所有功能自动触发:- 会话启动时自动读取上一个会话的摘要
- 对话过程中自动记录有价值的信息
- 会话结束时自动归档到当日记忆文件
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制