cut context
Audit local Claude Code logs to identify token leaks, weighted costs, and context bloat with exact fixes.
Free
Works with the AI Agents you already use
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)
| Category | Share of Cost | Observations | Recommended Fix |
|---|---|---|---|
| Context Re-reads | 68% | CLAUDE.md is 12KB and re-sent every request. | Move "Style Guidelines" to a Skill. |
| Tool Results | 18% | Large ls -R outputs are persisting in history. | Use /clear between unrelated tasks. |
| Subagents | 9% | Subagents are inheriting full project context. | Limit subagent scope in the prompt. |
| Model Output | 5% | 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 5to 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
/clearwhen switching from refactoring to testing.
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.mdinto specialized skills.
How it works
- Run the audit Execute the audit script with arguments like
--daysor--topto analyze your recent session history. - Review findings The skill presents a verdict line and a breakdown of cost distribution, such as context re-reads versus model replies.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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