{"slug": "i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window", "title": "I built a CLI that tells you if your codebase fits an LLM's context window", "summary": "A developer built Tokenazire, a CLI tool that scans local folders or GitHub repos and counts tokens per file using tiktoken to determine if a codebase fits an LLM's context window. It provides a color-coded breakdown and an --export flag to bundle the project into a single text file for easy pasting into LLM chats.", "body_md": "Every time I wanted to paste a whole project into Claude or ChatGPT, I ended up guessing whether it would even fit — and often found out the hard way, mid-conversation, that it didn't.\n\nSo I built Tokenazire, a small CLI tool that solves exactly that.\n\nWhat it does\n\nScans a local folder or a GitHub repo (just pass the URL, it clones it for you)\n\nCounts tokens per file using tiktoken (the same tokenizer OpenAI models use, a solid approximation across most LLMs)\n\nShows a color-coded breakdown (green → yellow → orange → red) so you instantly see which files are \"heavy\"\n\nCalculates what percentage of a model's context window (default 200k, configurable) your whole project takes up\n\nIgnores .git, venv, node_modules, and other noise automatically\n\nHas an --export flag that bundles the entire project — folder structure plus every file's content — into a single text file, ready to paste straight into an LLM chat\n\nI kept hitting the same annoying loop: copy a project into a chat, get cut off or told the input's too long, then manually trim files and try again. This automates the \"will it fit, and if not, what's taking up the most space\" question up front.\n\nThe --export step came later — once I knew what would fit, I still had to manually copy-paste files one by one into the chat. Now it just spits out one clean file with a project tree on top and clearly separated file contents, ready to paste.\n\nTech stack\n\nPlain Python, tiktoken for tokenization, rich for the terminal output (tables, colors, progress bar). No config files, no external services beyond git for cloning.\n\nTry it\n\nRepo: [https://github.com/DeKlain4ik/token-counter](https://github.com/DeKlain4ik/token-counter) (MIT licensed)\n\nStill early — feedback, issues, and PRs are welcome.", "url": "https://wpnews.pro/news/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window", "canonical_source": "https://dev.to/deklain4ik/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llms-context-window-164d", "published_at": "2026-07-25 21:19:20+00:00", "updated_at": "2026-07-25 21:30:37.120625+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "artificial-intelligence"], "entities": ["Tokenazire", "OpenAI", "Claude", "ChatGPT", "DeKlain4ik"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window", "markdown": "https://wpnews.pro/news/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window.md", "text": "https://wpnews.pro/news/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window.txt", "jsonld": "https://wpnews.pro/news/i-built-a-cli-that-tells-you-if-your-codebase-fits-an-llm-s-context-window.jsonld"}}