← 返回
AI智能 中文

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...
持续记录会话事件,确保跨会话记忆存活。用于在会话之间保持对话上下文,防止记忆丢失。
ivaavimusic
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 549
下载
💾 18
安装
1
版本
#ccp#context#continuous context preserver#latest#memory#preserve session context#preserve session memory#session context#sos

概述

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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 21:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 834 📥 212,990
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 711 📥 243,706
developer-tools

x402 Singularity Layer

ivaavimusic
x402-layer helps agents pay for APIs with USDC, deploy monetized endpoints, manage credits/webhooks/marketplace listings
★ 4 📥 3,344