Agent Code Map

Free. One file. Works with Claude Code, Codex, Cursor and opencode.

Your AI reads too much.
Give it a map.

Put one file in your project folder and type one line. From then on your coding AI reads a small map of your code instead of whole files. Same answers, up to 97% less reading, and a smaller bill every month.

The map holds three things: every file, every function with its line number, and who calls what.

Three steps. The first two take a minute.

You do not need to install anything or make an account. Nothing leaves your computer.

  1. 1

    Put one file in your folder.

    Download codemap.py from GitHub and drop it into the folder your project lives in. That is the entire install.

  2. 2

    Type one line.

    python codemap.py .

    About a second later there is a small map of your code: what is in each file, and which function calls which. It redraws itself whenever your code changes.

  3. 3

    Your AI reads the map, not the whole book.

    Claude Code, Codex, Cursor and opencode should find the map by themselves, or just tell them to read and execute AGENTS.md, which is created in the root folder.

A map is a lot smaller than the book.

AI companies charge for every word the AI reads, counted in tokens. A token is roughly three quarters of a word. Fewer tokens read, smaller bill. Here is one real question, answered two ways.

The question: What is in app.js? It is a 7,000-line file in a real 228-file app.

Without the map

The AI opens the whole file and reads all 7,000 lines.

104,625tokens read

With the map

The AI asks the map and gets one line per function: name, kind, line number.

4,091tokens read

96% less

Another one. How is readFrontmatter connected to match? Without the map the AI reads two whole files: 135,769 tokens. The map answers in 16.

What it saved on four real projects.

One normal working session each: find a thing, see who uses it, look inside a file, connect two functions. Same questions, with and without the map. Counted on 21 October 2026.

Tokens read without the mapTokens read with the mapBars are to scale. Shorter is better.

The saving is the same on every model. The same 133-file project counted with four different tokenizers saves 68 to 69 percent each time. What differs between models is only the price per token, which is what the next section is about. Full method in the benchmark report.

Your bill, roughly.

Pick the model you use and how many lookup sessions a day your agents run. The figures use the 133-file project above and each model's list price for input. A bigger codebase or a chattier agent will save more.

Monthly saving30 days, input tokens only
Without the map$0
With the map$0
You keep$0

With scripts off: at 20 sessions a day on Claude Fable 5.1 the map keeps about $159 a month; on GLM-5.3 about $22.

Questions people ask.

Does it send my code anywhere?

No. It is one Python file with no dependencies, no AI inside it and no network calls. It reads your code on your machine and writes the map next to it. You can read the whole file before you run it.

What does it actually write?

A folder called codemap-out with a two-page overview, an index of every function with its line number, and the graph of who calls what. Plus a short note in AGENTS.md so your AI knows the map exists. Commit the folder or ignore it; both work.

Which languages and which AIs?

Python, JavaScript, TypeScript, PHP, SQL and HTML properly; Java, C#, Go, Ruby, Rust, C and C++ at a lighter level. Any AI that reads AGENTS.md picks it up: Claude Code, Codex, Cursor, opencode and most others.

Does the map go stale when I change code?

No. Every time the map is asked something it checks whether files changed and redraws only those, usually in well under a second. There is also a watch mode and optional git hooks.

Where does it not help?

Searching for a literal piece of text, like an error message, still goes through normal search; the map does not store text. On tiny projects under about 30 files the saving is small because there was not much to read anyway. One flat scraper script in the benchmark saved only 28 percent. The map pays most where files are big and connected.

How were the numbers made?

Real command output and real file text, counted with each model's tokenizer, with no AI calls. Anthropic's tokenizer is not public, so Claude is counted with the usual stand-in. The dollar figures are tokens read times the list price for input, nothing else, so a real bill is lower in dollars and the same in proportion. Every price carries its source and the date it was checked in site/data.json.

Give your AI a map.

Free and open source. One file, one line, and your AI stops reading the whole book. If it trims your bill, buy me a coffee.