cut context

    1

    Audit local Claude Code logs to identify token leaks, weighted costs, and context bloat with exact fixes.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    cut context

    Example session with this skill installed

    audit my usage for the last 7 days and tell me why I'm hitting my limit so fast.

    • Read your context and instructions
    • Compiled the cut context

    I have audited your Claude Code session logs from the last 7 days. I processed 42 sessions and found that your context carry cost is the primary driver of token consumption.

    Token Usage Audit (Last 7 Days)

    CategoryShare of CostObservationsRecommended Fix
    Context Re-reads68%CLAUDE.md is 12KB and re-sent every request.Move "Style Guidelines" to a Skill.
    Tool Results18%Large ls -R outputs are persisting in history.Use /clear between unrelated tasks.
    Subagents9%Subagents are inheriting full project context.Limit subagent scope in the prompt.
    Model Output5%Responses are concise and efficient.No action needed.

    Verdict: Your cost is dominated by a bloated CLAUDE.md file and long-lived session history.

    Top Findings:
    1.

    Context Bloat (68% share): Your CLAUDE.md has grown to 12,400 characters. Because it is read on every turn, it accounts for the majority of your cache-write costs.
    2.

    Session Persistence (18% share): You have several sessions with over 50 turns. The accumulated tool outputs (specifically directory listings) are being re-sent repeatedly.

    Next steps

    • Run cut-context --top 5 to see the specific files contributing to the 68% context cost.
    • Ask me to "apply the CLAUDE.md optimization" to split your project instructions into modular skills.
    • Adopt the habit of using /clear when switching from refactoring to testing.
    apply the CLAUDE.md

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

    About this skill

    Stop guessing why your Claude Code sessions are getting expensive or hitting rate limits. This skill analyzes your local session logs to pinpoint exactly where your token budget is being consumed. It identifies the "carry cost" of large tool results, bloated context files, and inefficient subagent delegation.

    What it does

    • Token weighting Ranks costs by weighing cache hits, cache misses, and output tokens based on model pricing tiers.
    • Log analysis Parses ~/.claude/projects/ to extract real usage data from your actual developer sessions.
    • Leak detection Identifies specific files or tool outputs that are being re-sent to the model unnecessarily.
    • Cost attribution Breaks down spending across the conversation history, startup context, and subagent overhead.
    • Remediation planning Provides actionable fixes for every finding, like moving sections of CLAUDE.md into specialized skills.

    How it works

    1. Run the audit Execute the audit script with arguments like --days or --top to analyze your recent session history.
    2. Review findings The skill presents a verdict line and a breakdown of cost distribution, such as context re-reads versus model replies.
    3. Apply fixes Request manual instructions for optimization or authorize the skill to apply file-based fixes with automatic backups.

    Frameworks & tools

    This skill is built for Claude Code. The underlying audit.py script uses only the Python standard library to ensure it remains read-only and requires no external dependencies or network access.

    Why this beats prompting it yourself

    Generic prompts cannot see your local ~/.claude directory or calculate the weighted cost of cached tokens. This tool accesses the raw session logs that the LLM normally cannot reach, providing data-backed evidence instead of hallucinations about usage.

    Use cases

    • Identify which large files in your context are driving up per-request costs.
    • Determine if subagents are creating recursive token loops or redundant context.
    • Audit total project spend across multiple days or specific sessions.
    • Reduce frequency of "rate limit reached" errors by trimming conversation carry cost.

    Known limitations

    Tool result sizes are estimates based on character counts and standard image token weights. Dollar figures are approximate and only available if logs contain cost records.

    Tool result sizes and dollar figures are estimates. Requires local Python 3. Only compatible with Claude Code session logs. Does not analyze network-level traffic.

    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 any payment.

    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

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 27 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Browser
    Read Files
    Write Files
    Network Access
    Listed27 days ago

    What's inside

    Frequently Asked Questions

    This skill is purpose-built for Claude Code. It accesses local session logs in your project directory to identify exactly which files and tool results are driving up your token usage and costs.

    The skill parses your local `~/.claude/projects/` directory to analyze real-world session data. It calculates costs by weighing cache hits against misses, allowing you to see which specific context files are bloating your bill.

    No, the underlying script uses only the Python standard library and operates strictly on your local machine. It does not require network access or external APIs to perform the log audit.

    You will receive the core audit script, integration instructions for your Claude Code environment, and a guide for interpreting the remediation reports to optimize your project files.

    Yes, the skill can provide actionable fixes for common bloat issues, such as restructuring your `CLAUDE.md`. You can review these suggestions manually or authorize the skill to apply file-based optimizations with automatic backups.

    While it provides highly accurate token counts, dollar figures are estimates based on standard model pricing. Precision depends on whether your specific session logs contain full cost record metadata.

    New in LLM Ops