{"by":"jimminyx","descendants":41,"id":47181471,"kids":[47182816,47181862,47183264,47183086,47260557,47182515,47184342,47183117,47183365,47181788,47183943,47182073,47181866,47181812,47182120,47181819,47184521,47182290,47181668,47205398,47185011,47181968,47181971],"score":88,"text":"Small codebases were always a good thing. With coding agents, there&#x27;s now a huge advantage to having a codebase small enough that an agent can hold the full thing in context.<p>Repo Tokens is a GitHub Action that counts your codebase&#x27;s size in tokens (using tiktoken) and updates a badge in your README. The badge color reflects what percentage of an LLM&#x27;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).<p>It&#x27;s a composite action. Installs tiktoken, runs ~60 lines of inline Python, takes about 10 seconds. The action updates the README but doesn&#x27;t commit, so your workflow controls the git strategy.<p>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.<p>GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;qwibitai&#x2F;nanoclaw&#x2F;tree&#x2F;main&#x2F;repo-tokens\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;qwibitai&#x2F;nanoclaw&#x2F;tree&#x2F;main&#x2F;repo-tokens</a>","time":1772205282,"title":"Show HN: Badge that shows how well your codebase fits in an LLM's context window","type":"story","url":"https://github.com/qwibitai/nanoclaw/tree/main/repo-tokens"}