context-hygiene

context-hygiene is a skill for Claude Code from knitli/toolshed. It costs 36 tokens per session (771 once invoked), scanned A, original, MIT.

A set of rules for keeping files that guide coding agents accurate and consistent. It covers files such as CLAUDE.md, AGENTS.md, Cursor rules, and other tool-specific instructions.

In plain words
What is it for?
Use it when checking or maintaining agent instructions, memory files, tool settings, plans, and project documentation across different coding-agent systems.
Why use it?
Agent guidance can become outdated, refer to missing files, or conflict across tools. This helps identify and manage those problems.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ctx plugin — 2 skills, 5 commands, 2 agents shipped together

Good fit Use it when checking or maintaining agent instructions, memory files, tool settings, plans, and project documentation across different coding-agent systems.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add knitli/toolshed
Claude Code
/plugin install ctx

Made for: Claude Code.

Or install ctx, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 2 agents.

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/knitli/toolshed/context-hygiene/github.svg)](https://agentmods.dev/skills/knitli/toolshed/context-hygiene)
Your own site
<a href="https://agentmods.dev/skills/knitli/toolshed/context-hygiene"><img src="https://agentmods.dev/badge/skills/knitli/toolshed/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/knitli/toolshed/context-hygiene"><img src="https://agentmods.dev/badge/skills/knitli/toolshed/context-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 771 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.00036 $0.00771
Opus 5.5 $0.00014 $0.00308
Sonnet 5.5 $0.00007 $0.00154
Haiku 4.5 $0.00004 $0.00077

Measured 3mo ago against content hash 7672d4c6da55, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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.

plugins/ctx/skills/context-hygiene/SKILL.md · 59 lines

How it starts

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

Context Hygiene

When working in this repository, be aware that AI context files (CLAUDE.md, AGENTS.md, Serena memories, Cursor rules, etc.) can become stale and contradictory. This skill helps you maintain context hygiene.

Known context file locations

The authoritative, plugin-wide list of known context files and locations lives at ${CLAUDE_PLUGIN_ROOT}/data/context-files.ini. Read that file when you need exact paths, globs, or to check whether a particular file is a recognized context file. It is the single source of truth and is updated as new ecosystems are added.

At a high level, the plugin recognizes these ecosystems:

  • Agent memory files: CLAUDE.md (Claude Code), AGENTS.md (universal), GEMINI.md (Gemini), CRUSH.md (Crush), .cursorrules / .cursor/rules/*.mdc (Cursor), .windsurfrules (Windsurf), .continuerules (Continue), .clinerules (Roo/Cline), .aider.conf.yml (Aider)
  • Tool directories: .claude/, .gemini/, .codex/, .cursor/, .continue/, .roo/, .serena/, .specify/, .github/agents/, .github/skills/
  • Planning / output: claudedocs/, specs/, plans/, planning/, info/
  • Config: .mcp.json, .vscode/mcp.json, .vscode/settings.json

This overview is for quick orientation. Do not rely on it for exact-match scanning — use the INI.

Rules for maintaining context hygiene

When you modify code

After making significant changes (renaming files, changing versions, restructuring modules, adding/removing dependencies), check whether any context files reference the things you changed. Update them if so.

Pay special attention to:

  • CLAUDE.md — often contains path references, version numbers, and structural descriptions
  • AGENTS.md — if it exists, likely shares content with CLAUDE.md or should be kept in sync
  • Tool-specific memories (Serena, spec-kit) — may have outdated snapshots of project state

When you read context files

Treat claims in context files with appropriate skepticism. Cross-reference against actual code before relying on:

  • Specific version numbers
  • File path references
  • Structural counts ("N crates", "N languages")
  • Architecture descriptions

Read the full file on GitHub · 59 lines

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. 3mo ago First seen · 59 lines · 36 tokens per session scan A 7672d4c6da55

Subscribe to this mod's changes

context-hygiene is a skill published in the GitHub repository knitli/toolshed (1 stars, last pushed 3d ago), licensed MIT. It adds 36 tokens to every session and 771 once invoked, about $0.0001 per session on Opus 5.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-31.

Related

context-hygiene compared with skills from other repositories

context-hygiene next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-hygieneknitli/toolshedSkill13d agoMITA36Claude Code
clarifyramboz/jigSkill66d agoMITA153Claude Code
explainramboz/jigSkill66d agoMITA173Claude Code
arch-reviewramboz/jigSkill66d agoMITA207Claude Code
security-reviewramboz/jigSkill66d agoMITA147Claude Code
pr-reviewramboz/jigSkill66d agoMITA183Claude Code
contractsramboz/jigSkill66d agoMITA163Claude Code