cd /news/developer-tools/i-built-a-cli-that-tells-you-if-your… · home topics developer-tools article
[ARTICLE · art-73707] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I built a CLI that tells you if your codebase fits an LLM's context window

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.

read1 min views1 publishedJul 25, 2026

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.

So I built Tokenazire, a small CLI tool that solves exactly that.

What it does

Scans a local folder or a GitHub repo (just pass the URL, it clones it for you)

Counts tokens per file using tiktoken (the same tokenizer OpenAI models use, a solid approximation across most LLMs)

Shows a color-coded breakdown (green → yellow → orange → red) so you instantly see which files are "heavy"

Calculates what percentage of a model's context window (default 200k, configurable) your whole project takes up

Ignores .git, venv, node_modules, and other noise automatically

Has 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

I 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.

The --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.

Tech stack

Plain Python, tiktoken for tokenization, rich for the terminal output (tables, colors, progress bar). No config files, no external services beyond git for cloning.

Try it

Repo: [https://github.com/DeKlain4ik/token-counter](https://github.com/DeKlain4ik/token-counter) (MIT licensed)

Still early — feedback, issues, and PRs are welcome.

── more in #developer-tools 4 stories · sorted by recency
── more on @tokenazire 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-cli-that-t…] indexed:0 read:1min 2026-07-25 ·