OpenClaw Safe Uninstall
Overview
This skill performs high-risk local OpenClaw uninstall work through a strict sequence:
- scan
- plan
- explicit human approval
- apply
- verify
Do not jump straight to deletion.
Use the deterministic helper script in scripts/openclaw_uninstall.py instead of ad-hoc rm -rf unless the user explicitly wants a manual one-off cleanup.
Hard boundaries
- Never auto-delete anything under
.codex/skillsor.agents/skills. - Never auto-delete anything under protected AI tooling roots such as
.claude/skills,.claude/agents,.claude/commands,.gemini/commands,.opencode/skills, or.config/opencode/skills. - Never treat
openclawin a path string as sufficient deletion evidence by itself. - Known companion traces such as
AutoClawmust be reported asmanual_review, not auto-deleted. - Require explicit user intent before
apply. - Require all three apply flags:
--yes--acknowledge-risk--confirm "REMOVE OPENCLAW FROM THIS MACHINE"
- If root-owned artifacts remain, report exact manual commands rather than claiming success.
Required workflow
Step 1: Scan
Run:
python3 scripts/openclaw_uninstall.py scan --json
Review:
- detected state directories
- service registrations
- CLI/package installs
- shell injection
- manual review artifacts
- excluded paths
Step 2: Build the uninstall plan
Run:
python3 scripts/openclaw_uninstall.py plan --json
Explain:
- what will be deleted automatically
- what requires privilege
- what is intentionally excluded
- what remains manual review only
Step 3: Apply only with explicit approval
Run:
python3 scripts/openclaw_uninstall.py apply \
--yes \
--acknowledge-risk \
--confirm "REMOVE OPENCLAW FROM THIS MACHINE" \
--json
If the user wants rehearsal first, add --dry-run.
Step 4: Verify
Run:
python3 scripts/openclaw_uninstall.py verify --json
Summarize:
- removed artifacts
- remaining privileged artifacts
- remaining manual review artifacts
- exact next-step commands if anything remains
Platform notes
- macOS:
- detect LaunchAgents like
ai.openclaw.gateway,ai.openclaw.<profile>, and legacycom.openclaw.* - detect shell completion injection
- detect optional app bundle paths
- detect LaunchAgents like
- Linux:
- detect
systemd --userunits such asopenclaw-gateway[-<profile>].service - detect legacy unit names like
clawdbot-gatewayandmoltbot-gateway - detect wrapper installs and global package paths
- detect
- Windows:
- detect Scheduled Task naming conventions
- detect Startup-folder fallback launchers
- detect
gateway.cmdandnode.cmdin the state dir
- Neighboring AI tooling ecosystems:
- protect Claude Code subagent/custom-command directories
- protect Gemini CLI custom-command directories
- protect OpenCode skill directories and compatibility skill roots
References
- references/research-notes.md
- references/artifact-matrix.md
- references/safety-model.md
Validation
Before you claim the uninstall plan is correct, run:
python3 -m unittest discover -s tests -v