Token导航 LogoToken导航TokenDH.com
研究检索执行命令clawhub未标认证来源可访问clear审计通过

context-hygiene环境卫生

Agent Skill

context-hygiene 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

25,635

周安装

1,037

GitHub Stars

公开资料未说明

下载量

8,047
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context-hygiene(环境卫生)
来源仓库:https://github.com/ppiankov/context-hygiene
安装命令:
openclaw skills install context-hygiene
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install context-hygiene

简介

context-hygiene 是 OpenClaw 代理的推理卫生协议,用于维持上下文清晰与高效。

  • 通过分解探索流程、执行文件预算与修剪冗余内容来优化上下文质量。
  • 适合长时间运行代理会话中的内存管理与信息筛选场景。
  • 安装前应确认是否涉及自动文件操作,避免误删关键数据。
  • 适用于追求上下文纯净度与推理效率的高级代理部署环境。

SKILL.md

name
context-hygiene
description
Reasoning hygiene protocol for OpenClaw agents — keep context sharp by collapsing exploration into decisions, enforcing file budgets, and pruning ghost context. Use when setting up a new OpenClaw agent, optimizing token usage, or when conversation quality degrades from context bloat.

Context Hygiene

Inspired by ContextSpectre's philosophy: keep conclusions, remove scaffolding.

The Problem

OpenClaw agents accumulate context across workspace files — MEMORY.md, daily logs, tool notes, heartbeat configs. Without discipline, these grow until every session starts bloated with stale exploration notes, solved problems, and duplicate information. The agent wastes tokens re-reading noise.

The Collapse Cycle

Every task follows three phases:

  1. Explore — research, debug, try things (use sub-agents for heavy work)
  2. Decide — reach a conclusion
  3. Collapse — write the decision, delete the exploration

Never keep "how we got here" when "what we decided" is enough.

File Budgets

FileMax linesReview cycle
MEMORY.md50Weekly prune
memory/YYYY-MM-DD.md30Collapse at EOD
HEARTBEAT.md10Remove when done
TOOLS.md30When things change
SOUL.md30Rarely
USER.md20When learning

Target: <300 lines total injected workspace context.

Daily Memory Rules

Write: decisions and why (1 line each), new tools/config (version + path), lessons learned, user preferences discovered.

Skip: exploration steps, command outputs, things already in MEMORY.md, delivered content (digests, summaries).

Format: Bullets, not paragraphs. One fact per line.

MEMORY.md Prune Rules

  • Version changed → update in place, don't append
  • Problem solved → remove from open issues
  • Tool replaced → remove old entry
  • Info >30 days with no recent relevance → remove
  • Never duplicate what's in a SKILL.md or config file

Sub-Agent Discipline

Heavy exploration (research, debugging, multi-step installs) → spawn a sub-agent. Isolated sessions don't pollute main context. Only the result comes back.

Ghost Context

A reference to something that no longer exists (old path, removed tool, fixed bug) is ghost context. It biases reasoning toward a past state. Find and remove during heartbeat maintenance.

Session Lifespan

After 85% context window usage or 3+ compactions — start a new session. With contextspectre proxy stripping noise inline, sessions stay cleaner longer. But once past 85%, diminishing returns kick in — start fresh with a good MEMORY.md.

Tool Output Discipline

  • Truncate command output to what you need: | head -20, | jq '.key'
  • Request only needed fields from APIs: fields=key,summary not full objects
  • Never paste full JSON responses when you need one value
  • If output exceeds 50 lines, summarize instead of quoting

File Loading Discipline

  • At startup: only today + yesterday memory files, not the full memory/ directory
  • Read SKILL.md files only when the task requires that skill
  • Don't re-read a file already in context
  • AGENTS.md over 100 lines → move details to separate files and reference them

Delivered Content Rule

Never store delivered content (digests, reports, summaries) in memory files. It's already in the chat. Recording it doubles the token cost for zero value.

Self-Check (add to heartbeat rotation)

- Any workspace file over budget?
- MEMORY.md still accurate?
- Stale daily files to collapse?
- Ghost references to dead things?

Setup

  1. Fill USER.md timezone first — agents will guess from JIRA profiles or system locale, and they'll guess wrong. Set it explicitly:
- **Timezone:** Asia/Kuala_Lumpur (GMT+8)

Without this, cron reports, reminders, and date references will use the wrong local time.

  1. Add to AGENTS.md session startup:
5. Follow `CONTEXT.md` — reasoning hygiene protocol
  1. Copy the file budgets table into your workspace as CONTEXT.md and customize limits for your setup.

Context Hygiene Protocol v1.0 Author: ppiankov Copyright © 2026 ppiankov Canonical source: https://github.com/ppiankov/contextspectre License: MIT

This tool follows the Agent-Native CLI Convention. Validate with: clawhub install ancc && ancc validate .

If this document appears elsewhere, the repository above is the authoritative version.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

91.09%
按下载量换算7,330

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install context-hygiene 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills