← Back to Skills Marketplace
guoqunabc

Browser Zombie Cleaner.Removed

by Madoka · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
110
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install browser-zombie-cleaner-removed
Description
Detect and clean up zombie browser processes left by OpenClaw's browser tool. When the OpenClaw Gateway restarts, Playwright-launched browser processes get o...
README (SKILL.md)

Browser Zombie Cleaner

Detect and clean up orphaned browser processes left behind when OpenClaw Gateway restarts.

The Problem

OpenClaw's browser tool uses Playwright to launch Chrome/Chromium/Firefox. When the Gateway restarts (update, crash, manual restart), these browser child processes become orphans — their parent PID changes to 1 (init/systemd). They keep running, consuming memory, and accumulate over days.

Safety Design

This tool is safe by default:

  1. Detect-only mode is the default — no processes are killed without --kill
  2. Triple verification before killing: OpenClaw user-data-dir pattern + orphaned PPID + minimum age
  3. Only current user's processes — never touches other users
  4. Only OpenClaw browsers — identified by ~/.openclaw/browser/ in the command line
  5. Graceful shutdown — SIGTERM first, SIGKILL only after grace period
  6. Audit log — every action is logged to /tmp/openclaw/zombie-browser-cleanup.log
  7. No root required — runs as regular user

Usage

Detect only (safe, default)

bash \x3Cskill_dir>/scripts/cleanup-zombie-browsers.sh

Output example:

Found 8 OpenClaw browser processes, 5 are zombies (1200MB total)
  ZOMBIE: PID=66301 PPID=1 age=3d 2h mem=388MB
  ZOMBIE: PID=152356 PPID=1 age=2d 4h mem=168MB
  ...
Run with --kill to terminate these zombie processes

Detect and clean

bash \x3Cskill_dir>/scripts/cleanup-zombie-browsers.sh --kill

Options

Option Default Description
--kill off Actually terminate zombie processes
--min-age N 3600 (1h) Only target processes older than N seconds
--grace N 10 Seconds between SIGTERM and SIGKILL
--json off Output as JSON (for programmatic use)
--log PATH /tmp/openclaw/zombie-browser-cleanup.log Log file location
--pattern STR .openclaw/browser/ Pattern to identify OpenClaw browsers

Integration with Health Checks

Add to your health check script or heartbeat:

# Detect and report (no kill)
bash /path/to/cleanup-zombie-browsers.sh

# Auto-clean with safety margin (processes must be >2 hours old)
bash /path/to/cleanup-zombie-browsers.sh --kill --min-age 7200

How It Identifies Zombies

A process is classified as a zombie browser if ALL of these are true:

  1. Browser process — executable name matches chrome/chromium/brave/msedge/firefox
  2. OpenClaw origin — command line contains .openclaw/browser/ (the user-data-dir used by OpenClaw)
  3. Orphaned — PPID is 1 (init) or systemd, meaning the parent Gateway process is gone
  4. Old enough — process age exceeds --min-age threshold (prevents killing browsers that are actively initializing)

If ANY condition is not met, the process is skipped.

Platform Support

Platform Status Notes
Linux Full Uses /proc filesystem for precise detection
macOS Full Uses ps with etime parsing
Windows Not yet Planned (PowerShell-based)

Supported Browsers

All Playwright-supported browsers with OpenClaw user-data-dir:

  • Google Chrome / Chromium
  • Brave Browser
  • Microsoft Edge
  • Firefox

Exit Codes

Code Meaning
0 No zombies found, or zombies cleaned (--kill mode)
1 Zombies detected but not killed (detect mode)
Usage Guidance
This skill appears to do what it claims (detect and optionally kill orphaned OpenClaw browser processes) and does not request secrets or installs remote code. However, the script has a safety/bug risk: if it cannot read a parent's cmdline it treats that parent as 'orphaned', which can cause false positives. Before using --kill in production, run the script in default (detect-only) mode and carefully inspect its output and the log (/tmp/openclaw/zombie-browser-cleanup.log). Recommended precautions: - Run with no flags first and review the reported PIDs and command lines. - Use a conservative --min-age (e.g., >7200s) when first enabling --kill. - Consider auditing and patching the script: change error handling in is_orphaned() so read failures do NOT default to 'orphaned' (i.e., return non-orphan on read errors), and ensure parent PID checks are robust before sending signals. - Test on a non-production system or with a single test user to confirm behavior. If you want, I can point out exact lines to change to avoid the misclassification and suggest safer kill logic (double-check PPID==1 and that the parent process truly does not exist before terminating children).
Capability Analysis
Type: OpenClaw Skill Name: browser-zombie-cleaner-removed Version: 1.0.0 The skill is a maintenance utility designed to identify and terminate orphaned browser processes (zombies) left behind by OpenClaw's browser tool. The bash script (cleanup-zombie-browsers.sh) implements several safety checks, including verifying process ownership, checking for specific OpenClaw-related command-line patterns, ensuring the process is orphaned (PPID=1), and enforcing a minimum process age before termination. It defaults to a 'detect-only' mode and requires an explicit flag to kill processes, with no evidence of data exfiltration or unauthorized execution.
Capability Assessment
Purpose & Capability
Name, description, SKILL.md, and the included shell script all focus on detecting and optionally killing orphaned OpenClaw-launched browser processes. No unrelated credentials, binaries, or install steps are requested.
Instruction Scope
The SKILL.md restricts scope to the current user's OpenClaw browser processes and the script implements that via /proc and ps. However, there are a few implementation issues: an early ps parsing branch is left effectively unused, and the is_orphaned() function treats failures to read /proc/$ppid/cmdline as 'orphaned' (it returns success on read error). That behavior can incorrectly mark live processes as orphaned, which combined with --kill could terminate legitimate browser processes. The script also assumes Linux/macOS /proc and ps semantics (Windows unsupported as documented).
Install Mechanism
Instruction-only skill with an included shell script; there is no install spec, no downloads, and nothing is written to the system beyond logs created at runtime. This is the lowest-risk install model.
Credentials
No required environment variables or credentials. The script optionally honors OPENCLAW_ZOMBIE_LOG for log path and has a sensible default /tmp/openclaw/ path. No unrelated secrets or config paths are requested.
Persistence & Privilege
always is false and the skill does not request persistent/privileged presence. The script is intended to be run manually or integrated into health checks; it does not modify other skill configs or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install browser-zombie-cleaner-removed
  3. After installation, invoke the skill by name or use /browser-zombie-cleaner-removed
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of Browser Zombie Cleaner. - Detects and optionally cleans up orphaned (zombie) browser processes launched by OpenClaw after Gateway restarts. - Default mode is safe, detect-only; no processes are killed unless --kill is specified. - Uses strict criteria to identify only relevant orphaned browser processes owned by the current user. - Provides audit logging for all actions and does not require root access. - Supports both Linux and macOS; Windows support is planned.
Metadata
Slug browser-zombie-cleaner-removed
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Browser Zombie Cleaner.Removed?

Detect and clean up zombie browser processes left by OpenClaw's browser tool. When the OpenClaw Gateway restarts, Playwright-launched browser processes get o... It is an AI Agent Skill for Claude Code / OpenClaw, with 110 downloads so far.

How do I install Browser Zombie Cleaner.Removed?

Run "/install browser-zombie-cleaner-removed" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Browser Zombie Cleaner.Removed free?

Yes, Browser Zombie Cleaner.Removed is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Browser Zombie Cleaner.Removed support?

Browser Zombie Cleaner.Removed is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Browser Zombie Cleaner.Removed?

It is built and maintained by Madoka (@guoqunabc); the current version is v1.0.0.

💬 Comments