clean

A command for removing old or selected screenshot snapshots from Peekaboo's cache, with an option to preview the cleanup first.

In plain words
What is it for?
It is for deleting all eligible snapshots, snapshots older than a chosen age, or one identified snapshot, with dry-run support.
Why use it?
Screenshot and interface-map caches can grow over time, and the command limits cleanup to eligible snapshot data.

Command

▶ Your AI Agent Can Now Drive Your Mac (Peekaboo Tutorial) Omar Kamal · about openclaw/Peekaboo · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/peekaboo/clean
Clone the repo
git clone --depth 1 https://github.com/openclaw/Peekaboo
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 802 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00802
Opus 5 $0.00000 $0.00401
Sonnet 5 $0.00000 $0.00160
Haiku 4.5 $0.00000 $0.00080

Measured 2d ago against content hash f1d1f242997b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/clean.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

peekaboo clean

clean removes entries from ~/.peekaboo/snapshots/ by age, by ID, or wholesale. Because every see/click pipeline streams screenshots and UI maps into that cache, it can grow quickly; this command is the supported way to prune it without deleting unrelated files.

Modes

Flag Effect
--all-snapshots Delete every producer-owned or cleanup-eligible legacy snapshot directory.
--older-than <hours> Delete eligible snapshots older than the given hour threshold (defaults to 24 if omitted).
--snapshot <id> Remove one eligible on-disk snapshot: a producer-owned ps1_ reference or a strict legacy timestamp directory.
--dry-run Print what would be removed without touching disk.

Only one of the three selection flags may be supplied at a time; the command validates this before doing any IO.

Current snapshot references use exactly ps1_ followed by 32 lowercase ASCII hexadecimal digits. Cleanup removes one only when its on-disk producer marker binds the directory to that same reference. The 128-bit random reference is reserved by its producer before snapshot data is stored; an unowned lookalike directory is ignored.

For migration cleanup only, clean also recognizes the old timestamp shape: exactly 13 decimal digits, a hyphen, and 4 decimal digits, such as 1787675983803-1514. That directory must contain a regular, non-symlink snapshot.json. Legacy timestamp IDs are not listed as usable snapshots and cannot be passed to interaction commands. Arbitrary names, empty values, ./.. traversal, nested or absolute paths, control characters, symlinks, and malformed legacy directories are rejected or ignored without deleting them.

Implementation notes

  • Cleanup work is delegated to services.files (cleanAllSnapshots, cleanOldSnapshots, cleanSpecificSnapshot); specific-snapshot cleanup validates ownership or the strict legacy shape before either previewing or deleting it.
  • --all-snapshots and age cleanup remove only producer-owned current directories or cleanup-eligible legacy directories. They leave unowned ps1_ lookalikes and unrelated cache entries untouched.
  • Text output summarizes number of snapshots removed and bytes freed (using ByteCountFormatter), while JSON output wraps the raw CleanResult with an executionTime so you can log metrics.
  • A valid --snapshot <id> that is not found on disk succeeds with zero removals: text output says the ID missed the disk cache and JSON includes data.not_found: true. This command does not delete daemon-memory snapshots; that is tracked separately from disk pruning.

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 0 tokens per session scan A f1d1f242997b

Subscribe to this mod's changes

clean is a command published in the GitHub repository openclaw/Peekaboo (5,098 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 802 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.