context-hygiene

context-hygiene is a skill for Claude Code from getklaim/claude-auto-context. It costs 0 tokens per session (514 once invoked), scanned A, original, MIT.

A restricted audit for project context files, including Claude Code rules and CLAUDE.md instructions. It checks whether these instructions overlap, conflict, refer to missing files, or contain unnecessary detail.

In plain words
What is it for?
Use it to review context files, find duplicate or contradictory instructions, detect broken file patterns, assess verbosity, and maintain automatically generated local rules.
Why use it?
Messy project instructions can cause an agent to follow the wrong rule or spend time applying outdated guidance. The audit identifies those problems while limiting file changes to local rule files.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the claude-auto-context plugin — 6 skills, 2 agents, 6 hooks shipped together

Good fit Use it to review context files, find duplicate or contradictory instructions, detect broken file patterns, assess verbosity, and maintain automatically generated local rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/getklaim/claude-auto-context/context-hygiene
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 getklaim/claude-auto-context --skill context-hygiene
Clone the repo
git clone --depth 1 https://github.com/getklaim/claude-auto-context

Made for: Claude Code.

Or install claude-auto-context, the plugin that ships this one along with the rest of its 6 skills, 2 agents, 6 hooks.

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 context-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/getklaim/claude-auto-context/context-hygiene/github.svg)](https://agentmods.dev/skills/getklaim/claude-auto-context/context-hygiene)
Your own site
<a href="https://agentmods.dev/skills/getklaim/claude-auto-context/context-hygiene"><img src="https://agentmods.dev/badge/skills/getklaim/claude-auto-context/context-hygiene/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 context-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/getklaim/claude-auto-context/context-hygiene"><img src="https://agentmods.dev/badge/skills/getklaim/claude-auto-context/context-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 514 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.00000 $0.00514
Opus 5 $0.00000 $0.00257
Sonnet 5 $0.00000 $0.00103
Haiku 4.5 $0.00000 $0.00051

Measured 9d ago against content hash b2d4a0024368, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

context-hygiene 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 9d ago.

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.

skills/context-hygiene/SKILL.md · 31 lines

What it actually says

Context Hygiene Check

Scope Restriction

CRITICAL: You may only CREATE or MODIFY files in .claude/rules/local/.

  • .claude/rules/*.md (committed team rules): READ-ONLY — analyze but never modify
  • CLAUDE.md: READ-ONLY — analyze but never modify
  • .claude/rules/local/*.md (auto-generated rules): full read/write access
  • Hygiene files in .claude-auto-context/hygiene/: create only

Run a 5-point quality audit on the project's .claude/rules/*.md, .claude/rules/local/*.md, and CLAUDE.md files.

Procedure

  1. Read all .claude/rules/*.md files (committed team rules)
  2. Read all .claude/rules/local/*.md files (auto-generated rules)
  3. Read CLAUDE.md
  4. Check that rules files exist (committed + local combined)
    • If none exist: report "No context files to analyze" and stop
  5. Run the 5-point checklist:
    • H-01 Duplicate: Compare all rules file pairs — flag overlapping globs with same behavior
    • H-02 Contradiction: Compare rules pairs AND rules vs CLAUDE.md — flag opposite instructions for same scope
    • H-03 Stale Reference: For each rules file with globs in frontmatter, use Glob to verify matching files exist — flag if 0 matches
    • H-04 Verbosity: Flag rules files over 500 chars where 50%+ compression is possible — suggest compressed version
    • H-06 Priority Placement: When 5+ rules files exist, flag critical rules (error handling, security, testing) that have narrow globs limiting visibility
  6. For each issue found, create a hygiene file in .claude-auto-context/hygiene/ using the standard format:
    • Filename: hygiene-YYYYMMDD-HHMMSS-{slug}.md (type-prefixed, timestamp-based naming)
    • Include: Status (pending), Created (ISO 8601 UTC), Category (hygiene-*), Problem, Proposal, Evidence, Metrics sections
  7. Report summary: "{N} issues found, {M} context files analyzed"
    • If no issues: "All 5 checks passed. Context files are clean."
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. 9d ago First seen · 31 lines · 0 tokens per session scan A b2d4a0024368

Subscribe to this mod's changes

context-hygiene is a skill published in the GitHub repository getklaim/claude-auto-context (10 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 514 tokens. 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-31.

Related

Other skills, from other repositories

media-ingest

Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.

garrytan/gbrain · 52 tokens

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

establishing-project-context

Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.

GanyuanRan/Aegis · 45 tokens