Janitor for Openclaw

Janitor is an intelligent maintenance skill for Openclaw Skills that automates cache cleanup, optimizes memory, and prevents context overflow.

sarthib7
v1.0.3
Feb 8, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install janitor

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 janitor 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 Janitor?

Janitor serves as the essential maintenance crew for your AI agents, ensuring peak performance by managing cache files, optimizing RAM usage, and monitoring real-time token consumption. As a specialized utility for Openclaw Skills, it provides automated session pruning and emergency recovery protocols when context usage hits critical thresholds. This tool is vital for developers using Openclaw Skills who need to maintain long-running agentic workflows without hitting resource limits or accumulating digital clutter.

By integrating Janitor into your workflow, you can automate the deletion of source maps, temporary logs, and macOS metadata files that often bloat agent environments. The skill is designed to be lightweight with no external dependencies, making it a fast and reliable addition to any project utilizing Openclaw Skills for automation and task management.

Janitor Use Cases

  • Preventing context overflow in long-running AI sessions by monitoring token usage.
  • Automated clearing of node module caches and temporary build artifacts.
  • Real-time memory optimization for self-hosted Openclaw Skills agents.
  • Archiving and pruning old sessions to maintain a clean database of agent interactions.
  • Post-push cleanup routines to remove local temporary files after GitHub deployments.

How Janitor Works

  1. Initialize the Janitor instance within your agent script or via the command line.
  2. Scan the working directory for defined cache patterns and files exceeding the age threshold.
  3. Monitor memory RSS and heap usage to identify potential leaks or high resource consumption.
  4. Execute the cleanup method to delete non-essential files while protecting critical assets like source code and git history.
  5. Generate a detailed report and statistics to inform the agent of the current environment health and space saved.

Janitor Setup

To install the skill within your Openclaw Skills project, navigate to the janitor directory and install the package:

cd ./janitor
npm install

You can then run cleanup tasks directly via the CLI:

node src/index.js cleanup
node src/index.js report

Janitor Data Schema & Taxonomy

Janitor tracks cleanup performance and system health using a structured reporting schema. This allows Openclaw Skills to understand the state of the host environment.

Property Type Description
filesDeleted Number Count of files removed during the last session
spaceSaved String Human-readable string of disk space recovered
memoryFreed Boolean Confirmation if garbage collection was triggered
status String Overall health status (e.g., 'healthy')
recommendations Array Actionable steps to improve agent efficiency

Janitor Advanced Features

  • Emergency recovery protocols that trigger at 95% context usage to prevent agent failure.
  • Multi-channel notification support for real-time alerts on cleanup status.
  • Git hook integration for automatic post-commit and post-push maintenance.
  • Customizable protection rules to define important files that should never be deleted.
  • Scheduled cleanup intervals for persistent Openclaw Skills monitoring agents.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*