From cost-analyst
Compares cloud costs across different time periods, environments, accounts, regions, teams, or other dimensions to understand spending variations, identify inefficiencies, and benchmark performance
npx claudepluginhub cloudzero/cloudzero-claude-marketplace --plugin cost-analystThis skill uses the workspace's default tool permissions.
This skill performs side-by-side comparisons of cloud costs across different dimensions or time periods to identify variations, benchmark efficiency, and understand relative spending patterns.
Identifies and ranks the biggest contributors to cloud spending across services, accounts, teams, regions, or custom dimensions to help prioritize cost optimization efforts and understand spending distribution
Analyzes Azure cloud costs on FinOps hubs using KQL queries in Azure Data Explorer. Handles trends, anomalies, recommendations, deployments, and operations via structured agent framework.
Share bugs, ideas, or general feedback.
This skill performs side-by-side comparisons of cloud costs across different dimensions or time periods to identify variations, benchmark efficiency, and understand relative spending patterns.
This skill builds on the understand-cloudzero-organization skill.
Before applying this procedure:
Determine what kind of comparison is needed:
Time-Based Comparisons:
Dimension-Based Comparisons:
Multi-Dimensional Comparisons:
Example: Time Period Comparison
# Current period
get_cost_data(
date_range="2024-02-01 to 2024-02-29",
group_by=["CZ:Service"],
limit=50
)
# Previous period
get_cost_data(
date_range="2024-01-01 to 2024-01-31",
group_by=["CZ:Service"],
limit=50
)
Example: Environment Comparison
# Production environment
get_cost_data(
filters={"CZ:Tag:Environment": ["production"]},
group_by=["CZ:Service"],
limit=50
)
# Staging environment
get_cost_data(
filters={"CZ:Tag:Environment": ["staging"]},
group_by=["CZ:Service"],
limit=50
)
# Development environment
get_cost_data(
filters={"CZ:Tag:Environment": ["development"]},
group_by=["CZ:Service"],
limit=50
)
Example: Account Comparison
get_cost_data(
group_by=["CZ:Account", "CZ:Service"],
limit=100
)
Example: Team Comparison (Custom Dimensions)
get_cost_data(
group_by=["User:Defined:Team", "CZ:Service"],
limit=100
)
For each comparable item:
Absolute Difference:
Difference = Cost_A - Cost_B
Percentage Difference:
% Difference = ((Cost_A - Cost_B) / Cost_B) * 100
Ratio:
Ratio = Cost_A / Cost_B
Per-Unit Metrics (if applicable):
Cost per user, Cost per transaction, Cost per GB, etc.
Categorize differences:
Major Differences:
Moderate Differences:
Minor Differences:
Similarities:
For each major difference, investigate further:
If Service A costs more in Environment 1 than Environment 2:
# Break down by additional dimensions
get_cost_data(
filters={"CZ:Tag:Environment": ["production"], "CZ:Service": ["AmazonEC2"]},
group_by=["CZ:Region", "CZ:Account"],
limit=50
)
get_cost_data(
filters={"CZ:Tag:Environment": ["staging"], "CZ:Service": ["AmazonEC2"]},
group_by=["CZ:Region", "CZ:Account"],
limit=50
)
Make fair comparisons by normalizing for scale:
Workload-adjusted:
Time-adjusted:
Resource-adjusted:
Look for:
Efficiency Patterns:
Waste Patterns:
Architecture Patterns:
Provide clear, actionable comparison analysis:
Total Costs:
| Group | Total Cost | Difference from [Baseline] | % Difference |
|---|---|---|---|
| Group A | $X,XXX | +$X,XXX | +XX% |
| Group B | $X,XXX | -$X,XXX | -XX% |
| ... | ... | ... | ... |
Summary:
By Service:
| Service | Group A | Group B | Difference | % Diff | Notes |
|---|---|---|---|---|---|
| Service 1 | $X,XXX | $X,XXX | +$XXX | +XX% | [Insight] |
| Service 2 | $X,XXX | $X,XXX | -$XXX | -XX% | [Insight] |
| ... | ... | ... | ... | ... | ... |
Top 5 Services Contributing to Difference:
Unique to Group A:
Unique to Group B:
If comparing groups of different scale:
| Metric | Group A | Group B | Difference |
|---|---|---|---|
| Cost per day | $X,XXX | $X,XXX | +XX% |
| Cost per user | $X.XX | $X.XX | +XX% |
| Cost per transaction | $X.XX | $X.XX | +XX% |
Insight: Even after normalizing for [scale factor], Group A is X% more expensive.
Most Efficient:
Least Efficient:
Efficiency Recommendations:
How the difference evolved:
Day/Week/Month | Group A | Group B | Difference
[Period 1] | $X,XXX | $X,XXX | $XXX
[Period 2] | $X,XXX | $X,XXX | $XXX
...
Trend: Difference is [growing/shrinking/stable]
Why Group A costs more than Group B:
[Primary cause]: Explains $X,XXX (XX%) of difference
[Secondary cause]: Explains $Y,YYY (YY%) of difference
[Other factors]: Remaining $Z,ZZZ (ZZ%)
For Higher-Cost Group:
For Lower-Cost Group:
General:
For general cost analysis best practices, see ${CLAUDE_PLUGIN_ROOT}/references/best-practices.md
Goal: Understand month-over-month changes
Approach:
Goal: Understand if non-prod is appropriately scaled
Approach:
Goal: Benchmark efficiency across teams
Approach:
Goal: Understand regional cost differences
Approach:
Goal: Measure impact of cost optimization effort
Approach:
Compare more than 2 groups simultaneously:
get_cost_data(
group_by=["CZ:Tag:Environment", "CZ:Service"],
limit=100
)
Create matrix showing all pairwise comparisons.
Calculate statistical variance across groups:
Establish expected ratios:
Flag groups that deviate from expectations.
When comparing teams/products:
Team A: $10,000 / 1000 users = $10/user
Team B: $15,000 / 2000 users = $7.50/user
Team B is more efficient despite higher absolute cost.
${CLAUDE_PLUGIN_ROOT}/references/best-practices.md - Universal cost analysis best practices${CLAUDE_PLUGIN_ROOT}/references/cloudzero-tools-reference.md - Complete tool documentation${CLAUDE_PLUGIN_ROOT}/references/error-handling.md - Troubleshooting and common errors${CLAUDE_PLUGIN_ROOT}/references/dimensions-reference.md - Dimension types and FQDIDs${CLAUDE_PLUGIN_ROOT}/references/cost-types-reference.md - When to use each cost type