← 返回
未分类 中文

Save/Load Context

Save and load OpenClaw conversation context with /save and /load slash commands
使用 /save 和 /load 斜杠命令保存和加载 OpenClaw 对话上下文。
jkyotnfjfbjnknh
未分类 clawhub v1.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 411
下载
💾 0
安装
1
版本
#latest

概述

Save/Load Context Plugin

An OpenClaw plugin that adds /save and /load slash commands for persisting and restoring conversation context across sessions.

Problem

OpenClaw conversations are ephemeral — when you start a new session or reset, all context is lost. This plugin lets you save any conversation to disk and reload it later, preserving full context continuity.

Commands

CommandDescription
----------------------
/save [label]Save the current conversation context with an optional label. If no label is provided, the save is named "unnamed".
/loadList all previously saved conversation contexts with their labels, message counts, and save dates.
/load Load a saved context by label or index number. This replaces the current session transcript with the saved conversation. After loading, the agent receives a system event with the save file path so it can restore full context.
/load --delete Permanently delete a saved context file.

How It Works

Saving

  1. When /save is invoked, the plugin reads the session transcript (JSONL format)
  2. It identifies the conversation boundary — messages since the last /new, /reset, or /load
  3. Only user and assistant messages are extracted (tool calls and results are excluded)
  4. The messages are written to ~/.openclaw/saves/_
  5. An index file (index.json) is updated for fast listing

Loading

  1. /load finds the save file by label or index
  2. The saved messages are written as a new session transcript
  3. A system event is injected via enqueueSystemEvent() containing the save file path and message count
  4. The agent receives this event and can use the read tool to load the full context from the save file

Save File Format

{
  "version": 1,
  "label": "project-discussion",
  "savedAt": "2026-03-30T15:38:00+08:00",
  "messageCount": 42,
  "sourceSession": "telegram:2074807638",
  "messages": [
    { "role": "user", "content": "..." },
    { "role": "assistant", "content": "..." }
  ]
}

Installation

Via OpenClaw Plugin Manager

openclaw plugins install save-load

Manual Installation

  1. Copy the plugin directory to ~/.openclaw/extensions/save-load/
  2. Ensure openclaw.plugin.json and package.json are present
  3. Add "save-load" to the plugins.enabled array in ~/.openclaw/openclaw.json
  4. Restart the OpenClaw gateway: openclaw gateway restart

Storage

Save files are stored in ~/.openclaw/saves/. There is no limit on the number or size of saves — only disk space applies.

Requirements

  • OpenClaw 2026.3.30 or later
  • Node.js (included with OpenClaw)

Source Code

https://github.com/jkyotnfjfbjnknh/openclaw-save-load

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-05-03 10:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,219 📥 266,852
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,045
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 799,916