Context Broker — AI skill for Claude Code
Cut Claude Code token usage 80-95% on big-file reads.
How to install Context Broker
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anzal1/context-broker and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Context Broker does
Cut Claude Code token usage 80-95% on big-file reads. Deterministic, ~1ms, zero egress — no second LLM.
Alternatives in AI
- Surface — Show ranked attack surface for a target from its recon manifest + hunt memory 3.8k ★
- Jcodemunch MCP — Cut AI token costs 95%+ on code exploration 2.6k ★
- TokenTracker — Local-first AI token usage & cost tracker for 31 coding tools incl 1.4k ★
README
context-broker
**Cut Claude Code's token bill on big-file reads by 80–95% — with zero fidelity loss, zero latency, and zero data egress.**
When Claude reads a 2,000-line file to answer one question, you pay for 2,000 lines. Spotify's [Portal/shunt](https://engineering.atspotify.com/2026/9/portal-by-spotify-cut-my-claude-code-token-usage-by-90) attacks this by routing reads through a cheaper LLM that summarizes the file — which works, but costs 10–30 seconds per read, ships your source to a second model vendor, and returns lossy summaries (their own writeup admits the worker missed a thread-safety bug).
context-broker takes a different bet: **most of what Claude needs from a big file is its structure, and structure can be extracted deterministically.** No second model. Nothing leaves your machine. ~1 millisecond.
| Portal / shunt | context-broker | |
|---|---|---|
| Mechanism | second LLM summarizes | structural extraction — no model |
| Latency | 10–30 s per delegation | ~1 ms per interception |
| Fidelity | lossy summary | verbatim source lines, real line numbers |
| Data egress | code sent to a second vendor | zero |
| Read → edit | re-read the whole file to edit | skeleton keeps line numbers → ranged read of just the slice |
| Savings | ~90 % on bulk reads | 80–95 % per intercepted file |
How it works
A `PreToolUse` hook intercepts Claude Code's `Read` tool:
- File ≤ 350 lines, binary, image/PDF/notebook, or a ranged read (
offset/limit) → passes through untouched. - Otherwise the full read is denied — but the denial contains the answer: the file's exact skeleton (imports, signatures, types, doc comments — verbatim source lines with real line numbers). Claude gets the structure instantly and expands only the bodies it needs via ranged reads, which always pass through.
- Any error, anywhere → fail open. The hook can never break
Read.
Because the skeleton keeps real line numbers, the read→edit path Portal can't han
Related Skills
Claude Code Flash
Cut Claude Code token usage: hooks, Sonnet/Opus subagents, orchestration rules and /review + /task commands th
Smart Context Delegation
Cut coding-agent token usage by ~90%: a PreToolUse hook blocks large file reads; bulk-read/code-write delegate
Spread Your Claudes
Offload your coding agent's big-context reads to other AI CLIs (Gemini, Cursor, Codex, paid Gemini web app) so
Token Save MCP
Stop your coding agent burning context on file reads. Delegates big reads to a cheap worker model and returns
Devcontainer Airlock
Secure, layered devcontainers for AI coding agents: the agents work in a workbench with no GitHub token and no
Ham
(HAM) Memory system for AI coding agents. Cut token usage by 80% by scoping context to directories.
Related Agents
AI Cost Optimizer
Audits an LLM application or AI agent for token cost and rate-limit risk, using its usage logs and code, and r
LLM Performance Analyst
Evaluates LLM agent performance from session transcripts — token usage, tool-call efficiency, and error patter
Hva Desk
The HVA Desk — reads Meta insights by impression volume, runs the deterministic CLEAR scorer, and converts the