code-map
🇰🇷 한국어로 읽으시려면 → README.ko.md · 🇬🇧 English below.
Hand your AI agent the exact slice of code it needs — by coordinate, not by guessing.
좌표만 정밀하게. 의미는 LLM이 raw를 보고 매번 새로 판정한다.

Sound familiar? 😅
Your agent needs to read createMessage. So it greps — and gets 40 hits across
providers. It opens whole files to find the right one, burning tokens on code it won't
use. Next turn it "remembers" the function was at line 120 — but your last edit pushed it
to 138, so it reads the wrong lines and never notices. 😱
With code-map riding along, the agent just:
read({ refs: ["anthropic.ts#createMessage", "openai.ts#createMessage"] })
→ both exact slices, one call, still correct even after the file moved.
grep still does the finding — it's great at that. code-map does the reading:
small, exact, drift-proof. That's the whole idea.
What you get — measured, not promised
| |
|---|
| 🎯 Never silently wrong | After heavy edits with no re-index, read re-anchors on the signature line: 0 silently-wrong bytes (a naive "line number" cache is ~100% wrong). It returns the right code or tells you it can't — never the wrong bytes. |
| ⚡ Fewer tokens, fewer steps | Direct known-ref run (GPT-5.6 Sol, pass@30, 180 tasks, forced real-rg baseline): −22.4% effective input, −26.3% raw input, −14.7% time, −67.9% calls, with semantic correctness tied. A newer paired n=10 multi-stage pilot measured −31.8% effective / −40.4% raw input, −14.7% time, and −74.6% calls across 240 scored stages; pass@30 confirmation is pending. |
| 🧭 Routing is the lever | Agents won't reach for read on their own (~17%). The bundled plugin/skill makes them: it flips discovery from a loss to −31% by killing the double-call, and turns vague usage (erratic, +61% worse on one task) into a steady win — 30/30 pass. |
| 🧩 Tiny & drop-in | Node + one installed runtime dependency (oxc-parser), no manual build step. TS/JS and Python. MCP server + a one-line skill — install for Claude, Codex, grok, or Antigravity. |
Honest about the edges (this repo's whole point): code-map does not beat grep at
searching — it ties, so keep grepping. And it's not a universal token-saver — the win
is large for reading known symbols with routing, but model/task-dependent (an older
Sonnet/Opus isolated read was ~0 or worse; GPT-5.6 Sol known-single is now −20% effective),
and a loss on raw discovery unless the skill routes it. Every number, every retraction, the
model/metric caveats, and a one-command verifier:
code-map-bench.
TL;DR — grep finds, read reads.
Release status: 0.9.0-rc.1 is the public release candidate. The core is ready for
real projects; the RC label leaves room to harden installation reports before freezing 1.0.
Package compatibility