Cross-Session Memory for Openclaw

A continuity system that automatically restores context and memory across different AI agent sessions using rolling 24-hour logs and curated long-term storage.

2426758093
v1.0.0
Mar 3, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install cross-session-memory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install cross-session-memory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Cross-Session Memory?

Cross-Session Memory provides a robust framework for maintaining state and context awareness beyond a single interaction. By leveraging a dual-layer approach—daily raw logs and curated long-term records—it ensures that your AI agents never lose track of ongoing projects, user preferences, or recent decision-making history. This skill is critical for developers building complex, multi-day workflows within the Openclaw Skills ecosystem.

The system automatically calculates time ranges to load the most relevant 24-hour rolling memory while offering the flexibility to integrate deep historical data from a dedicated MEMORY.md file. This architecture prevents token waste by separating ephemeral session data from permanent knowledge, allowing for a highly efficient and context-rich user experience.

Cross-Session Memory Use Cases

  • Maintaining continuity in conversations spanning multiple days.
  • Collaborative multi-session project management.
  • Long-term tracking of project milestones and task statuses.
  • Preventing context loss when switching between different agent sessions.

How Cross-Session Memory Works

  1. On session start, the system checks for a primary session flag to determine whether to load long-term memory.
  2. It calculates a 24-hour rolling window from the current timestamp to identify relevant memory files.
  3. The system scans the /memory directory for Markdown files matching the calculated date range (typically today and yesterday).
  4. Curated data from MEMORY.md is integrated for main sessions to provide high-level user preferences and project overviews.
  5. All collected fragments are joined into a unified context block and injected into the agent's current workspace.

Cross-Session Memory Setup

To integrate this into your workflow, update your AGENTS.md file with the following session instructions:

## Every Session
1. Read memory/YYYY-MM-DD.md (today + yesterday) for recent context
2. If in MAIN SESSION: Also read MEMORY.md

For automated loading via PowerShell hooks in your Openclaw Skills configuration:

{
  "hooks": {
    "sessionStart": {
      "enabled": true,
      "script": "skills/cross-session-memory/load-memory.ps1"
    }
  }
}

Cross-Session Memory Data Schema & Taxonomy

The skill organizes data into a hierarchical structure within the workspace:

File/Directory Type Description
MEMORY.md Markdown Curated long-term memory (Preferences, Projects, Decisions)
memory/ Directory Storage for daily granular logs
memory/YYYY-MM-DD.md Markdown Daily session summaries and raw task logs

Daily Memory Content Taxonomy

  • Session Summaries: Timestamped highlights of user interactions.
  • Task Status: Checklists showing completed, pending, or failed operations.
  • Configuration Changes: Records of technical adjustments made to the environment.

Cross-Session Memory Advanced Features

  • Rolling window customization (e.g., loading the last 7 days for deep project tracking).
  • Incremental loading mechanisms to only process content added since the last session.
  • Memory caching via JSON to optimize performance and reduce file I/O.
  • Size-capping logic to keep long-term memory under 50KB for token efficiency.
  • Automated weekly curation prompts to migrate daily logs to the long-term MEMORY.md.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*