egorfedorov

cco-shield

Show ContextShield status and waste protection stats; suggest or apply .contextignore rules from historical waste

egorfedorov 102 10 Updated 2mo ago
GitHub

Install

npx skillscat add egorfedorov/claude-context-optimizer/cco-shield

Install via the SkillsCat registry.

About this skill

We need to produce a 2-3 sentence plain-text summary, objective, factual, no marketing, no superlatives, no calls to action. Must be at most 60 words. No quotes, no markdown, no bullet points, no headings. Just plain text. Summarize: skill shows ContextShield status and waste protection stats; suggests or applies .contextignore rules from historical waste. Problem: prevents reading unnecessary files, reduces token waste, learns patterns. When to use: when you want to see protection status, get suggestions for ignoring files, or apply those rules to avoid repeated waste.

SKILL.md

ContextShield Status

Show the user the current ContextShield protection status and historical waste prevention stats.

Subcommands

If the user asked for suggestions (/cco-shield suggest) or to apply them
(/cco-shield apply), run instead:

node ${CLAUDE_PLUGIN_ROOT}/src/context-shield.js suggest   # preview .contextignore candidates
node ${CLAUDE_PLUGIN_ROOT}/src/context-shield.js apply     # append them to ./.contextignore

suggest lists files wasted in 3+ sessions as ready-to-use .contextignore
patterns with per-session token savings. apply appends them (deduped against
existing rules) so those reads are blocked permanently. Show the output as-is.

Status report (default)

Run the following command to get pattern data:

node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js patterns

From the patterns data, present:

  1. ContextShield Status: Active (it's always active as a PreToolUse hook)
  2. Protected Files: List files with 3+ waste sessions — these trigger warnings before Read
  3. Tokens Saved: Estimate based on waste history (files that would have been read without shield)
  4. Co-occurrence Groups: Files that are usually edited together

Format as a clean status report. If no pattern data exists yet, tell the user:
"ContextShield is warming up! It learns from your usage patterns and will start giving you smart suggestions after a few sessions."

End the report with:

ContextShield runs automatically on every Read. No configuration needed.