context-hygiene

context-hygiene is a skill for Claude Code, Codex 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 CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

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

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.

agentmods
npx agentmods add skills/knitli/toolshed/context-hygiene
Any agent
npx skills add knitli/toolshed --skill context-hygiene
Clone the repo
git clone --depth 1 https://github.com/knitli/toolshed

Made for: Claude Code, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00036 $0.00771
Opus 5 $0.00018 $0.00385
Sonnet 5 $0.00007 $0.00154
Haiku 4.5 $0.00004 $0.00077

Measured 3d ago against content hash 7672d4c6da55, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 4mo ago), licensed MIT. It adds 36 tokens to every session and 771 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

motherduck-build-cfa-app

Design a MotherDuck-backed customer-facing analytics app. Use for embedded analytics, multi-tenant SaaS reporting, or product analytics for external users -- whenever the decision depends on per-customer isolation, backend routing, service-account boundaries, read scaling, or Hypertenancy-style patterns.

motherduckdb/agent-skills · 63 tokens

motherduck-build-dashboard

Build a live MotherDuck dashboard as a Dive. Use when composing one shareable KPI, trend, and breakdown story over existing MotherDuck data, especially when the result should stay a saved workspace artifact rather than a full application.

motherduckdb/agent-skills · 50 tokens

motherduck-build-data-pipeline

Design an end-to-end MotherDuck data pipeline. Use for ETL/ELT workflows -- choosing raw, staging, and analytics boundaries, bulk ingestion paths, transformation sequencing, dlt/dbt integration, publication targets, or whether DuckLake is actually required.

motherduckdb/agent-skills · 59 tokens

motherduck-connect

Connect to MotherDuck from any application. Use when setting up database connectivity via the Postgres endpoint (recommended), pgduckdb, native DuckDB API, or JDBC. Covers connection strings, authentication, SSL, and environment variable configuration.

motherduckdb/agent-skills · 52 tokens

motherduck-create-dive

Create, edit, manage, share, or embed MotherDuck Dives — live React + SQL dashboards, charts, and data apps saved in the workspace. Use for any dashboard, chart, KPI display, or data visualization over MotherDuck data, and for Dive authoring mechanics such as getdiveguide, useSQLQuery, local preview, version history…

motherduckdb/agent-skills · 95 tokens

motherduck-create-flight

Create, schedule, run, and debug MotherDuck Flights — Python jobs that run on MotherDuck compute. Use whenever someone wants to create a flight, schedule a Python script or recurring job on MotherDuck, set up scheduled ingestion from Postgres, dlt sources, S3, BigQuery, Snowflake, or APIs, refresh aggregates or…

motherduckdb/agent-skills · 106 tokens