token-budget-check

token-budget-check is a skill for Claude Code from Everyone-Needs-A-Copilot/claude-copilot. It costs 55 tokens per session (806 once invoked), scanned A, original, MIT.

A document-size checker for Markdown files. It estimates token and word counts and compares files with limits for document types such as skills, overviews, and operational guides.

In plain words
What is it for?
Use it when creating or reviewing Markdown documentation, especially agent instructions and knowledge-base files.
Why use it?
It helps keep documentation small enough for an AI agent to load and use within its context limit.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-copilot plugin — 72 skills, 17 commands, 16 agents, 6 hooks shipped together

Good fit Use it when creating or reviewing Markdown documentation, especially agent instructions and knowledge-base files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/everyone-needs-a-copilot/claude-copilot/token-budget-check
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Everyone-Needs-A-Copilot/claude-copilot --skill token-budget-check
Clone the repo
git clone --depth 1 https://github.com/Everyone-Needs-A-Copilot/claude-copilot

Made for: Claude Code.

Or install claude-copilot, the plugin that ships this one along with the rest of its 72 skills, 17 commands, 16 agents, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for token-budget-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check/github.svg)](https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check)
Your own site
<a href="https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check"><img src="https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for token-budget-check

Your own site · 80×15
<a href="https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check"><img src="https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/token-budget-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.00806
Opus 5 $0.00028 $0.00403
Sonnet 5 $0.00011 $0.00161
Haiku 4.5 $0.00006 $0.00081

Measured 4d ago against content hash 16771a0eb59e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

token-budget-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/token-budget-check/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Token Budget Check

Analyze markdown files to ensure they comply with token budget guidelines.

Purpose

Knowledge Copilot files have token budgets to optimize AI ingestion. This skill checks files against those budgets and suggests optimizations when over budget.

Token Budgets by Document Type

Document Type Max Tokens Max Words
Skill (SKILL.md) 2,000 1,400
Product overview 800 560
Product architecture 1,200 840
Product API summary 1,000 700
Product integration 800 560
Operational guide 4,000 2,800
Agent profile 2,000 1,400
Index/navigation 400 280

Procedure

1. Identify Target Files

If a specific file is provided, check that file. Otherwise, scan the directory:

find . -name "*.md" -type f | head -20

2. Calculate Token Estimate

For each file, estimate tokens (words × 1.4):

file="path/to/file.md"
words=$(wc -w < "$file" | tr -d ' ')
tokens=$((words * 14 / 10))
echo "$file: ~$tokens tokens ($words words)"

3. Determine Document Type

Infer type from:

  • Filename: SKILL.md → skill, 00-overview.md → overview
  • Path: 02-products/ → product doc, 03-ai-enabling/02-profiles/ → agent profile
  • Frontmatter: doc_type field if present

4. Compare Against Budget

Status Condition Action
OK Under budget Report as compliant
WARNING 80-100% of budget Suggest review
OVER Exceeds budget Analyze and suggest cuts

5. If Over Budget, Analyze Content

Identify optimization opportunities:

  • Prose that could be tables (30-50% savings)
  • Redundant explanations
  • Examples that could be shortened
  • Content that belongs in linked docs

Output Format

## Token Budget Report

### Summary
- Files checked: N
- Compliant: N
- Warnings: N
- Over budget: N

### Details

| File | Type | Tokens | Budget | Status |
|------|------|--------|--------|--------|
| path/to/file.md | skill | 1,850 | 2,000 | OK |
| path/to/doc.md | overview | 950 | 800 | OVER (+150) |

### Recommendations

#### path/to/doc.md (950 tokens, budget 800)
- Lines 45-60: Convert feature list to table (-80 tokens)
- Lines 72-85: Remove redundant introduction (-50 tokens)

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 112 lines · 55 tokens per session scan A 16771a0eb59e

Subscribe to this mod's changes

token-budget-check is a skill published in the GitHub repository Everyone-Needs-A-Copilot/claude-copilot (13 stars, last pushed today), licensed MIT. It adds 55 tokens to every session and 806 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.