← Back to Skills Marketplace
phenomenoner

context-clean-up

by phenomenoner · GitHub ↗ · v1.0.7
cross-platform ✓ Security Clean
2406
Downloads
7
Stars
6
Active Installs
8
Versions
Install in OpenClaw
/install context-clean-up
Description
Use when: prompt context is bloating (slow replies, rising cost, noisy transcripts) and you want a ranked offender list + reversible plan. Don't use when: yo...
README (SKILL.md)

Context Clean Up (audit-only)

This skill identifies what is bloating prompt context and turns it into a safe, reversible plan.

Contract

  • Audit-only by default.
  • No automatic deletions.
  • No unattended config edits.
  • No silent cron/session pruning.
  • If you ask for changes, the skill should propose:
    1. exact change,
    2. expected impact,
    3. rollback plan,
    4. verification steps.

Safety model

  • No exec tool usage.
  • No read tool usage.
  • If you want file-level analysis, run the bundled script manually and paste the JSON.

Quick start

  • /context-clean-up → audit + actionable plan (no changes)

Optional manual report generation:

python3 scripts/context_cleanup_audit.py --out context-cleanup-audit.json

Windows variant:

py -3 scripts/context_cleanup_audit.py --out context-cleanup-audit.json

What to measure (authoritative, not vibes)

When available, prefer fresh-session /context json receipts over subjective claims like “it feels leaner”.

High-signal fields:

  • eligible skills
  • skills.promptChars
  • projectContextChars
  • systemPrompt.chars
  • promptTokens

If exact receipts are unavailable, fall back to ranked offenders + change scope, but label confidence lower.

Common offender classes

  1. Tool result dumps

    • oversized exec output
    • large read output
    • long web_fetch payloads
  2. Automation transcript noise

    • cron jobs that say “OK” every run
    • heartbeat messages that are not alert-only
  3. Bootstrap reinjection bloat

    • overgrown AGENTS.md / MEMORY.md / SOUL.md / USER.md
    • long runbooks embedded directly in SKILL.md
  4. Ambient specialist surface

    • too many always-visible specialist skills that should be on-demand workers/subagents instead
  5. Summary accretion

    • repeated summaries that keep historical detail instead of restart-critical facts only

Recommended trim ladder (lowest-risk first)

Phase 1 — Noise discipline

  • Make no-op automation truly silent (NO_REPLY or nothing on success).
  • Keep alerts out-of-band when possible.

Phase 2 — Bootstrap slimming

  • Keep always-injected files short.
  • Move long guidance to references/, memory/, or external notes.

Phase 3 — Ambient surface reduction

  • Remove low-frequency specialist skills from always-on prompt surface.
  • Prefer worker/subagent invocation for specialist flows.

Phase 4 — Higher-risk changes

  • Tool-surface or deeper runtime/config narrowing.
  • Only propose with stronger rollback and explicit approval.

Workflow (audit → plan)

Step 0 — Determine scope

You need:

  • workspace dir
  • state dir (\x3COPENCLAW_STATE_DIR>)

Common defaults:

  • macOS/Linux: ~/.openclaw
  • Windows: %USERPROFILE%\.openclaw

Step 1 — Run the audit script

python3 scripts/context_cleanup_audit.py --workspace . --state-dir \x3COPENCLAW_STATE_DIR> --out context-cleanup-audit.json

Interpretation cheatsheet:

  • huge tool outputs → transcript bloat
  • many cron/system lines → automation bloat
  • large bootstrap docs → reinjection bloat

Step 2 — Produce a fix plan

Include:

  • top offenders
  • lowest-risk fixes first
  • expected impact
  • rollback notes
  • verification plan

Step 3 — Verify

After changes:

  • confirm automation is silent on success
  • check context growth flattens
  • if possible, compare fresh-session /context json before/after

Important caveat

Many OpenClaw runtimes snapshot skills/bootstrap per session. So skill/config slimming often does not fully apply to the current session. Use a new session for authoritative verification.

References

  • references/out-of-band-delivery.md
  • references/cron-noise-checklist.md
