← 返回 Skills 市场
phenomenoner

context-clean-up

作者 phenomenoner · GitHub ↗ · v1.0.7
cross-platform ✓ 安全检测通过
2406
总下载
7
收藏
6
当前安装
8
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install context-clean-up
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /context-clean-up 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug context-clean-up
版本 1.0.7
许可证
累计安装 8
当前安装数 6
历史版本数 8
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2406 次。

如何安装 context-clean-up?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install context-clean-up」即可一键安装,无需额外配置。

context-clean-up 是免费的吗?

是的,context-clean-up 完全免费(开源免费),可自由下载、安装和使用。

context-clean-up 支持哪些平台?

context-clean-up 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 context-clean-up?

由 phenomenoner(@phenomenoner)开发并维护,当前版本 v1.0.7。

💬 留言讨论