The Predicate Snapshot Engine uses ML to rank web elements by actionability. Cut observation tokens by 95%+, reduce latency, and eliminate hallucinations caused by HTML noise. Built natively as an OpenClaw Skill to replace default A11y trees.
npx clawdhub install predicate-snapshotFilters out ad iframes, tracking pixels, and decorative garbage. Returns only the 50 most relevant elements.
Ad-heavy sites dump 500k+ tokens into your context window. Most are tracking pixels, hidden modals, and decorative garbage.
| Site | Default A11y Tree / DOM | Predicate Snapshot | Savings |
|---|---|---|---|
slickdeals.net | 598,301(24k elements) | 1,283(50 elements) | 99.8% |
news.ycombinator.com | 16,484(681 elements) | 587(50 elements) | 96.0% |
httpbin.org/html | 1,590(34 elements) | 164(4 elements) | 90.0% |
Ad iframes, tracking pixels, and hidden overlays are stripped out. Only actionable elements remain.
We extract only what the LLM needs to click, fill, or read. The ML model identifies the most relevant elements.
Pipe-delimited strings optimize context windows and prevent overflow. LLM-friendly format.
You're running OpenClaw agents on real-world sites. Standard accessibility trees dump 500k+ tokens of tracking pixels, hidden modals, and decorative divs into your context window. You're burning API credits on garbage.
# Pipe-delimited output format (LLM-friendly)
ID|role|text|imp|is_primary|docYq|ord|DG|href
42|button|Sign In|0.98|true|520|1|auth-form|
15|textbox|Username|0.95|true|480|1|auth-form|
23|textbox|Password|0.92|true|500|2|auth-form|
67|link|Forgot Password?|0.71|false|540|3|auth-form|/reset
89|button|Create Account|0.68|false|600|1|signup|
# 50 ranked elements vs 24,567 raw DOM nodes
# 1,283 tokens vs 598,301 tokens# 1. Install the skill via ClawHub
npx clawdhub@latest install predicate-snapshot
# 2. (Optional) Set API key for ML-powered ranking
export PREDICATE_API_KEY="sk-your-key-here"
# 3. Use in OpenClaw
/predicate-snapshot # Get top 50 ranked elements
/predicate-act click 42 # Click element by ID
/predicate-snapshot-local # Free local mode (no API)
# Without API key: ~80% token reduction (heuristic)
# With API key: ~95% token reduction (ML-ranked)Feeding massive OpenClaw A11y trees to an LLM doesn't just cost money—it destroys accuracy. The larger the context window, the more the agent hallucinates interactions with invisible or irrelevant elements.
You want to run autonomous browser agents locally, but Llama and Qwen choke on massive HTML dumps. By compressing the actionable DOM into a few hundred tokens, Predicate makes complex web automation possible on small, local models.
ML-powered ranking for maximum token savings. Best accuracy.
PREDICATE_API_KEY=sk-...Rule-based pruning. No API key needed. ~80% token reduction.
/predicate-snapshot-local