Skip to main content

skillbudget

Your agent's always-loaded context has a token budget. Spend it wisely — and fail CI when you blow it.

Every turn, before the user says a word, your coding agent loads CLAUDE.md, every skill's description, and your always-apply rules into its context window. Teams quietly let this grow to tens of thousands of tokens — one enterprise setup burned 143K of 200K tokens (72%) on definitions alone. A bloated CLAUDE.md (>5K tokens) measurably shrinks the room left for actual work.

skillbudget measures that always-on surface and gives you a CI gate.

pipx install mujin-skillbudget

skillbudget scan --budget 8000     # exit 1 if always-on context exceeds the budget
always-on context budget: 8,000 tokens   [estimated (~4 chars/token — pip install tiktoken for exact)]

    1,853  CLAUDE.md
       16  skill deploy · frontmatter
       13  skill test · frontmatter
  -------
    1,882  TOTAL always-on  (1,882/8,000  ok)

  on-invocation (not counted — loads only when triggered):
      500  skill deploy · body

  suggestions:
  - CLAUDE.md is 1,853 tokens — move rarely-needed guidance into on-demand skills.

What counts (and what doesn't)

The key insight most "context size" tools miss: skill bodies are lazy. A skill only puts its name + description into context until it's actually invoked. So skillbudget charges the always-on budget for:

  • CLAUDE.md (or AGENTS.md) — loaded every turn,
  • each skill's frontmatter (.claude/skills/*/SKILL.md description),
  • Cursor rules with alwaysApply: true.

…and reports skill bodies and glob-scoped rules separately as on-invocation cost — real, but only when triggered. Budget the thing that's always there.

Exact counts

By default it estimates (~4 chars/token, zero dependencies, fully offline). For exact cl100k_base counts, pip install mujin-skillbudget[accurate] (pulls tiktoken) — it's auto-detected.

CI gate

# .github/workflows/context-budget.yml
jobs:
  skillbudget:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "3.11" }
      - run: pipx install mujin-skillbudget
      - run: skillbudget scan --budget 8000   # fails the build if context bloats

--json for machine output, --no-fail to report without gating.

Part of a set

  • agentsync — keep CLAUDE.md / AGENTS.md / Cursor / Copilot in sync.
  • agentaudit — audit skills / MCP servers / plugins for security & quality.

Sync your config → budget its size → audit it for risk. Same files, same CI.


Built by Mujin Labs — tooling for the autonomous-agent era. MIT.

Release files for mujin-skillbudget 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mujin-skillbudget 0.1.0
File Size Uploaded
mujin_skillbudget-0.1.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mujin-skillbudget 0.1.0
File Interpreter ABI Platform
mujin_skillbudget-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / mujin_skillbudget-0.1.0.tar.gz

Download URL mujin_skillbudget-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3cb2130e1ebd33f6795e3d104267c28c26c3eef06249ef73e88d6be16bc419e5
BLAKE2b-256 checksum
How to use checksums
384d8a8767635ff3695c2c97226b1068cb400addfa2325a67d2efda4544cf983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release files / mujin_skillbudget-0.1.0-py3-none-any.whl

Download URL mujin_skillbudget-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f764b26043ecbf2ec0c0c9995b33494f388d81106d4f48df6ee54582bb289fd
BLAKE2b-256 checksum
How to use checksums
7cfeaf1b0c8b86a78a03e17964a996337399c2527b83222831564c79b93ebc9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page