mcpField
C
cco-shield

cco-shield

github.com/egorfedorovAgent workflows125191 installsUpdated 1d ago
Repository

About cco-shield

cco-shield is a Claude skill that reports ContextShield protection status and historical context waste patterns. It can suggest `.contextignore` entries for repeatedly wasteful file reads and apply them while avoiding duplicates.

Key features

  1. 01Report protection status
  2. 02Show files with repeated waste
  3. 03Estimate tokens saved
  4. 04Group files often edited together
  5. 05Suggest `.contextignore` patterns
  6. 06Apply patterns without duplicates

Use cases

  1. 01Review ContextShield status and usage patterns
  2. 02Identify files repeatedly read without benefit
  3. 03Preview ignore rules based on session history
  4. 04Add suggested rules to `.contextignore`

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/egorfedorov/claude-context-optimizer --skill cco-shield

After installing, type/cco-shieldin Claude Code to confirm it loaded.

Details

From the project README

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.

Comments

Markdown supported