Context Cleanup for Openclaw

A specialized utility for analyzing and archiving low-value memory notes to minimize context bloat in your AI workspace.

irideas
v0.3.0
Mar 6, 2026
0
1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install context-cleanup

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 context-cleanup 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 Context Cleanup?

Context Cleanup is a vital tool within the Openclaw Skills ecosystem designed to maintain the peak efficiency of AI agent workspaces. As agents operate, they naturally accumulate memory logs that can lead to significant context bloat, which negatively impacts responsiveness and increases token consumption. This skill provides a systematic framework to identify redundant or low-value information and transition it into an archive, ensuring the agent's active context remains focused and relevant.

Built with a safety-first philosophy, Context Cleanup prioritizes archiving over permanent deletion, preserving historical data while keeping the workspace lean. By integrating this into your Openclaw Skills collection, you can ensure your AI environment stays organized, cost-effective, and highly performant over the lifecycle of complex projects.

Context Cleanup Use Cases

  • Reducing token usage by clearing redundant memory logs from the active processing window.
  • Maintaining workspace hygiene during high-intensity AI development or long-term research.
  • Improving AI agent response times by minimizing the volume of low-value data to parse.
  • Safely archiving project milestones or historical logs before starting new development phases.

How Context Cleanup Works

  1. The workflow starts with an analysis phase where the script scans the Openclaw Skills workspace to evaluate current memory usage.
  2. A plan is generated to identify specific low-value candidates for archiving based on the references/policy.md guidelines.
  3. The user reviews the cleanup plan to verify that only unnecessary context is being targeted.
  4. Once confirmed, the skill executes the archive command, moving files to long-term storage while protecting core files like MEMORY.md and agent specs.

Context Cleanup Setup

To begin using this skill within your environment, ensure you have a bash-compatible shell. Follow these steps to set up and run the cleanup process:

# Navigate to your workspace and analyze the current status
./skills/context-cleanup/cleanup.sh analyze

# Generate a plan to see what will be archived
./skills/context-cleanup/cleanup.sh plan

# Execute the archive process
./skills/context-cleanup/cleanup.sh archive

Context Cleanup Data Schema & Taxonomy

The skill manages data based on a defined policy while strictly protecting critical configuration files within the Openclaw Skills structure.

Component Type Description
cleanup.sh Shell Script The primary execution logic for the cleanup workflow.
policy.md Reference Defines the logic and criteria for what constitutes low-value data.
MEMORY.md Protected File The primary memory file; never touched by the cleanup process.
specs/ Protected Dir Technical specifications; explicitly excluded from archival.
AGENTS.md Protected File Agent definitions and configurations; always preserved.

Context Cleanup Advanced Features

  • Time-based archival allowing users to specify a cutoff date for old records.
  • Dry-run mode for safe previews without making any actual file system changes.
  • Non-interactive mode using the --yes flag for integration into automated maintenance scripts.
  • JSON output support for analyze and plan commands to facilitate machine-readable integration within other Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins bash
Github Stars: 0
forks: 0

Featured*