coalwash

coalwash is a skill for Claude Code from TheColliery/CoalWash. It costs 254 tokens per session (7,411 once invoked), scanned A, original, Apache-2.0.

A memory-cleaning tool for AI agents that removes or reorganizes selected memory while checking that important structured tokens are preserved. It has a mechanical quick pass and a separately consented full pass.

In plain words
What is it for?
Use it to clean governance and memory records, compare structured content before and after, and review whether meaningful facts survived.
Why use it?
It helps control growing agent memory while making rollback possible if applying the cleaning plan fails.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the coalwash plugin — 1 skill shipped together

Good fit Use it to clean governance and memory records, compare structured content before and after, and review whether meaningful facts survived.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thecolliery/coalwash/coalwash
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TheColliery/CoalWash --skill coalwash
Clone the repo
git clone --depth 1 https://github.com/TheColliery/CoalWash

Made for: Claude Code.

Or install coalwash, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coalwash

README.md
[![agentmods](https://agentmods.dev/badge/skills/thecolliery/coalwash/coalwash/github.svg)](https://agentmods.dev/skills/thecolliery/coalwash/coalwash)
Your own site
<a href="https://agentmods.dev/skills/thecolliery/coalwash/coalwash"><img src="https://agentmods.dev/badge/skills/thecolliery/coalwash/coalwash/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for coalwash

Your own site · 80×15
<a href="https://agentmods.dev/skills/thecolliery/coalwash/coalwash"><img src="https://agentmods.dev/badge/skills/thecolliery/coalwash/coalwash.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 254 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00254 $0.07411
Opus 5 $0.00127 $0.03705
Sonnet 5 $0.00051 $0.01482
Haiku 4.5 $0.00025 $0.00741

Measured today against content hash 80b40827fade, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

coalwash scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/coalwash/SKILL.md · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CoalWash — the memory washer

Fidelity scope — CLASS-B wash tiers only (class-A estate = the byte-identity contract two notes down): the gate PROVES every STRUCTURED token that went in came out (the classes at step 3) by mechanical diff; it CANNOT SEE survivors trading places (pass 878/fail 0pass 0/fail 878 passes it) — re-pairing + load-bearing prose facts are the semantic reviewers' + YOUR job, never the gate's. Deletes ride the adjudicated plan, not a separate approval; safety is the transactional apply (snapshot → whole-run rollback; a rollback whose own restore fails reports partial, never a silent mixed state). CoalWash slows memory-overhead growth — it does not eliminate it.

[!CAUTION] Fat grows at a different rate per project — a schedule cleans lean memory, and past fat-exhaustion a semantic pass can throw away something load-bearing (prohibitions #1–2). A looped Full tier re-pays semantic cost every round for nothing, and accumulates over-compression pressure.

Class-A estate (ULTRA + RE-TIER's byte lane) — a DIFFERENT, STRONGER contract: transcripts/tool-results are vendor-owned + machine-parsed (fail the 4 wash tests) → NEVER semantic-edited; the guarantee is byte-identity (copy-verify-then-delete, estate-restore round-trips) — not the structured-token gate above. The seams where the class-B gate re-enters = RE-TIER's hot-index rewrite + choice 4's ③ manual-tier work (fidelity gate + MOVE-VERIFY + #54 anchor bind exactly there). Detail → references/method.md §10/§11.

You are the insider/orchestrator — the heavy core is CODE (the engine modules beside this skill); you do ONLY the semantic judgment a script cannot. Resolve LIB = ../../scripts/lib from this file (plugin and file-copy layouts identical; confirm fidelity-gate.mjs is there). Deep detail — snippets, the outsider rubric, the garbage taxonomy — is references/method.md; Claude Code adapter facts (paths, caps, state files) are references/platform-cc.md. Both load on-demand; the cheap path never pays for them.

Read the full file on GitHub · 191 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +1 tokens per session 80b40827fade
  2. 10d ago First seen · 191 lines · 253 tokens per session scan A eaf4ed9a3808

Subscribe to this mod's changes

coalwash is a skill published in the GitHub repository TheColliery/CoalWash (11 stars, last pushed today), licensed Apache-2.0. It adds 254 tokens to every session and 7,411 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.