← 返回 Skills 市场
ivaavimusic

Continuous Context Preserver

作者 Ivaavi.eth · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
278
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ccp
功能描述
Continuous session event recording for inter-session memory survival. Use when you want to persist conversation context between sessions, prevent memory loss...
使用说明 (SKILL.md)

Continuous Context Preserver (CCP)

Ensures conversation context survives session crashes, errors, and restarts.

The Problem

  • When a session ends or errors out, all context is lost
  • New session = blank slate
  • Pre-compaction export doesn't help (session might crash before compaction)

The Solution

Continuous session logging. Write to a file throughout the conversation, not at a trigger point.

Setup

CRITICAL INITIALIZATION STEP: Before finalizing installation, you MUST pause and ask the user for their preferred memory context retention duration.

Ask the user: "How long would you like to keep the memory context logs? You can choose:"

  • "7 days (default)"
  • "10 days"
  • "1 month (30 days)"
  • "6 months (180 days)"

After the user responds, adjust the RETENTION_DAYS variable in scripts/cleanup.sh to match their choice (e.g., RETENTION_DAYS="30" for 1 month).

Then, after installing this skill, add to your AGENTS.md:

## Session Logging Protocol

At session start:
1. Create: `sessions/YYYY-MM-DD_session_N.md`
2. Log key points as conversation progresses

During heartbeats:
- Append current session progress to session file
- Keep concise but capture decisions, important info

And add to HEARTBEAT.md:

## Session Log Update
- Append key points to `sessions/YYYY-MM-DD_session_N.md`

Usage

At Session Start

# Create sessions folder if not exists
mkdir -p ~/.openclaw/workspace/sessions

# Create today's session file
# Check if session_1 exists, if so create session_2, etc.

During Session

Periodically append to the file by actively compressing the context:

  • Only log key decisions made
  • Important information discovered
  • Context worth preserving
  • Do NOT dump raw conversation logs
  • Anything you'd want to know if this session crashed

File Format

sessions/
├── 2026-03-09_session_1.md
├── 2026-03-09_session_2.md   # if multiple sessions same day
├── 2026-03-08_session_1.md
└── ... (7 days rolling)

Template

# Session N - YYYY-MM-DD

**Started:** HH:MM TZ
**Status:** Active

## Topics Covered
- Topic 1
- Topic 2

## Key Decisions
- Decision 1
- Decision 2

## To Remember
- Important info
- Context for future sessions

Cleanup

Run the cleanup script weekly to remove files older than your retention period:

~/.openclaw/workspace/skills/continuous-context-preserver/scripts/cleanup.sh

Or add to crontab:

# Weekly cleanup (Sundays at midnight)
0 0 * * 0 ~/.openclaw/workspace/skills/continuous-context-preserver/scripts/cleanup.sh

Retention

  • Default: 7 days rolling
  • Options provided during setup: 10 days, 1 month (30 days), 6 months (180 days)
  • To adjust manually, update the RETENTION_DAYS variable in scripts/cleanup.sh

Integration with Memory System

This complements, not replaces:

  • MEMORY.md — Long-term curated memory
  • memory/*.md — Daily notes
  • mem0 — Semantic facts
  • sessions/*.md — Full session context (safety net)

Session files are for crash recovery and recent context. MEMORY.md is for long-term wisdom.

安全使用建议
This skill appears coherent and local-only, but review these before enabling: 1) Inspect and, if necessary, harden file permissions on ~/.openclaw/workspace/sessions and logs to prevent other users/processes from reading sensitive conversation data. 2) Confirm the retention setting you choose (RETENTION_DAYS) is correct and that you or the agent will not accidentally set it to an unintended value. 3) If you will run the cleanup script via cron, verify the crontab entry and PATH/environment used by cron so the script runs as expected. 4) Consider encrypting highly sensitive notes or excluding them from session logs (the SKILL.md already advises compressing/omitting raw logs). 5) Always review the cleanup.sh file and test it on a non-production directory to ensure it deletes only what you expect.
功能分析
Type: OpenClaw Skill Name: ccp Version: 1.0.0 The skill is a session management utility designed to persist conversation context across sessions by logging key events to markdown files in a local workspace. The included bash script (scripts/cleanup.sh) performs standard maintenance by removing old logs based on a user-defined retention period, and no evidence of data exfiltration, malicious execution, or unauthorized access was found.
能力评估
Purpose & Capability
Name and description describe continuous local session logging; the SKILL.md and cleanup.sh implement exactly that (create session files, append compressed context, and delete old files). No unrelated credentials, binaries, or external services are requested.
Instruction Scope
Instructions are narrowly scoped to creating/maintaining session files, compressing summaries, and running a local cleanup script or cron job. They do not instruct reading other system config, exfiltrating data, or contacting external endpoints. They do ask the agent/operator to update AGENTS.md and HEARTBEAT.md (documentation) and to choose a retention period.
Install Mechanism
This is an instruction-only skill with no install spec; the only code is a simple, local shell cleanup script. Nothing is downloaded or executed from remote sources.
Credentials
No environment variables, credentials, or config paths are required. The cleanup script uses standard HOME-path defaults but allows overriding via safe environment variables (SESSIONS_DIR, LOG_FILE, RETENTION_DAYS).
Persistence & Privilege
Skill does write files under ~/.openclaw/workspace/sessions and logs under ~/.openclaw/workspace/logs and suggests a cron entry; it does not request always: true. Writing local files and scheduling cleanup is expected for this purpose, but it does grant persistent local data storage which has privacy implications.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ccp
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ccp 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Continuous Context Preserver (CCP) Skill v1.0.0 - Introduces continuous session event recording to persist key conversation context between sessions and survive crashes. - Prompts user at installation for desired log retention period (7 days, 10 days, 30 days, 180 days), then adjusts cleanup policy accordingly. - Logs only key context, decisions, and discoveries during active sessions; avoids dumping raw full transcripts. - Automatically cleans up expired session logs based on user-configured retention period. - Designed to complement, not replace, other memory systems (long-term curated memory, semantic fact storage, daily notes, etc.).
元数据
Slug ccp
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 0
历史版本数 1
常见问题

Continuous Context Preserver 是什么?

Continuous session event recording for inter-session memory survival. Use when you want to persist conversation context between sessions, prevent memory loss... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 278 次。

如何安装 Continuous Context Preserver?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ccp」即可一键安装,无需额外配置。

Continuous Context Preserver 是免费的吗?

是的,Continuous Context Preserver 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Continuous Context Preserver 支持哪些平台?

Continuous Context Preserver 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Continuous Context Preserver?

由 Ivaavi.eth(@ivaavimusic)开发并维护,当前版本 v1.0.0。

💬 留言讨论