Session Persistence 会话上下文持久化
v1.0.0解决OpenClaw会话重启后上下文丢失的问题,包含3种互补方案:强化记忆恢复机制、外部会话存储、定期摘要压缩,实现零额外API调用的上下文持久化。
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
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.
Instruction Scope
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.
Install Mechanism
Instruction-only with a small shell script; no install spec or remote downloads. This is low-risk from an installation-code provenance perspective.
Credentials
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.
Persistence & Privilege
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.
What to consider 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 environment. 3) The session-manager.sh will create ./memory/ and store conversation summaries in plain text — treat these files as sensitive, restrict filesystem permissions, or add encryption if needed. 4) Review the script (it is small) and test append/read/archive behavior on a sample project to ensure it doesn't overwrite files you care about. If you cannot obtain the missing AGENTS.md.patch or a clear integration plan from the author, avoid installing or limit use to an isolated workspace.Like a lobster shell, security has layers — review code before you run it.
latest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Session Persistence 会话上下文持久化
解决OpenClaw会话重启后忘记之前对话内容的核心痛点,零额外API调用,自动实现上下文持久化。
核心功能
- 自动记忆恢复:每次新会话启动时自动读取上一个会话的摘要,恢复上下文
- 自动会话存档:每次回复时自动追加有价值的信息到会话摘要,无需手动操作
- 定期摘要压缩:对话超过10轮或手动触发时自动压缩会话要点,避免冗余
- 多层记忆架构:配合AGENTS.md的五层记忆架构,实现95%+的检索命中率
部署方式
- 将本技能目录放入你的OpenClaw工作区的skills目录下
- 按照AGENTS.md中的会话启动规则修改你的AGENTS.md文件(已包含在本技能中)
- 首次使用时创建
memory/sessions/目录用于存储会话摘要
文件说明
SKILL.md:本说明文档session-manager.sh:会话管理脚本,自动处理摘要的读写和压缩AGENTS.md.patch:需要添加到你的AGENTS.md中的规则补丁
使用方法
无需手动操作,所有功能自动触发:
- 会话启动时自动读取上一个会话的摘要
- 对话过程中自动记录有价值的信息
- 会话结束时自动归档到当日记忆文件
Files
2 totalSelect a file
Select a file to preview.
Comments
Loading comments…
