Skip to main content
skill

cost-analysis — Claude Code skill: what it does, how to install

Analyzes actual Azure spend, explains billing spikes, and breaks down AKS or AI service costs.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add microsoft/skills
/plugin install azure-cost@skills
Open on GitHub

What cost-analysis does

The skill investigates real Azure bills using MCP tools like query_costs, query_aks_costs, and Resource Graph. It identifies the most expensive resources, audits charges for Cosmos DB and Foundry models, and breaks down AKS cluster spending by namespace. It also detects idle cluster capacity.

Workflows begin by confirming subscription scope, time range, currency, and grouping. The skill requires aggregation, sorting, and totals to run tool-side rather than piping raw MCP data into a shell interpreter. Measured metrics remain strictly separated from inferred root causes.

Because it only inspects historical spending, you cannot use this skill for forecasting, pricing estimates, commitments, or budget planning.

What it helps with

  • investigate unexpected billing spikes in Azure
  • break down AKS cluster costs by namespace
  • identify the most expensive resources in an Azure subscription
  • audit actual spend for Cosmos DB and Foundry models
  • detect idle capacity across AKS nodes

Example prompts for the agent

  • Give me an Azure cost breakdown for last month and list the most expensive resources.
  • Why did my Azure bill spike this week for Cosmos DB and Foundry?
  • Analyze our AKS cluster spend and show costs by namespace.

How to install cost-analysis

1Plugin marketplace

/plugin marketplace add microsoft/skills
/plugin install azure-cost@skills

This installs the whole azure-cost plugin with all its skills

2Skills CLI (Vercel)

npx skills add microsoft/skills --skill cost-analysis -a claude-code

3Manually: put the files in place

~/.claude/skills/cost-analysis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cost-analysis/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cost-analysis

How to install cost-analysis in Claude Code?

In Claude Code, first run /plugin marketplace add microsoft/skills, then run /plugin install azure-cost@skills. Alternatively, you can run npx skills add microsoft/skills --skill cost-analysis -a claude-code.

What does the cost-analysis skill do?

It audits actual Azure spending records, pinpoints billing spikes, and analyzes resource allocation across AKS clusters and AI workloads.

Can cost-analysis forecast future Azure spend or size reservations?

No. The skill is restricted to analyzing recorded charges and cannot be used for forecasts, pricing estimates, commitments, or budget tracking.

Source text

SKILL.md · MIT
---
name: cost-analysis
description: "Analyze actual Azure spend, bill changes, and AKS or AI costs. WHEN: \"Azure cost breakdown\", \"most expensive resources\", \"why did my bill increase\", \"cost spike\", \"unexpected charge\", \"Cosmos DB charges\", \"Foundry model costs\", \"AKS cluster cost\", \"namespace cost\", \"enable AKS cost analysis\", \"idle AKS capacity\". DO NOT USE FOR: forecasts, pricing estimates, rightsizing, commitments, or budgets."
license: MIT
metadata:
  author: Microsoft
  version: "1.1.1"
---

# Azure Cost Analysis

## Quick Reference

| Intent | Workflow | Primary tools |
|--------|----------|---------------|
| Query historical spend | [Cost query](references/cost-query/workflow.md) | `query_costs` |
| Explain a spike | [Cost investigation](references/cost-investigation.md) | `query_costs`, Resource Graph |
| Analyze AKS spend | [AKS cost analysis](references/aks-cost-analysis.md) | `query_aks_costs`, Resource Graph |
| Analyze AI service spend | [AI cost analysis](references/ai-cost-analysis.md) | `query_costs` |

## When to Use This Skill

Use for spend, anomalies, and AKS or AI allocation.

## MCP Tools

Use cost tools and Resource Graph first. If an operation is unavailable, follow
[fallback and safety](references/tools-and-safety.md).

## Workflow

1. Confirm scope, period, currency, and breakdown.
2. Load only the matching workflow above.
3. Never transform MCP results in a shell or interpreter; request tool-side
   totals, grouping, sorting, or bounded follow-up queries.
4. Respect row limits and label incomplete data.
5. Separate measured cost from inferred causes and recommendations.

## Error Handling

| Error | Action |
|-------|--------|
| Access denied | Name the required scope and role. |
| Empty result | Distinguish no data from unavailable data. |
| Multiple currencies | Report each currency separately. |
| Server error | Retry once; then stop with the trace ID. |

© Microsoft · MIT · microsoft/skills

Similar skills

All skills for Cloud: AWS, Azure, GCP →

From the same set242

The whole set →
azure-kusto-graph Turns a plain-language graph description into KQL operators: edges first, then node lookups, then the graph itself. Handy when tabular data needs to become a graph. ★ 3,149repo stars cost-optimization Finds idle Azure resources and evaluates Reservation and Savings Plan coverage. It suggests ways to lower cloud spend without modifying infrastructure. ★ 3,149repo stars cost-governance Check Azure budgets and alerts, set up budgets, and review resource tags and policy limits. Useful when managing cloud cost controls. ★ 3,149repo stars cost-estimation Works out what Azure will cost next month and prices resources you have not deployed yet. Useful when a forecast has to line up with a planning target. ★ 3,149repo stars azure-advisor Review Azure Advisor recommendations, inspect affected resources, and update recommendation status. The skill also handles requests about service retirements. ★ 3,149repo stars azure-advisor-actionability This skill turns an Azure Advisor recommendation into step-by-step remediation with real resource values filled in. Useful when you need to act on an Advisor note instead of guessing. ★ 3,149repo stars azure-search-nav Creates Azure portal deep links to specific blades and menus for AKS, Arc-enabled Kubernetes, and Compute resources based on text queries. ★ 3,149repo stars aks-troubleshooting Investigates live Azure Kubernetes Service incidents in read-only mode and ties symptoms to evidence-backed causes. Use it for AKS failures. ★ 3,149repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor