Openclaw Gc banner
lucianfialho lucianfialho

Openclaw Gc

AI community

Description

Garbage collector and guardrails for OpenClaw AI agents

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

OpenClaw GC

openclaw-gc

Garbage collector and guardrails for OpenClaw AI agents.
Stop agents from trashing your filesystem.


The Problem

OpenClaw agents are powerful, but they make a mess:

  • Create files and folders everywhere — random temp files, orphaned directories, duplicated configs
  • Modify critical dotfiles — agents have been caught editing ~/.zshrc, ~/.ssh/, ~/.aws/credentials
  • Run destructive commandsrm -rf, chmod 777, piping curl to bash
  • Leave residuals after sessions — services running, config files scattered, no cleanup

**openclaw-gc** runs alongside OpenClaw as a safety layer — tracking what agents do, blocking dangerous actions, and cleaning up after them.

How It Works

Three layers of protection:

┌─────────────────────────────────────────────┐
│  Guardrails (pre-execution)                 │
│  Block dangerous paths, commands, rate limit │
├─────────────────────────────────────────────┤
│  Monitor (runtime)                          │
│  Track every file create/modify/delete       │
├─────────────────────────────────────────────┤
│  Collector (post-execution)                  │
│  Scan orphans, rollback sessions, sweep      │
└─────────────────────────────────────────────┘

Install

npm install -g @openclaw/gc

CLI Usage

# Check GC status and stats
ocgc status

# Scan for orphaned files agents left behind
ocgc scan

# Preview what would be cleaned (safe)
ocgc clean --dry-run

# Actually clean up
ocgc clean

# List agent sessions
ocgc sessions list

# See everything a session did
ocgc sessions inspect 

# Undo all changes from a session
ocgc rollback 
ocgc rollback  --dry-run

# Start the API server (for dashboard/UI)
ocgc serve

# Manage configuration
ocgc config show
ocgc config