context-cost-line-item-analyzer

Decompose agent session token spend into context-driven and output-driven costs.

4|1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/m2ai-portfolio/m2ai-skills-pack --skill context-cost-line-item-analyzer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: context-cost-line-item-analyzer
Source: https://github.com/m2ai-portfolio/m2ai-skills-pack/tree/main/skills/context-cost-line-item-analyzer
Command: npx skills add https://github.com/m2ai-portfolio/m2ai-skills-pack --skill context-cost-line-item-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Breaks down an agent session's token spend into context-loaded-before-first-prompt versus output-generated-during-session, revealing the main drivers of context cost and enabling targeted optimizations.

Core Features & Use Cases

  • Context breakdown: classify spend into startup overhead, system prompts, memory, MCP tool schemas, and skill descriptions.
  • Driver ranking: produce a prioritized list of context cost items with estimated token budgets.
  • Reduction guidance: generate actionable recommendations to cut context tokens in ongoing projects.

Quick Start

Run the analyzer on your project to surface context-cost drivers and suggested reductions.

Frequently Asked Questions about context-cost-line-item-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze agent token spend to separate context costs from output generation?▼

To analyze agent token spend, you decompose session costs into context-loaded-before-first-prompt versus output-generated-during-session. This breakdown classifies spend into startup overhead, system prompts, memory, MCP tool schemas, and skill descriptions to identify the main context cost drivers.

What is the best way to reduce context window overhead in CLAUDE.md chains?▼

The best way to reduce context window overhead in CLAUDE.md chains is to rank context cost drivers by estimated token budgets. By pinpointing startup overhead and system prompts within the chain, you can apply targeted reductions to trim unnecessary context tokens from ongoing sessions.

How does MCP server configuration impact agent session token costs?▼

MCP server configuration impacts token costs through tool registration schemas loaded into the context window. Analyzing these configurations reveals how much startup overhead and memory usage they consume, allowing you to measure their specific contribution to overall context-driven spend.

Can I measure startup overhead and system prompt token usage before the first prompt?▼

Yes, you can measure startup overhead and system prompt token usage by classifying spend loaded before the first prompt. This process isolates initial context costs from output-generated tokens, producing a prioritized list of items with estimated token budgets for targeted optimization.

How do I optimize SKILL.md descriptions to lower context token usage in agent sessions?▼

To optimize SKILL.md descriptions and lower context token usage, you analyze them to surface their individual token budgets. This generates actionable reduction recommendations, helping you trim the context tokens these descriptions consume within the agent's startup overhead.

Why does my agent session consume so many tokens before generating any output?▼

Your agent session consumes tokens before output because of context-driven costs loaded into the environment. Decomposing the session reveals that startup overhead, memory usage, MCP tool schemas, and system prompts are the primary drivers requiring targeted reductions to optimize spend.