Skip to content
FunCoding

Search

Search docs, Skills and MCP

context-budget

Audit token 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 or before adding new components.

扩展智能体511skills/context-budget/SKILL.md

Install

Send this to Claude Code, Codex or Cursor. The agent checks the Skill for safety first and installs it only after you confirm.

读取 https://funcoding.ai/skills/coco-research/coco/context-budget/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

@agents/PROMPT-DEFENSE.md

Context Budget Audit

Analyze token overhead across every loaded component in a 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
  • Planning to add more components and need to know if there's room
  • Running /context-budget command (this skill backs it)

Audit Procedure

Phase 1: Inventory

Scan all component directories and estimate token consumption:

Agents (agents/*.md)

  • Count lines and tokens per file (words × 1.3)
  • Extract description frontmatter 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 — skip identical copies to avoid double-counting

Rules (rules/**/*.md, rules/**/*.mdc)

  • Count tokens per file
  • Flag: files >100 lines
  • Detect content overlap between rule files

MCP Servers (active MCP config)

  • Count configured servers and total tool count
  • Estimate schema overhead at ~500 tokens per tool
  • Flag: servers with >20 tools

CLAUDE.md / System Prompts

  • Count tokens in CLAUDE.md chain
  • Flag: combined total >300 lines

Phase 2: Classify

Sort every component into a bucket:

BucketCriteriaAction
Always neededReferenced in CLAUDE.md, backs active command, matches project typeKeep
Sometimes neededDomain-specific, not referenced in CLAUDE.mdConsider on-demand activation
Rarely neededNo command reference, overlapping content, no project matchRemove or lazy-load

Phase 3: Report

Generate a prioritized savings report:

CONTEXT BUDGET AUDIT
====================
Total estimated tokens: {total}
Context headroom: {headroom}%

TOP SAVINGS OPPORTUNITIES:
1. {component} — {tokens} tokens ({bucket}) → {recommendation}
2. {component} — {tokens} tokens ({bucket}) → {recommendation}
...

ALWAYS NEEDED (keep):
- {component} ({tokens} tokens)

SOMETIMES NEEDED (lazy-load candidates):
- {component} ({tokens} tokens)

RARELY NEEDED (removal candidates):
- {component} ({tokens} tokens)

Token Estimation Formula

  • English text: ~1.3 tokens per word
  • Code: ~1.5 tokens per word (more punctuation/symbols)
  • YAML frontmatter: ~1.2 tokens per word
  • MCP tool schema: ~500 tokens per tool definition

Integration Points

  • Run automatically before /team:ship to verify context headroom
  • Feed results to learning system as optimization instincts
  • Cross-reference with Brain DB decisions about past context issues

Similar Skills

skill-creator
anthropics/skills180k

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

Extending agents

template-skill
anthropics/skills180k

template-skill

Replace with description of the skill and when Claude should use it.

Extending agents

mcp-builder
anthropics/skills180k

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

Extending agents

claude-api
anthropics/skills180k

claude-api

Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).

Extending agents

academy-guide
anthropics/skills180k

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

Extending agents

ponytail-help
DietrichGebert/ponytail160k

ponytail-help

Quick reference for ponytail levels, skills and commands. One-shot display. Use for /ponytail-help, "ponytail help", "how do I use ponytail".

Extending agents