Xpersona
C

Context Hygiene

CLAWHUB · Unverified

Reasoning hygiene protocol for OpenClaw agents — keep context sharp by collapsing exploration into decisions, enforcing file budgets, and pruning ghost conte... Skill: Context Hygiene Owner: ppiankov Summary: Reasoning hygiene protocol for OpenClaw agents — keep context sharp by collapsing exploration into decisions, enforcing file budgets, and pruning ghost conte... Tags: latest:1.2.0 Version history: v1.2.0 | 2026-03-28T05:18:51.593Z | user Session lifespan rule: 50 messages → 85% context window (contextspectre proxy keeps sessions cleaner) v1.1.0 | 2026-03-25T09:01:22.551

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17fzet2pk4zvezemyabzwzp6x83kp5d:context-hygiene
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-ppiankov-context-hygiene/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

35,404 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

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

| File | Max lines | Review cycle |
|------|-----------|--------------|
| MEMORY.md | 50 | Weekly prune |
| memory/YYYY-MM-DD.md | 30 | Collapse at EOD |
| HEARTBEAT.md | 10 | Remove when done |
| TOOLS.md | 30 | When things change |
| SOUL.md | 30 | Rarely |
| USER.md | 20 | When 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 

_meta.json

{
  "ownerId": "kn74fw5mx1yr4kb8ravpfz425d81wt92",
  "slug": "context-hygiene",
  "version": "1.2.0",
  "publishedAt": 1774675131593
}

skill-card.md

## Description:

Reasoning hygiene protocol for OpenClaw agents - keep context sharp by collapsing exploration into decisions, enforcing file budgets, and pruning ghost context.

This skill is ready for commercial/non-commercial use.

## Publisher:

[ppiankov](https://clawhub.ai/user/ppiankov)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agent operators use this skill to keep OpenClaw workspace context concise by collapsing exploration notes into decisions, pruning stale memory, and setting practical file budgets.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Context pruning can remove useful memory notes or workspace context.

Mitigation: Ask the agent to show diffs before deleting memory, and back up important notes before pruning.

Risk: Cron reports, reminders, and date references can be wrong if the agent uses an incorrect timezone.

Mitigation: Confirm the user's real timezone and record it explicitly before relying on time-sensitive automation.

Risk: The optional validator command installs and runs an external package.

Mitigation: Run the validator only after verifying that the installed package is trusted for the workspace.

## Reference(s):

- [Agent-Native CLI Convention](https://ancc.dev)

## Skill Output:

**Output Type(s):** [Guidance, Markdown, Configuration]

**Output Format:** [Markdown guidance with inline code blocks and setup commands]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Provides workspace memory budgets, pruning rules, session lifespan guidance, and a context hygiene self-check.]

## Skill Version(s):

1.2.0 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Context Hygiene and adjacent AI workflows.