← Back to Skills Marketplace
acilgit

Good Memory

by acilgit · GitHub ↗ · v2.0.1 · MIT-0
cross-platform ⚠ suspicious
242
Downloads
0
Stars
1
Active Installs
9
Versions
Install in OpenClaw
/install good-memory
Description
Session 历史记录恢复技能。Session重置后自动恢复对话上下文,解决系统自动重置导致的"失忆"问题。
README (SKILL.md)

Good-Memory v2.0.0

帮助 Agent 在 session 重置后快速恢复对话上下文。通过检测 .reset. 后缀的 session 文件实现,安装后自动运行,无需手动操作

核心特性

  • 全平台支持:支持飞书、Discord、Telegram、Signal等所有OpenClaw平台
  • 零配置:安装后自动生效,不需要修改配置
  • 轻量高效:仅基于文件名匹配,不需要解析文件内容,速度快
  • 低侵入性:默认只修改main的AGENTS.md,不影响其他Agent
  • 自动清理:历史记录最多保留10条,自动清理过期文件

工作原理

  1. 重置检测:每次session启动时自动检测两种重置类型:
    • 显式重置:session 文件被系统添加 .reset. 后缀(系统自动重置 /new /reset 命令触发)
    • 隐式切换:新 session UUID 生成但旧 session 未打 reset 标记(系统自动会话轮换/后台重启触发)
  2. 历史恢复:如果检测到重置/切换,自动读取上一个会话文件的最后50条对话
  3. 自动提示:首条回复会告知用户已恢复历史记录

安装

🚀 一键安装(推荐)

# 下载并安装
curl -sSL https://wry-manatee-359.convex.site/api/v1/download?slug=good-memory | bash -s install

手动安装

# 1. 创建目录
mkdir -p ~/.openclaw/workspace/skills/good-memory
cd ~/.openclaw/workspace/skills/good-memory

# 2. 下载解压
curl -L https://wry-manatee-359.convex.site/api/v1/download?slug=good-memory | unzip -

# 3. 执行安装
bash scripts/install.sh

环境变量(可选)

如果你的OpenClaw安装在非默认路径,可以设置:

export OPENCLAW_BASE="/path/to/your/openclaw"  # 默认:/root/.openclaw
export SESSIONS_DIR="/path/to/sessions"        # 默认:$OPENCLAW_BASE/agents/main/sessions
export AGENTS_MD="/path/to/AGENTS.md"          # 默认:$OPENCLAW_BASE/workspace/AGENTS.md

手动使用

# 查看最新的reset文件
bash ~/.openclaw/workspace/skills/good-memory/scripts/recovery.sh latest

# 读取最新reset的50条记录
bash ~/.openclaw/workspace/skills/good-memory/scripts/recovery.sh read --lines 50

# 列出所有reset文件
bash ~/.openclaw/workspace/skills/good-memory/scripts/recovery.sh list

数据结构

session-tracker.json 格式(简化版):

{
  "description": "Session tracker - maps agent+chat to session files",
  "last_updated": "2026-03-27T15:00:00Z",
  "agents": {
    "main": {
      "ou_123456": {
        "session_key": "",
        "active": "/path/to/current.jsonl",
        "active_uuid": "abc123",
        "last_history": "/path/to/old.jsonl.reset.2026-03-27T15:00:00Z",
        "history": [
          "/path/to/old.jsonl.reset.2026-03-27T15:00:00Z",
          "/path/to/older.jsonl.reset.2026-03-26T10:00:00Z"
        ]
      }
    }
  }
}
Usage Guidance
This skill is doing what it claims (reading session JSONL to rebuild conversation context), but it also makes persistent, system-wide changes and the recommended one-line install downloads code from an unfamiliar host. Before installing: 1) Do NOT run the curl | bash one-liner unless you trust the download host. 2) Inspect the included scripts yourself (they are present in the bundle) and confirm they match what you expect. 3) Back up AGENTS.md and your workspace before running the installer — the installer injects commands into AGENTS.md. 4) Prefer installing from a trusted release (official GitHub release or your org's artifact repository) rather than the convex.site URL. 5) Consider running the skill in a test/non-production environment first to observe behavior and logs (autorecover.log, session-tracker.json). 6) If you are uncomfortable with system-wide modification, ask the author to provide a non-intrusive deployment mode (manual opt-in per agent, documentation of exactly what is written to AGENTS.md and tracker) or a version that only reads files without injecting startup hooks. Finally, note the code has at least one bug (undefined current_uuid) — ask the maintainer for a fixed release before trusting it in production.
Capability Analysis
Type: OpenClaw Skill Name: good-memory Version: 2.0.1 The 'good-memory' skill is designed to restore conversation history in OpenClaw after session resets. It functions by monitoring session JSONL files in the OpenClaw directory, maintaining a local 'session-tracker.json', and injecting a recovery command into the 'AGENTS.md' file to ensure the 'autorecover.py' script runs at the start of new sessions. While the installation process uses a 'curl | bash' pattern and the skill requires broad access to chat logs to function, the code logic is transparent and strictly aligned with its stated purpose of context restoration. No evidence of data exfiltration, unauthorized network activity, or malicious prompt injection was found.
Capability Assessment
Purpose & Capability
The stated purpose (detect session resets and restore prior JSONL-based conversation history) matches what the scripts do: scanning sessions, reading sessions.json and session JSONL files, and outputting prior messages. However the skill also injects commands into a global AGENTS.md and writes a persistent session-tracker.json — behavior that is more intrusive than the minimal read-only recoverer the description implies, though it can be justified as integration work.
Instruction Scope
Runtime instructions and scripts read session files and sessions.json, update and write a workspace session-tracker.json, and inject an automatic startup command into AGENTS.md. The autorecover script prints recovered history to stdout so the platform will add it to the conversation context (expected for this purpose) but that implies broad read access to historic transcripts. The code also hardcodes /root/.openclaw paths and will operate system-wide (not sandboxed). There is also a coding bug: autorecover.py references current_uuid in an implicit-switch check though that variable is never defined, indicating sloppy implementation which could lead to unexpected behavior.
Install Mechanism
Although the package includes local install scripts, the documentation and top-level install.sh instruct users to download a zip via curl from https://wry-manatee-359.convex.site and pipe it to bash/unzip. That domain is not a standard well-known release host (not GitHub releases or an obvious project domain). Download-and-execute from an external host is high-risk and disproportionate for a relatively small utility.
Credentials
The skill does not request credentials (no env secrets), which is good, but it accesses and modifies sensitive local configuration and data: reads all sessions JSONL (potentially containing private message content), writes session-tracker.json into workspace, and injects entries into AGENTS.md. Those actions are functionally related to the stated purpose but are elevated privileges relative to a simple helper — they should be clearly authorized by the administrator before install.
Persistence & Privilege
The installer and scripts create persistent artifacts (session-tracker.json, autorecover.log) and modify AGENTS.md to cause automatic execution on session startup. The skill is not marked always:true, but it does establish long-lived behavior and modifies system-wide agent configuration. This persistence and configuration modification are significant and should be explicitly approved.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install good-memory
  3. After installation, invoke the skill by name or use /good-memory
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.0.1
Good Memory v2.0.1 – Automatic Session Context Recovery - Improved documentation with updated installation steps, usage examples, and troubleshooting. - Refined description and metadata for clarity and better platform compatibility. - Maintenance scripts and recovery logic reorganized for efficiency and easier management. - Removed the redundant README.md; now consolidated into primary docs. - Ensured compatibility with all OpenClaw platforms and streamlined session cleanup policy.
v2.0.0
v2.0.0: 重大架构调整,完全去掉中间文件机制,Agent直接读tracker JSON + session JSONL
v1.3.0
**Summary: Context recovery logic is now handled by the Agent, with `detect` only updating tracker state.** - Changed behavior: `maintenance.sh detect` now only updates the tracker and no longer writes intermediate context files. - Agents are now responsible for parsing `session-tracker.json`, reading the previous session file, and restoring relevant context. - Updated documentation to reflect these changes, including instructions on how Agents should extract and use last session history. - Added new commands (`update`, `verify`) to the maintenance script for more flexible tracker management. - Changelog and install instructions updated for clarity on the new workflow.
v1.2.3
Bug修复:修复 install.sh 中 tracker 的 agent 名称获取逻辑,从 deliveryContext.accountId 获取实际路由 Agent 而不是用目录名
v1.2.2
修复安装脚本:1) 正确从 sessions.json 读取所有 Agent 的所有活跃 Session 并录入 tracker;2) 之前只打印信息不写入 tracker
v1.2.1
修复默认值不统一问题(改为20条);修复安装路径问题;更新SKILL.md文档
v1.2.0
Good-Memory 1.2.0 introduces auto-integration and a clearer workflow for session reset detection and recovery. - Added install.sh script for automatic agent command injection; run this after installing the skill. - New workflow: always call detect at session startup to handle reset detection and tracker update automatically. - Updated SKILL.md with installation, usage, and integration instructions for easier adoption. - read 命令默认读取 100 条历史记录(上版为 50)。 - Various script and documentation improvements to simplify process and reduce user error.
v1.1.0
- Major refactor: skill fully rebuilt to use tracker & file birth time to detect and restore reset sessions. - Session recovery now relies on disk file naming conventions—no content scanning required. - Introduced tracker file for precise mapping of agent+chat to current & history session files. - All scripts and docs now focus exclusively on session restore (multi-agent task management removed). - Deprecated agent+chat task management functionality. - Simplified recovery commands: `latest`, `read`, `list` use session file structure; added `maintenance.sh`.
v1.0.0
不会再失忆的龙虾
Metadata
Slug good-memory
Version 2.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 9
Frequently Asked Questions

What is Good Memory?

Session 历史记录恢复技能。Session重置后自动恢复对话上下文,解决系统自动重置导致的"失忆"问题。 It is an AI Agent Skill for Claude Code / OpenClaw, with 242 downloads so far.

How do I install Good Memory?

Run "/install good-memory" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Good Memory free?

Yes, Good Memory is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Good Memory support?

Good Memory is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Good Memory?

It is built and maintained by acilgit (@acilgit); the current version is v2.0.1.

💬 Comments