context-broker
Answers big-file reads with an exact skeleton: 80 to 95% fewer tokens, no second model
- Area
- Developer tools
- Language
- C++
- License
- MIT
- Plate
- No. 11 of 14
context-broker is a Claude Code hook that intercepts reads of large files and answers with the file's exact structure instead: imports, signatures and types as verbatim lines with real line numbers. It takes about a millisecond, runs entirely on your machine and sends nothing to another model. The agent then reads only the slices it needs by line range, so reading and editing a big file costs a fraction of a full read.
How it works
- 01
A PreToolUse hook catches Read calls on files over 350 lines; small files, binaries, images and ranged reads pass straight through.
- 02
The denial carries the answer: the file's skeleton, extracted by hand-rolled structural matchers for TypeScript, Python, Go, Rust, Java and more.
- 03
The agent expands only the bodies it needs with ranged reads, which are never intercepted.
What it does
- Verbatim source lines with real line numbers, so a skeleton can be incomplete but never wrong
- Ranged reads always pass through, so the read-then-edit path needs no second full read
- Fails open on any error, so the hook can never break a read
- cb bench measures savings across your repo before you install, with no model calls
- Also a CLI: skeleton, ranged read, log folding for noisy build output, and a running savings ledger
More from the bench
All projectsQuicky Wiki
Turn a pile of documents into a knowledge base that scores how sure it is
voila
Paste a URL, get a narrated, zoom-animated demo video made entirely on your machine
faultline
A live architecture map that stops agents crossing the boundaries you drew