Context Firewall

A workflow for processing large files, logs, documents, images, or tool outputs through smaller helper tasks before producing a final answer. It returns compact claims with evidence locations, such as line numbers.

In plain words
What is it for?
Analyzing large logs, summarizing big files, scanning repositories, processing long outputs, and checking claims against referenced evidence.
Why use it?
It reduces the chance that a large input overwhelms the available conversation space. It also makes summaries easier to audit by linking claims to source snippets.

Skill for Claude CodeCodex

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/lollipopkit/cc-plugins/context-firewall
Any agent
npx skills add lollipopkit/cc-plugins --skill context-firewall
Clone the repo
git clone --depth 1 https://github.com/lollipopkit/cc-plugins

Made for: Claude Code, Codex.

Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 948 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.00102 $0.00948
Opus 5 $0.00051 $0.00474
Sonnet 5 $0.00020 $0.00190
Haiku 4.5 $0.00010 $0.00095

Measured 2d ago against content hash 4fe311097fc0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Context Firewall 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 2d 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/context-firewall/skills/context-firewall/SKILL.md · 131 lines

How it starts

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

Implement a Context Firewall workflow to prevent the master context from being flooded by large inputs.

Purpose

Route large inputs (big files, logs, PDFs/images, long MCP/tool outputs) through sub-agents that produce compressed, auditable results. Only pass back:

  • Structured claims
  • Evidence locators (line/symbol/tool-call)
  • Coverage statements

When to use

Prefer this workflow when any of the following is true:

  • The user wants the "full" content of a large file/log/document.
  • Tool output is long/noisy (search results, crawls, API responses).
  • The task needs multi-file scanning or cross-file synthesis.
  • The output must be verifiable without re-reading everything.

Core contract (Evidence Contract)

For every meaningful claim:

  • Attach at least one evidence item.
  • Use a locator that enables low-cost verification.

Locator preference order:

  1. line_range (default)
  2. symbol_range (functions/classes)
  3. tool_call (tool-derived facts; include args hash and rerun hint when safe)
  4. byte_range/json_path/stack_signature (define, but treat as harder to verify in v1)

Keep quotes short:

  • Respect the quote_max_chars constraint.
  • Never paste large raw blobs.

1) Generate TaskSpec

Create a TaskSpec.v1 that is explicit about:

  • Objective
  • Inputs (files/tool calls)
  • Questions
  • must_cover checklist
  • Constraints (budget + evidence requirements)
  • Risk level

Prefer using the command:

  • /cf-spec to generate a schema-valid template.

2) Run Map-Reduce preprocessing

Use /cf-run to:

  • Split inputs into shards
  • Run cf-fileworker on each shard in parallel
  • Merge with cf-aggregator into a final SubResult.v1

Hard requirements for sub-agents:

  • Output strict JSON only (no markdown fences, no extra commentary).
  • Ensure every claim includes evidence.

3) Verify cheaply

Use /cf-verify to sample-check claims:

  • Choose sampling rate by risk_level.
  • Re-read only the referenced snippets.
  • Produce VerifyReport.v1.

Read the full file on GitHub · 131 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. 2d ago First seen · 131 lines · 102 tokens per session scan A 4fe311097fc0

Subscribe to this mod's changes

Context Firewall is a skill published in the GitHub repository lollipopkit/cc-plugins (7 stars, last pushed 5mo ago), licensed MIT. It adds 102 tokens to every session and 948 once invoked, about $0.0005 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

modelchk

Size a task's run before spending it: the cheapest sufficient capability tier (fast, standard, frontier) and the reasoning effort within it, on a neutral scale that binds to whatever levels the model exposes. Use when work seems over- or under-powered, costly, ambiguous, or high-risk, or asks which model class and how…

LilMGenius/paperthin · 74 tokens

re0-loop

Run repeated build -> QA -> re0-memo -> re0-work cycles while preserving learning and letting code die. Use for long agentic projects where progress must be measured by quality-cleared templates, reusable modules, and eliminated anti-patterns rather than hours spent or features accumulated.

LilMGenius/paperthin · 60 tokens

autobahn

Carve guardrail-adjacent items out of scope with safe alternatives before risk-adjacent work starts, then run the safe remainder at full strength in a fresh subagent that only ever sees the carved prompt, never the risky input. Use when a task includes stealth, scraping, privacy, IP, policy, licensing, security, or…

LilMGenius/paperthin · 129 tokens

re0-release

Walk a pending change through this repo's shipping and releasing checklist end to end, then tag and publish once confirmed. User-invoked: run it when you've decided to ship.

LilMGenius/paperthin · 40 tokens

ssotize

Audit and consolidate a fact that's scattered across places into one canonical source, after approval, and replace the rest with references. Use when asked to find duplication, check consistency, locate the source of truth, deduplicate, consolidate, unify, or establish SSOT across artifacts or platforms. Starts…

LilMGenius/paperthin · 78 tokens

re0-plan

Open a paperthin iteration's casebook before re0-loop's first turn — seeded with real content the moment the folder exists, never an empty directory. User-invoked, paperthin-only: assumes the full skill package installed. Run when opening a new build cycle in this repo.

LilMGenius/paperthin · 62 tokens