u/Hopeful_Candle4413

▲ 2 r/ContextEngineering+1 crossposts

Problem: A 4,200-line project costs ~21,050 tokens just to explain the architecture. That's a lot of money for boilerplate context.
Solution: I wrote code-mapper, a free, open-source Python CLI that auto-generates a compact PROJECT_CONTEXT.md file — your codebase's architecture card for LLMs.
What it does:

  1. Analyzes your codebase (Python exact via AST; TypeScript/JS, Java, Go, Rust, C#, Ruby via smart regex)
  2. Generates a single structured file containing:
       - Clean file tree
       - Mermaid class diagrams
       - Mermaid dependency graph
       - Ranked symbol index
    Result: The same 4,200-line project compresses to 4,711 tokens. That's 78% savings per request.

The project is open source and free to use by anyone. Feel free to edit it and make cahnges.

Code and full docs on GitHub damien220/code-mapper: Generate a compact PROJECT_CONTEXT.md so LLMs understand your codebase in one read — not fifty.

reddit.com
u/Hopeful_Candle4413 — 15 days ago