context-police

Audit, curate, and measure the token cost of an agent harness's always-on skills catalog.

1|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill context-police-wan-huiyan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-police
Source: https://github.com/wan-huiyan/claude-ecosystem-hygiene/tree/main/plugins/context-police
Command: npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill context-police-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Agent harnesses inject the full skills/tools catalog (names + descriptions) into context every turn and into every subagent, so an auto-minted catalog of hundreds of skills multiplies token cost on fan-out and can overflow small-context agents entirely. Over-cap descriptions are silently truncated mid-word, killing trigger phrases with no warning. ## Core Features & Use Cases - Catalog audit and curation methodology: Classify skills by description intent (episodic traps vs real procedures), apply conservative asymmetric bias, and use levers like skillOverrides, disable-model-invocation, and the native skillListingBudgetFraction/skillListingMaxDescChars budget across Claude Code, Cursor, Codex, Copilot CLI, and Gemini CLI. - Publish-time description gate: scripts/check_skill_descriptions.py fails CI when a SKILL.md description exceeds the 1536-char cap, lists trigger phrases lost to truncation, detects line-wrap corruption, and diffs trigger surfaces between revisions with --compare. - Measurement and reporting: Measure per-turn and per-subagent catalog overhead via /doctor and cache-token analysis, then render an interactive HTML recap of a skillOverrides treatment with scripts/render_treatment_report.py. - Use Case: A team running an auto-skill-minting loop finds subagents carrying ~30k tokens of base context; use this skill to hide episodic trap lessons globally, scope irrelevant skills per-project, and gate all published descriptions against the cap. ## Quick Start Ask the agent to audit your skills catalog for context cost and run scripts/check_skill_descriptions.py against your skills directory to find over-cap descriptions and dead trigger phrases.

Frequently Asked Questions about context-police

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce the token cost of a large Claude Code skills catalog?

Use skillOverrides in the project's .claude/settings.json to hide irrelevant skills per-project, and set disable-model-invocation: true in SKILL.md frontmatter to remove episodic trap skills from the global model-invocable catalog while keeping them /name-invocable. Verify the result with /doctor.

How do I check if a SKILL.md description exceeds the Claude Code length cap?

Run scripts/check_skill_descriptions.py against your skills directory; it fails with exit 1 when any description exceeds the 1536-character skillListingMaxDescChars cap. Add --triggers to list the quoted trigger phrases that truncation makes invisible to the model.

Does this skills-catalog curation approach work outside Claude Code?

Yes, the methodology is harness-agnostic since the Agent Skills standard is shared by Claude Code, Cursor, Codex, Copilot CLI, and Gemini CLI. The disable-model-invocation flag works verbatim on Cursor and Copilot CLI, while Codex uses allow_implicit_invocation:false and Gemini CLI uses /skills disable.

Why did my skill stop firing on its documented trigger phrases?

The harness truncates over-cap descriptions at character 1535 mid-word, so every trigger phrase past that point is dead with no warning. Run the gate with --triggers to see which phrases are lost, then trim synonym runs and prose while keeping every distinct trigger concept.

Can a retrieval hook replace force-loading trap lessons in the catalog?

No. The bundled pilot harness shows both keyword BM25 and semantic embedding gates hit a base-rate wall with precision-when-firing under 0.5% at any usable recall, because genuine trap moments are only about 0.1% of triggers. Curation plus grep-lessons-on-task-start discipline is the working lever.

When should I not restore a skill that has disable-model-invocation set?

Do not restore it when the skill is a user slash-command, identifiable by argument-hint or allowed-tools in the frontmatter, because the flag is the correct configuration that stops the model from auto-firing the command. Restoring commands re-bloats the catalog and changes model behavior.