ContextMap
bundlephobia for your AI context window — see exactly what's eating your tokens
npx -y github:Isco0819/context-mapEver run into this?
Like bundlephobia (millions of monthly visits, repeated HN/PH front-page, massive X traction) which shows npm package size impact before you install, there is no equivalent for AI context windows. Devs blindly stuff system prompts with tool definitions, memory dumps, and few-shot examples without knowing which sections consume the most tokens. Silent truncation and runaway costs follow.
The fix
npx CLI that reads any prompt file or stdin, tokenizes each section locally with tiktoken (free, zero API key), and renders a sorted bar-chart breakdown so you can find and cut the fat before the LLM ever sees it.
What it does
- section-by-section token count split on markdown headings or double-newline boundaries
- redundancy detector — flags sections where >40% of bigrams duplicate another section in yellow
- --threshold N exits nonzero when total tokens exceed N, making it CI-pipeline-ready