All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

GitHub Action for Measuring Codebase Size in Tokens with Context Window Badge

By

jimminyx

3mo ago· 3 min readenCode

Summary

This article describes nanoclaw/repo-tokens, a GitHub Action that calculates codebase size in tokens and updates a README badge with color coding based on what percentage of an LLM's context window the codebase fills. The tool uses tiktoken for token counting and provides visual feedback (green, yellow-green, yellow, red) for different percentage ranges. The article explains that small codebases are particularly advantageous with coding agents, and mentions that nanoclaw is a lightweight alternative to OpenClaw that runs in containers for security and connects to various messaging platforms.

Key quotes

· 4 pulled
This counts tokens using tiktoken and writes the result between HTML comment markers in your README
The badge color reflects what percentage of an LLMs context window the codebase fills (context window size is configurable, defaults to 200k which is the size of Claude Opus)
Small codebases were always a good thing. With coding agents, there's now a huge advantage to having
A lightweight alternative to OpenClaw that runs in containers for security. Connects to WhatsApp, Telegram, Slack, Discord, Gmail and other messaging apps, has memory, scheduled jobs
Snippet from the RSS feed
A lightweight alternative to OpenClaw that runs in containers for security. Connects to WhatsApp, Telegram, Slack, Discord, Gmail and other messaging apps,, has memory, scheduled jobs, and runs dir...

You might also wanna read