context-budget
Skill1 starsChanged 56 days agoMITView on GitHub
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast and the agents, skills, MCP servers, or rules consuming it need to be identified.
54 other projects use a version of this, 23 of them edited.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codeedited, first seen Nov 8, 2026
- cveralyon/axel-setupedited, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemonedited, first seen Nov 6, 2026
- coco-research/cocoedited, first seen Nov 1, 2026
Used with
Projects with it also use agent-payment-x402, openclaw-persona-forge and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TironFoxSkillagent-payment-x402
Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.
Also in 6 projects that use this
TironFoxSkillopenclaw-persona-forge
为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。
Also in 5 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 9 projects that use this
renepfSkillorch-pipeline
Shared orchestration engine for the orch-* skill family. Defines the gated Research-Plan-TDD-Review-Commit pipeline, the size classifier, the agent map, and the two human gates that the orch-* operation skills delegate to. Not usually invoked directly.
Also in 4 projects that use this
Exploration-labsSkilltoken-budget-advisor
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.
Also in 11 projects that use this
loulanyueSkillsanta-method
Multi-agent adversarial verification with convergence loop. Two independent review agents must both pass before output ships.
Also in 8 projects that use this
Other versions54 projects use a version of this.
Word for word · 0
None found.
Edited · 23
- misskey-dev/misskey★ 11k13% same
- coco-research/coco★ 79747% same
- loulanyue/awesome-claude-notes★ 27298% same
- Fmarzochi/EGC★ 6191% same
- woxiangyangzhimao/skills★ 1495% same
- gongyijie85/dsh-ecc★ 899% same
- VoVuongThanhDat/agentflow★ 899% same
- cveralyon/axel-setup★ 411% same
- airshell/ai-optimizer★ 235% same
- RobSpct/agentic-os-rs-community-kit★ 299% same
13 more not listed
Wrote their own version · 31
- poshan0126/dotclaude★ 871same name
- OneWave-AI/claude-skills★ 378same name
- felvieira/claude-skills-fv★ 27same name
- Fadi88/one-man-startup★ 16same name
- tellmefrankie/ai-investment-skills★ 14same name
- mxrsv/agents-skills★ 11same name
- TheyanzXD/opencode-telegram-gateway★ 9same name
- Univers42/claude-deal-with-the-devil★ 4same name
- Univers42/harness42★ 4same name
- hahuyhungdev/ai-coding-config★ 3same name
21 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository64 other files it gives its agents.
- accioSkill
- anthropic-doc-validatorSkill
- archifySkill
- cavecrewSkill
- caveman-compressSkill
- caveman-exploreSkill
- caveman-helpSkill
- cavemanSkill
- codebase-designSkill
- conference-talk-deckSkill
- config-gcSkill
- domain-modelingSkill
- excalidrawSkill
- explain-yogi-like-he-is-5Skill
- field-guide-builderSkill
- gateguardSkill
- geo-contentSkill
- goal-creatorSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- hindsightSkill
- implementSkill
- improve-codebase-architectureSkill
- loop-design-checkSkill
- mental-modelsSkill
- migrationSkill
- modern-pythonSkill
- no-ai-slopSkill
- onboard-lightSkill
- onboard-repoSkill
- ponytail-auditSkill
- ponytail-reviewSkill
- ponytailSkill
- primitive-classifierSkill
- prompt-fixerSkill
- prompt-optimizerSkill
- prototypeSkill
- qa-deckSkill
- read-wikiSkill
- researchSkill
- resolving-merge-conflictsSkill
- safe-refactorSkill
- scope-creep-checkSkill
- sdd-workshop-walkthroughSkill
- setup-matt-pocock-skillsSkill
- skill-complySkill
- skill-scoutSkill
- smellsSkill
- spec-interviewSkill
- surgical-patchSkill
- teachSkill
- the-llm-councilSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- watchSkill
- wayfinderSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 50 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Check for duplicate copies in .agents/skills/: skip identical copies to avoid double-counting
- Distinctive: line 55
Run each SessionStart hook and count the tokens it emits.
- Very specific: line 140
Token estimation: use words × 1.3 for prose, chars / 4 for code-heavy files
- Distinctive: line 143
Verbose mode for debugging: use when you need to pinpoint the exact files driving overhead, not for regular audits
- Distinctive: line 144
Audit after changes: run after adding any agent, skill, or MCP server to catch creep early
“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Budget
Analyze token overhead across every loaded component in a Claude Code session and surface actionable optimizations to reclaim context space.
When to Use
- Session performance feels sluggish or output quality is degrading
- You've recently added many skills, agents, or MCP servers
- You want to know how much context headroom you actually have
- Planning to add more components and need to know if there's room
- Running
/context-budgetcommand (this skill backs it)
How It Works
Phase 1: Inventory
Scan all component directories and estimate token consumption:
Agents (agents/*.md)
- Count lines and tokens per file (words × 1.3)
- Extract
descriptionfrontmatter length - Flag: files >200 lines (heavy), description >30 words (bloated frontmatter)
Skills (skills/*/SKILL.md)
- Count tokens per SKILL.md
- Flag: files >400 lines
- Check for duplicate copies in
.agents/skills/: skip identical copies to avoid double-counting
Rules (rules/**/*.md)
- Count tokens per file
- Flag: files >100 lines
- Detect content overlap between rule files in the same language module
MCP Servers (.mcp.json or active MCP config)
- Count configured servers and total tool count
- Estimate schema overhead at ~500 tokens per tool
- Flag: servers with >20 tools, servers that wrap simple CLI commands (
gh,git,npm,supabase,vercel)
CLAUDE.md (project + user-level)
- Count tokens per file in the CLAUDE.md chain
- Flag: combined total >300 lines
Auto-memory (~/.claude/projects/<slug>/memory/MEMORY.md)
- Count tokens in the index; it is loaded every session, so count it as always-on
- Flag: entries for topics no longer worked on, files the index does not point to
SessionStart-injected context (hook output configured in ~/.claude/settings.json, e.g. the wiki index hook)
- Run each SessionStart hook and count the tokens it emits; injected every session, so count it as always-on
- Flag: an injected index that has outgrown a screen
Phase 2: Classify
Sort every component into a bucket:
| Bucket | Criteria | Action |
| Always needed | Referenced in CLAUDE.md, backs an active command, or matches current project type | Keep |
| Sometimes needed | Domain-specific (e.g. language patterns), not referenced in CLAUDE.md | Consider on-demand activation |
| Rarely needed | No command reference, overlapping content, or no obvious project match | Remove or lazy-load |
Phase 3: Detect Issues
Identify the following problem patterns:
- Bloated agent descriptions: description >30 words in frontmatter loads into every Task tool invocation
- Heavy agents: files >200 lines inflate Task tool context on every spawn
- Redundant components: skills that duplicate agent logic, rules that duplicate CLAUDE.md
- MCP over-subscription: >10 servers, or servers wrapping CLI tools available for free
- CLAUDE.md bloat: verbose explanations, outdated sections, instructions that should be rules
Phase 4: Report
Produce the context budget report:
Context Budget Report
═══════════════════════════════════════
Total estimated overhead: ~XX,XXX tokens
Context model: Claude Sonnet (200K window)
Effective available context: ~XXX,XXX tokens (XX%)
Component Breakdown:
┌─────────────────┬────────┬───────────┐
│ Component │ Count │ Tokens │
├─────────────────┼────────┼───────────┤
│ Agents │ N │ ~X,XXX │
│ Skills │ N │ ~X,XXX │
│ Rules │ N │ ~X,XXX │
│ MCP tools │ N │ ~XX,XXX │
│ CLAUDE.md │ N │ ~X,XXX │
└─────────────────┴────────┴───────────┘
WARNING: Issues Found (N):
[ranked by token savings]
Top 3 Optimizations:
1. [action] → save ~X,XXX tokens
2. [action] → save ~X,XXX tokens
3. [action] → save ~X,XXX tokens
Potential savings: ~XX,XXX tokens (XX% of current overhead)In verbose mode, additionally output per-file token counts, line-by-line breakdown of the heaviest files, specific redundant lines between overlapping components, and MCP tool list with per-tool schema size estimates.
Examples
Basic audit
User: /context-budget
Skill: Scans setup → 16 agents (12,400 tokens), 28 skills (6,200), 87 MCP tools (43,500), 2 CLAUDE.md (1,200)
Flags: 3 heavy agents, 14 MCP servers (3 CLI-replaceable)
Top saving: remove 3 MCP servers → -27,500 tokens (47% overhead reduction)Verbose mode
User: /context-budget --verbose
Skill: Full report + per-file breakdown showing planner.md (213 lines, 1,840 tokens),
MCP tool list with per-tool sizes, duplicated rule lines side by sidePre-expansion check
User: I want to add 5 more MCP servers, do I have room?
Skill: Current overhead 33% → adding 5 servers (~50 tools) would add ~25,000 tokens → pushes to 45% overhead
Recommendation: remove 2 CLI-replaceable servers first to stay under 40%Best Practices
- Token estimation: use
words × 1.3for prose,chars / 4for code-heavy files - MCP is the biggest lever: each tool schema costs ~500 tokens; a 30-tool server costs more than all your skills combined
- Agent descriptions are loaded always: even if the agent is never invoked, its description field is present in every Task tool context
- Verbose mode for debugging: use when you need to pinpoint the exact files driving overhead, not for regular audits
- Audit after changes: run after adding any agent, skill, or MCP server to catch creep early
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

