anzal1

Context Broker — AI skill for Claude Code

AI community

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:

  1. File ≤ 350 lines, binary, image/PDF/notebook, or a ranged read (offset/limit) → passes through untouched.
  2. 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.
  3. 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