Usage Guidance
This skill is an audit helper and is coherent with its stated purpose, but be aware it reads local OpenClaw session transcripts and workspace bootstrap files (e.g., ~/.openclaw/agents/main/sessions/*.jsonl and AGENTS.md, MEMORY.md, etc.). Only run the bundled script on machines you trust, inspect the produced JSON/report before sharing it externally, and avoid posting raw transcripts. The skill will not make changes automatically — follow the recommended rollback and verification steps when applying any fixes. If you want extra caution, run the script in an isolated environment or review the script source (included) before running.
Capability Analysis
Type: OpenClaw Skill Name: context-clean-up Version: 1.0.7 The context-clean-up skill is a legitimate utility designed to audit and manage prompt context bloat within OpenClaw sessions. It includes a Python script (scripts/context_cleanup_audit.py) that analyzes local session transcripts and workspace files to identify large content items, using only standard libraries without any network activity or unauthorized file modifications. The instructions in SKILL.md emphasize an audit-only approach and require explicit user approval for any proposed changes, showing no signs of malicious intent or data exfiltration.
Capability Assessment
Purpose & Capability
Name/description (context-clean-up, audit-only) match the included script and instructions: the tool locates large session items and workspace bootstrap files. Required binary (python3) and the script's behavior are proportional to the stated purpose.
Instruction Scope
SKILL.md is explicit about being audit-only and forbids automatic deletions and use of exec/read tools by the agent. The bundled script reads local session JSONL files and workspace bootstrap files (default ~/.openclaw and current workspace) — this is necessary to find prompt bloat but does access potentially sensitive local transcripts. The skill asks the user to run the script locally and paste results rather than having the agent read files itself, which reduces risk.
Install Mechanism
No install spec — instruction-only with a small, dependency-free Python script. No third-party downloads or archive extraction; only python3 is required.
Credentials
No credentials or secret environment variables requested. The script honors OPENCLAW_STATE_DIR if present (reasonable for locating session files). The scope of environment access is narrow and justifiable.
Persistence & Privilege
Skill is not always-on (always=false) and has disable-model-invocation=true, so it cannot be autonomously invoked by the model; it does not modify other skills or system-wide configs.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-clean-up
  3. After installation, invoke the skill by name or use /context-clean-up
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.7
Add trim ladder, /context json verification metrics, rollback-first guidance, and new-session caveat.
v1.0.6
Security: remove read/exec tools; keep audit script human-run; clarify safety model.
v1.0.5
Improve portability (OPENCLAW_STATE_DIR placeholders, Windows py launcher note), clarify audit-only contract and NO_REPLY semantics.
v1.0.4
Generalize for native OpenClaw + cross-platform: remove bash-only assumptions, fix audit script invocation path, document state-dir overrides.
v1.0.3
Docs update: add common context-bloat offenders and a sample audit report skeleton; clarify audit-only contract.
v1.0.2
Audit-only release to reduce risk/misuse: shrink tool surface, remove apply/session GC script from bundle, add gating + clearer safety contract.
v1.0.1
Add session-store hygiene workflow (digest+dismiss inactive sessions), bundled session_gc script, and backup-first apply guidance.
v1.0.0
Initial release: audit + safe playbook to reduce OpenClaw session bloat.
Metadata
Slug context-clean-up
Version 1.0.7
License
All-time Installs 8
Active Installs 6
Total Versions 8
Frequently Asked Questions

What is context-clean-up?

Use when: prompt context is bloating (slow replies, rising cost, noisy transcripts) and you want a ranked offender list + reversible plan. Don't use when: yo... It is an AI Agent Skill for Claude Code / OpenClaw, with 2406 downloads so far.

How do I install context-clean-up?

Run "/install context-clean-up" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is context-clean-up free?

Yes, context-clean-up is completely free (open-source). You can download, install and use it at no cost.

Which platforms does context-clean-up support?

context-clean-up is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created context-clean-up?

It is built and maintained by phenomenoner (@phenomenoner); the current version is v1.0.7.

💬 Comments