Story

Show HN: Badge that shows how well your codebase fits in an LLM's context window

jimminyx Friday, February 27, 2026

Small codebases were always a good thing. With coding agents, there's now a huge advantage to having a codebase small enough that an agent can hold the full thing in context.

Repo Tokens is a GitHub Action that counts your codebase's size in tokens (using tiktoken) and updates a badge in your README. The badge color reflects what percentage of an LLM's context window the codebase fills: green for under 30%, yellow for 50-70%, red for 70%+. Context window size is configurable and defaults to 200k (size of Claude models).

It's a composite action. Installs tiktoken, runs ~60 lines of inline Python, takes about 10 seconds. The action updates the README but doesn't commit, so your workflow controls the git strategy.

The idea is to make token size a visible metric, like bundle size badges for JS libraries. Hopefully a small nudge to keep codebases lean and agent-friendly.

GitHub: https://github.com/qwibitai/nanoclaw/tree/main/repo-tokens

Summary
The article discusses the use of repo tokens, a new type of cryptocurrency, in the Nanoclaw project. It highlights the features and potential applications of repo tokens in creating a decentralized financial ecosystem.
39 23
Summary
github.com
Visit article Read on Hacker News Comments 23