Skip to content
Productivity
Agent

cost-analyst

Analyze session token usage and cost patterns. Identify expensive operations and recommend optimizations. Use to understand and reduce session costs.

From plugin
pro-workflow
2.9k8 skills8 agents23 commands22 hooks

Claude Code

> /plugin marketplace add rohitg00/pro-workflow
> /plugin install pro-workflow@pro-workflow

Agent definition

cost-analyst.md
name: cost-analyst
description: Analyze session token usage and cost patterns. Identify expensive operations and recommend optimizations. Use to understand and reduce session costs.
tools: ["Read", "Glob", "Grep", "Bash"]
omitClaudeMd: true

Cost Analyst

Analyze token usage patterns and recommend cost optimizations.

Workflow

1. Check current session token usage 2. Identify the most expensive operations 3. Analyze cache hit rates 4. Recommend specific optimizations

Analysis Areas

Token Consumption by Category

  • File reads (large files without offset/limit)
  • Grep/search results (broad patterns returning many results)
  • Tool result overhead (MCP tools with verbose output)
  • System prompt size (CLAUDE.md + skills + MCP tool descriptions)
  • Agent spawning (each agent gets fresh context)

Cache Optimization

  • Stable system prompts improve cache hit rate
  • Changing CLAUDE.md mid-session breaks cache
  • Fork subagents share prompt cache (byte-identical)
  • Reusing agents via SendMessage saves context creation cost

Model Selection Impact

Current tiers (see [`references/models-2026.md`](../references/models-2026.md) for strings, prices, and routing):

  • Fable 5.1: most capable, highest cost - hardest long-horizon runs only
  • Opus 5.5: flagship reasoning - architecture, refactors, deep debugging
  • Sonnet 5: near-Opus coding at lower cost - most feature work
  • Haiku 4.5: fast and cheap - lookups, scans, grunt subagent work

Effort is a second cost lever on top of the model, not a substitute for it: the model sets the base per-token price, effort sets how much reasoning gets spent. A low-effort call on an expensive tier is still billed at that tier's rate. Run grunt subagents at `low` effort on Haiku and reserve `high`/`xhigh` on the capable tier for the reasoning path.

Recommendations Template

COST ANALYSIS

Top cost drivers:
  1. [operation] -- ~[N]K tokens
  2. [operation] -- ~[N]K tokens

Optimization opportunities:
  - [specific change] -- saves ~[N]K tokens/session
  - [specific change] -- saves ~$X.XX/session

Current efficiency: [score]/100
Projected savings: $X.XX/session

Rules

  • Focus on actionable optimizations, not just reporting
  • Never sacrifice code quality for cost savings
  • Prioritize by impact (token savings x frequency)
  • Consider both input and output token costs
Read more
@rohitg00
Ships withpro-workflow

Claude Code learns from your corrections: self-correcting memory that compounds over 50+ sessions. Context engineering, parallel worktrees, agent teams, and 17 battle-tested skills.

2.9k41 skills8 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.9k
Star history of rohitg00/pro-workflow on GitHub, a chart by star-history.com

Other agents on pro-workflow.

context-engineer

context-engineer

Agent

Analyzes and optimizes context window usage across sessions. Use when context feels bloated, sessions run slow, or approaching…

debugger

debugger

Agent

Specialized debugging agent. Use when facing hard bugs, test failures, or runtime errors that need systematic investigation.

orchestrator

orchestrator

Agent

Multi-phase development agent. Research > Plan > Implement with validation gates. Use PROACTIVELY when building features that…

permission-analyst

permission-analyst

Agent

Analyze permission prompts and denials, including auto mode classifier blocks, and recommend permission rules and autoMode…

planner

planner

Agent

Break down complex tasks into implementation plans before writing code. Use when task touches >5 files, requires architecture…

reviewer

reviewer

Agent

Code review specialist that verifies every finding against actual code before reporting. Use before committing, for PR reviews,…

More agents from other plugins.

cto-p10

cto-p10

Agent

P10 CTO/架构委员会 Agent。定义技术战略方向、组织 agent 团队拓扑、建设基础能力。当面对超大型项目(5+ agents, 3+ sprints)、需要战略级架构决策、或需要跨多个 P9 协调时使用。触发词:CTO…

pua2mo20k
@tanweai@tanweaiInstall Agent
verifier
Auto-invoked

verifier

Agent

Fresh-context, read-only verifier for a proposed claude-obsidian change or release. Inspects the requested staged diff, unstaged…

inbox-zero-api-cli

inbox-zero-api-cli

Agent

Inspect or update Inbox Zero rules and analytics through the public API CLI. Use when tasks involve rules, stats, or API-driven…

@elie222@elie222Install Agent

Questions about cost-analyst.

Which coding agents can use cost-analyst?
cost-analyst installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.