Repo Tokens: GitHub Action Adds Token Count Badge for LLM Context Window Awareness

✍️ OpenClawRadar📅 Published: February 27, 2026🔗 Source
Repo Tokens: GitHub Action Adds Token Count Badge for LLM Context Window Awareness
Ad

Repo Tokens is a GitHub Action that calculates the token count of your codebase and adds a visual badge to your README indicating how much of a large language model's context window your repository occupies. The goal is to make token size a visible metric, similar to bundle size badges for JavaScript libraries, encouraging leaner codebases that are more compatible with AI coding agents.

How It Works

The action uses tiktoken for tokenization. It runs approximately 60 lines of inline Python and takes about 10 seconds to execute. It's implemented as a composite action.

Configuration and Output

The context window size is configurable, defaulting to 200,000 tokens (matching the size of Claude models). The badge color reflects the percentage of the configured context window your codebase fills:

  • Green: Under 30%
  • Yellow: 50-70%
  • Red: 70%+

The action updates the README file but does not automatically commit the changes, allowing your workflow to control the git strategy.

This type of tool is useful for developers working with AI assistants, as keeping a codebase within an LLM's context window allows the agent to maintain full awareness of the project structure and dependencies during coding tasks.

📖 Read the full source: HN AI Agents

Ad

👀 See Also

Claude Code v2.1.141: New Environment Variables, Hooks Enhancement, and Bug Fixes
Tools

Claude Code v2.1.141: New Environment Variables, Hooks Enhancement, and Bug Fixes

Anthropic released Claude Code v2.1.141 with new environment variables (CLAUDE_CODE_PLUGIN_PREFER_HTTPS, ANTHROPIC_WORKSPACE_ID), terminalSequence field for hooks, agent listing by cwd, and over 20 bug fixes.

OpenClawRadar
AVP Protocol Enables LLM Agents to Share KV-Cache Instead of Text for Token Efficiency
Tools

AVP Protocol Enables LLM Agents to Share KV-Cache Instead of Text for Token Efficiency

AVP (Agent Vector Protocol) allows LLM agents to pass KV-cache directly between them instead of text, reducing token processing by 73-78% and achieving 2-4x speedups across Qwen, Llama, and DeepSeek models. The protocol works with HuggingFace and vLLM connectors and is available as a Python package.

OpenClawRadar
Agents Room: Desktop App for Visualizing Claude Code Agent Teams
Tools

Agents Room: Desktop App for Visualizing Claude Code Agent Teams

Agents Room is an Electron desktop application that scans for .claude/agents/ folders, reads frontmatter, and visualizes agent relationships on a canvas with automatic connection lines. It allows creating/editing agents, skills, and commands directly in the UI instead of editing markdown files.

OpenClawRadar
OpenClaw Skill Pack: A 2,500+ Command Set for Real Autonomous Operations on Ubuntu
Tools

OpenClaw Skill Pack: A 2,500+ Command Set for Real Autonomous Operations on Ubuntu

A new skill package for OpenClaw AI agents introduces over 2,500 execution skills for DevOps operations like Docker management, networking configuration, CVE response, and system automation on Ubuntu environments.

OpenClawRadar