Context Budget Guard

    by Ali Ahmed

    1

    Audit and optimize Claude Code context usage by identifying overlapping skills, unused plugins, and bloated configs.

    Free

    Security scanned

    Works with the AI Agents you already use

    Context Budget Guard

    Example session with this skill installed

    My Claude Code sessions are getting really slow and hitting limits. Can you audit my context budget and tell me what's eating my tokens?

    • Read your context and instructions
    • Compiled the context budget guard

    I have audited your Claude Code configuration. Your always-loaded context is currently estimated at

    14,250 tokens, which is high for a standard project.

    Context Audit Report

    ComponentEst. TokensFindingRecommendation
    CLAUDE.md5,800Large reference section foundMove 'API Spec' to a project skill
    skills/db-helper.md15085% overlap with sql-query.mdMerge into a single database skill
    mcp-server-jira4,000Never used in last 30 daysDisable via .claude/settings.json
    subagents/writer2,100Redundant system promptShorten description to < 80 tokens

    Top 3 Savings

    1. Disable Unused MCP: Saving ~4,000 tokens.
    2. Refactor CLAUDE.md: Saving ~3,500 tokens.
    3. Merge Overlapping Skills: Saving ~150 tokens and improving tool selection accuracy.

    The audit shows that

    70% of your budget is spent on tools and documentation you haven't touched in the last 30 sessions. Reducing this will significantly lower your latency.

    Next steps

    1. Run python3 scripts/cbg.py --save-baseline cbg-baseline.json to lock these stats.
    2. Approve moving the 'API Spec' section from CLAUDE.md to a new skill file.
    3. Disable the Jira MCP server for this project.
    Refactor CLAUDE.md

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Bloated context windows lead to slow responses, high token costs, and agents selecting the wrong tools. This skill audits your Claude Code environment to identify exactly what is consuming your always-on token budget and provides a path to a leaner setup.

    What it does

    • Analyze token consumption by scanning CLAUDE.md, project skills, subagents, and MCP configurations.
    • Detect skill overlap using lexical similarity checks to find descriptions that confuse the agent.
    • Identify unused assets by cross-referencing local session transcripts to see which plugins or skills haven't been invoked.
    • Calculate budget baselines to track how configuration changes affect your permanent context load over time.
    • Surface high-impact fixes by ranking findings based on potential token savings.

    How it works

    1. Run the cbg.py script against your project root or an uploaded configuration bundle to generate a context-report.md.
    2. Review the always-loaded estimate and top three findings surfaced by the agent.
    3. Save a baseline snapshot before applying suggested fixes like merging overlapping skills or moving reference docs to on-demand skills.
    4. Execute a comparison run to verify token reduction and confirm the agent's improved focus.

    Frameworks & tools

    Python 3 standard library. Integrates with Claude Code, .claude configuration folders, CLAUDE.md files, and .mcp.json server definitions.

    Why this beats prompting it yourself

    Standard prompts cannot see your local session history or calculate cross-file token estimates with consistency. This skill uses a specialized script to parse local transcripts and configurations that are normally invisible to a generic chat session.

    Use cases

    • Reducing "token fever" when sessions hit limits too early in the workday.
    • Debugging why an agent picks the wrong skill for a specific task.
    • Auditing a complex multi-agent workspace before a production deployment.
    • Cleaning up legacy plugins and MCP servers that are no longer in use.

    Known limitations

    Token counts are ±25% estimates as no tokenizer is bundled. MCP tool schemas are not fetched; costs are based on flat estimates. Overlap detection uses TF-IDF, which may miss some semantic clashes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    • Free with an Agensi account

    Software
    Python 3.10+

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Read-only audit. Reads CLAUDE.md, skill/agent files, MCP server names and (optionally) local session logs to count skill usage. Never opens .credentials.json or .env. Writes only context-report.md and optional baseline JSON. No network calls.

    Listed6 days ago

    What's inside

    Frequently Asked Questions

    Context Budget Guard identifies 'context bloat' by auditing your CLAUDE.md, MCP configurations, and project skills to find redundant or unused assets that slow down responses and drive up token costs.

    The skill is designed specifically for the Claude Code CLI environment and integrates with .claude folders, .mcp.json server definitions, and standard project instruction files.

    The purchase includes the core cbg.py analysis script, documentation for interpreting the context-report.md, and a guide for establishing token budget baselines.

    Yes, the script cross-references your local session transcripts to identify plugins, skills, and MCP tools that haven't been invoked, highlighting them as candidates for removal.

    Setup is minimal; simply run the provided Python script against your project root or configuration bundle to generate your first audit report.

    Token counts are provided as ±25% estimates based on character density, as the tool uses a lightweight approach without bundling a heavy tokenizer to ensure fast, local execution.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free