Skip to main content
skill

cost-optimization · microsoft — Claude Code skill: what it does, how to install

Finds idle Azure resources and evaluates Reservation and Savings Plan coverage. It suggests ways to lower cloud spend without modifying infrastructure.

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-optimization does

This skill inspects Azure spending using Cost and Resource Graph MCP tools. It detects orphaned disks left behind by deleted virtual machines and unattached public IP addresses. When reviewing commitments, it queries list_benefit_utilization, list_reservation_transactions, and get_benefit_recommendations.

The instructions strictly limit actions to recommendations. The agent will not delete disks, resize virtual machines, deploy resources, or buy commitments. It also demands server-side query aggregation rather than processing raw data in a local shell or script.

Do not run this skill for budget alerts, cost spikes, billing forecasts, or governance rules. If permissions fail, it identifies the exact scope and missing Azure role.

What it helps with

  • find unattached disks and idle public IP addresses in Azure
  • inspect Azure Reservation utilization metrics
  • evaluate current Savings Plan coverage and commitment recommendations
  • identify sizing mismatches across active cloud instances

Example prompts for the agent

  • Find orphaned disks and unused public IPs in our Azure subscription
  • Check our Azure Reservation utilization over the last 30 days
  • What Savings Plan commitments should we consider based on current usage?

How to install cost-optimization

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-optimization -a claude-code

3Manually: put the files in place

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

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

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

Questions about cost-optimization

How to install cost-optimization in Claude Code?

Add the marketplace source using /plugin marketplace add microsoft/skills, then install the package with /plugin install azure-cost@skills.

Will cost-optimization automatically resize or delete resources?

No. The skill only provides recommendations and explicitly avoids deleting, resizing, purchasing, or deploying any Azure resources.

When should cost-optimization not be used?

Skip this skill when investigating sudden cost spikes, setting budgets, forecasting future spending, estimating pricing, or managing governance policies.

Source text

SKILL.md · MIT
---
name: cost-optimization
description: "Optimize existing Azure resources and analyze Reservations or Savings Plans. WHEN: \"optimize Azure costs\", \"reduce cloud spending\", \"rightsize resources\", \"find idle resources\", \"orphaned disk\", \"deleted VM still charged\", \"public IP still charging\", \"reservation utilization\", \"Savings Plan coverage\", \"commitment recommendation\", \"why is pay-as-you-go still charged\". DO NOT USE FOR: cost spikes, forecasts, pricing estimates, budgets, or governance."
license: MIT
metadata:
  author: Microsoft
  version: "1.0.1"
---

# Azure Cost Optimization

## Quick Reference

| Intent | Workflow | Primary tools |
|--------|----------|---------------|
| Reduce waste or rightsize | [Optimization](references/optimization.md) | Cost and Resource Graph tools |
| Review commitments | [Commitments](references/commitments.md) | `list_benefit_utilization`, `list_reservation_transactions`, `get_benefit_recommendations` |

## When to Use This Skill

Use for waste, rightsizing, and commitments.

## MCP Tools

Use cost and Resource Graph tools for optimization and benefit tools for
commitments. Validate queries. Fallback: [API mappings](references/tool-fallback.md).

## Workflow

1. Confirm scope, period, currency, and commitment intent.
2. Load only the matching workflow above.
3. Never transform MCP results in a shell or interpreter; request validated
   server-side projection, aggregation, or bounded follow-up queries.
4. Separate measured cost, reported savings, and qualitative opportunities.
5. Recommend changes only; do not delete, resize, purchase, or deploy resources.

## Error Handling

| Error | Action |
|-------|--------|
| Access denied | Name the scope and permission. |
| Multiple currencies | Group and report each currency separately. |
| Missing evidence | State the gap; do not invent values. |
| Server error | Retry once; then report the trace ID. |

© Microsoft · MIT · microsoft/skills

Similar skills

All skills for Cloud: AWS, Azure, GCP →

cost-optimization by other authors comes first.

From the same set242

The whole set →

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