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.
/plugin marketplace add microsoft/skills
/plugin install azure-cost@skillsWhat 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@skillsThis installs the whole azure-cost plugin with all its skills
2Skills CLI (Vercel)
npx skills add microsoft/skills --skill cost-analysis -a claude-code3Manually: put the files in place
~/.claude/skills/cost-analysis/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cost-analysis/
Manually: put the files in place
.agents/skills/cost-analysis/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/cost-analysis/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install microsoft/skills cost-analysis2Manually: put the files in place
.github/skills/cost-analysis/SKILL.mdPlatform CLI
gemini skills install https://github.com/microsoft/skills --path .github/plugins/azure-cost/skills/cost-analysisManually: put the files in place
.devin/skills/cost-analysis/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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