cap-shield

cap-shield is a skill for Claude Code from robinlidberg-dot/cap-shield-mcp. It costs 77 tokens per session (4,148 once invoked), scanned A, original, MIT.

A context-management skill for AI agents. It measures which information an agent receives, removes unnecessary material, and compresses data sent between systems.

In plain words
What is it for?
Use it when an agent's context is too large, retrieval quality is poor, token cost matters, or machine-to-machine messages should be compressed and checked.
Why use it?
Large amounts of context can hide important details, reduce answer quality, and increase processing cost. This helps identify whether missing or excessive information is causing failures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the cap-shield plugin — 2 skills, 1 MCP server shipped together

Good fit Use it when an agent's context is too large, retrieval quality is poor, token cost matters, or machine-to-machine messages should be compressed and checked.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/robinlidberg-dot/cap-shield-mcp/cap-shield
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.

Any agent
npx skills add robinlidberg-dot/cap-shield-mcp --skill cap-shield
Clone the repo
git clone --depth 1 https://github.com/robinlidberg-dot/cap-shield-mcp

Made for: Claude Code.

Or install cap-shield, the plugin that ships this one along with the rest of its 2 skills, 1 MCP server.

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 cap-shield

README.md
[![agentmods](https://agentmods.dev/badge/skills/robinlidberg-dot/cap-shield-mcp/cap-shield/github.svg)](https://agentmods.dev/skills/robinlidberg-dot/cap-shield-mcp/cap-shield)
Your own site
<a href="https://agentmods.dev/skills/robinlidberg-dot/cap-shield-mcp/cap-shield"><img src="https://agentmods.dev/badge/skills/robinlidberg-dot/cap-shield-mcp/cap-shield/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 cap-shield

Your own site · 80×15
<a href="https://agentmods.dev/skills/robinlidberg-dot/cap-shield-mcp/cap-shield"><img src="https://agentmods.dev/badge/skills/robinlidberg-dot/cap-shield-mcp/cap-shield.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,148 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00077 $0.04148
Opus 5.5 $0.00031 $0.01659
Sonnet 5.5 $0.00015 $0.00830
Haiku 4.5 $0.00008 $0.00415

Measured 3d ago against content hash fbcf1946af21, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cap-shield scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -O https://cap-shield-robin.fly.dev/cap_mcp.py
skills/cap-shield/SKILL.md · 404 lines

How it starts

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

CAP-Shield

Selects what goes into an agent's context, and compresses what goes over the wire. The difference from other context tools is that the recall is measured, not asserted.

When this matters

Reach for this when any of these are true:

  • An agent gets worse as the conversation grows, and the failures look like missing information rather than bad reasoning
  • Context is assembled by "include everything relevant, just in case"
  • Someone asks what a large context is costing
  • Structured machine-to-machine traffic is being sent uncompressed

The counter-intuitive part: more context makes agents worse. ETH Zurich found context files LOWER task success versus giving the agent no repository context at all, while raising inference cost by over 20 %. Around two thirds of production agent failures trace to context problems, not to the model being incapable.

So cutting context is not only a cost optimisation. It is a correctness fix, and that is the reason to do it.

Do not use this for

  • Short conversations that fit comfortably in the budget. Below roughly 2 000 tokens there is nothing to leave out, and the saving would be zero for reasons that have nothing to do with how well selection works.
  • Free prose where every sentence is load-bearing.
  • Compressing single short messages. Below roughly 100 bytes, the packet header and authenticated encryption cost more than compression saves. Batch instead.
  • Repeated tool-schema or system-prompt overhead across calls in the same session. That is a caching problem, not a selection problem — the provider's own prompt caching is what solves it. CAP-Shield does not touch it.

Say so plainly when one of these applies rather than reporting a small number as if it were a result.

Measure first, always

Never state what CAP-Shield will save. Measure it on the actual traffic and report what comes back — including the parts that look bad.

pip install cap-shield
from cap_shield import measure, print_measurement

print_measurement(measure(
    texts=[...the actual messages...],
    query="what the agent would search for",
))

Read the full file on GitHub · 404 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 Changed · +34 lines fbcf1946af21
  2. 11d ago First seen · 370 lines · 77 tokens per session scan A 7962c4891f4b

Subscribe to this mod's changes

cap-shield is a skill published in the GitHub repository robinlidberg-dot/cap-shield-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 77 tokens to every session and 4,148 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-19.

Related

cap-shield compared with skills from other repositories

cap-shield next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cap-shieldrobinlidberg-dot/cap-shield-mcpSkill0yesterdayMITA77Claude Code
meta-harnessstanford-iris-lab/meta-harnessSkill1.8kyesterdayMITA27Claude Code
memoryXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A17Claude Code, Codex
cross-channel-history-retrievalXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A114Claude Code
dynamic-memory-cliXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A78Codex
llm-wikiXiaoLuoLYG/GODSkill1.3k5d agoApache-2.0A62Claude Code, Codex
prolongalexisfox7/PRO-LONGSkill46527d agoMITA55Codex