Code-mapper: Free CLI tool to reduce LLM token usage on any codebases
Code-mapper is a new CLI tool designed to significantly reduce token usage when working with large codebases. By generating a compact PROJECT_CONTEXT.md file, it allows LLMs to understand the project's architecture more efficiently. The tool can reduce token costs by up to 78%, making it a valuable resource for developers.
- ▪Code-mapper generates a PROJECT_CONTEXT.md that captures a codebase's architecture in approximately 4,700 tokens.
- ▪The tool can analyze projects of various sizes, achieving token savings of up to 85% for smaller projects.
- ▪It supports multiple programming languages and is designed to work with Python 3.9 and above.
Opening excerpt (first ~120 words) tap to expand
code-mapper Generate a compact PROJECT_CONTEXT.md so LLMs understand your codebase in one read — not fifty. When an LLM opens a project it doesn't know, it reads file after file to build a mental model. On a 4,000-line project that costs ~21,000 tokens before a single line of code is written. code-mapper replaces that scan with a single structured file that captures the same architectural picture in ~4,700 tokens — a 78% reduction. $ python code_mapper.py ./my-project ✓ Generated: my-project/PROJECT_CONTEXT.md Files analyzed : 40 (python×40) Classes : 20 | Functions: 123 Output size : 18,846 chars (~4,711 tokens) Source lines : ~4,210 (~21,050 tokens to read raw) Token savings : ~78% What it generates A single PROJECT_CONTEXT.md with four sections: File Structure my-project/ ├── src/ ├──…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.