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 on session crashes, or maintain a rolling archive of session history. The AI agent acts as a live compressor, intelligently appending only key context, decisions, and discoveries throughout conversations, and cleans up old files based on the user's selected retention duration.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "continuous-context-preserver" with this command: npx skills add ivaavimusic/ccp

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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Context Brief

Persistent context survival for OpenClaw. Writes file-based anchors to memory/anchors/ to preserve critical context across sessions. Reads MEMORY.md and dail...

Registry SourceRecently Updated
2790Profile unavailable
General

🧠 Tiered Recall - 分层回忆系统

分层回忆系统,解决上下文长度限制,保持项目延续性。默认自动加载最近7天记忆,支持手动全量回忆、自定义天数、项目回忆和主题回忆。当前版本采用 slim index,只保留文件名、行号和标题,不存摘要,避免 token 膨胀。

Registry SourceRecently Updated
1950Profile unavailable
General

Context Handoff

保存和恢复聊天上下文到本地文件。用于用户想在切换账号、清空 session、重新开会话、跨会话延续项目时,把当前会话级上下文或项目级摘要落盘并在之后恢复。也用于列出已有的会话上下文槽位或项目摘要,并按更新时间排序返回最近使用项。触发词包括:保存当前上下文、保存会话摘要、保存项目摘要、记下这次讨论、切号前保存、恢复...

Registry SourceRecently Updated
1760Profile unavailable
General

Context Compression

Prevent context overflow with automatic session truncation and memory preservation.

Registry SourceRecently Updated
1.8K4Profile unavailable