Memory Maintenance for Openclaw

An intelligent memory management tool that reviews daily notes and automates file cleanup for OpenClaw agents.

maxlauriehutchinson
v1.0.0
Feb 6, 2026
6
3.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install memory-maintenance

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 memory-maintenance 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 Memory Maintenance?

Memory Maintenance is an essential utility designed to solve the common problem of memory bloat in autonomous AI agents. As agents accumulate daily notes and session logs, context windows become saturated with irrelevant history, and critical decisions often get buried. This skill, as part of the ecosystem of Openclaw Skills, automates the entire lifecycle of an agent's memory. It proactively reviews daily session notes to suggest permanent updates to the MEMORY.md file, ensuring that the agent's core identity and long-term knowledge remain accurate and accessible.

By implementing this skill, developers can ensure their agents wake up with a refined context rather than a pile of unorganized files. It serves as an automated janitor for your agent's directory, maintaining health and fragmentation standards while keeping safety at the forefront with human-in-the-loop approvals for all significant content changes. Utilizing Openclaw Skills like this one ensures your agent improves over time rather than degrading due to information overload.

Memory Maintenance Use Cases

  • Reducing context window usage by archiving sessions older than seven days.
  • Consolidating scattered insights from daily session notes into a centralized MEMORY.md file.
  • Automating directory cleanup to prevent the accumulation of error logs and temporary files.
  • Implementing a structured retention policy for agentic memory logs using Openclaw Skills.
  • Maintaining high-performance agent workflows by preventing directory fragmentation.

How Memory Maintenance Works

  1. Daily Review: The system scans the configurable lookback period and analyzes the health of the memory directory at a scheduled time (default 23:00).
  2. Suggestion Generation: A Review Agent processes session notes and generates structured suggestions for MEMORY.md updates using an LLM.
  3. Human Review: The user accesses a generated Markdown report to approve, modify, or reject the proposed content updates.
  4. Apply Changes: Validated updates are merged into the core memory file while maintenance tasks like archiving are executed via CLI commands.
  5. Auto-Cleanup: After a successful review, the skill automatically archives old reviews and enforces the defined retention policy, moving deleted files to a recoverable trash folder.

Memory Maintenance Setup

To install this skill and integrate it into your agent's workflow, use the following commands. Ensure you have the required dependencies for these Openclaw Skills installed on your system:

# Install the skill via Clawhub
clawhub install memory-maintenance

# Install system dependencies
brew install gemini-cli jq

You must also ensure your GEMINI_API_KEY is exported in your environment or set in your .env file to enable the intelligent analysis features.

Memory Maintenance Data Schema & Taxonomy

The skill organizes its output and maintenance files within the agent's memory directory to ensure clear metadata taxonomy:

Path Description
agents/memory/review-v2-YYYY-MM-DD.json Structured JSON data containing LLM-generated suggestions.
agents/memory/review-v2-YYYY-MM-DD.md Human-readable Markdown report for manual approval.
agents/memory/stats.json Aggregate statistics regarding memory growth and health.
agents/memory/archive/YYYY-MM/ Monthly bucketed storage for archived session notes.
agents/memory/.trash/ Hidden directory for recoverable deletions within the retention period.

Memory Maintenance Advanced Features

  • Granular Retention Policies: Customize how long logs are kept and when they are archived via config/settings.json.
  • Trash Recovery System: Deleted files are moved to a hidden recovery directory rather than being permanently destroyed, allowing for safety-first operations.
  • Safe-Only Execution: Use the --safe flag to automate archiving and directory health tasks while leaving content changes for manual review.
  • Dry Run Capability: Preview all filesystem operations and renames before they occur to ensure high reliability in complex Openclaw Skills implementations.
  • Multi-Section Integration: Automatically suggests updates across specific MEMORY.md sections including Infrastructure, Contacts, and Active Projects.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*