# Review cost from your AI assistant

By the end of this guide, your AI assistant answers the cost questions your team asks each week from Costfluent's own figures, and a CI job prints a summary on a schedule. It is for the engineers who would rather ask in their editor or terminal than open another app. The path connects the assistant, works through prompts grouped by the job they serve, adds the summary from CI, and ends with what the assistant cannot do. Each step links to the page that owns the detail.

## Before you start

- An assistant that runs local MCP servers, such as Claude Code, Claude Desktop, Cursor, VS Code, Codex, Copilot CLI or Gemini CLI.
- An API token from the **Read only** preset, created as [Create a token](/developers/mcp#create-a-token) describes; the MCP page's [Before you start](/developers/mcp#before-you-start) says who can create one. Some assistants can use the command line's browser sign-in instead; see [Connect your assistant](/developers/mcp#connect-your-assistant).
- The prompts on spikes, budgets and untagged cost work on the [sample data](/quickstart#sample-data) a new organization starts with, and every cost read that covers it says so. Anomalies, savings findings and Kubernetes cost need a real connection, and the Kubernetes prompts a cluster that reports to Costfluent.

## 1. Connect your assistant

Follow the guide for your assistant from [Connect your assistant](/developers/mcp#connect-your-assistant), or paste the [Setup prompt](/developers/assistants/setup-prompt) into a new conversation and let the assistant walk you through it. Then ask a first question, such as what you spent on each provider last month. The assistant answers from what the read tools in the MCP page's [Tools](/developers/mcp#tools) table return, so check that table for what it can read. [Ask good questions](/developers/mcp#ask-good-questions) lists what makes an answer right the first time: name the period, the workspace and the measure, and use your own report, budget and tag names.

## 2. Ask about spikes

Ask what moved and when, then what happened on those days. The assistant can set the cost beside your notes and the GitHub deployments and merged pull requests your connections record. To start from a saved report, select **Copy as**, then **Question for an assistant**, under **More actions** on its page; see [Use a report in code or with an assistant](/cost-reports/manage#use-a-report-in-code-or-with-an-assistant). The full path is [Investigate a cost increase](/guides/investigate-a-cost-increase).

```text
Our cost last week was higher than the week before: which services and accounts account for most of the rise, and on which days?
```

```text
Which notes, production deployments or merged pull requests fall on the days our cost rose most this month?
```

## 3. Ask about budgets

Ask which budgets are at risk or over, and how a budget's periods ended against their amounts. See [Budgets](/planning/budgets) and [Budget routine](/guides/budget-routine).

```text
Which of our budgets are at risk or over this period, and how does each one's spend compare with the amount budgeted to date?
```

```text
For our platform team's budget, how did each of the last six periods end against its amount, and where is this one forecast to end?
```

## 4. Ask about anomalies

Ask which anomalies were detected and how far the actual cost ran above the expected. Acknowledging one stays in Costfluent unless your organization lets agents change objects (step 9). See [Insights](/optimization/insights#review-anomalies) and [Get told about a cost spike early](/guides/catch-cost-spikes-early).

```text
Which cost anomalies were detected in the last two weeks, and for each one, how far was the actual cost above the expected?
```

```text
For each cost anomaly detected this month, which service and region does it fall on, and which resources or SKUs drove its increase?
```

## 5. Ask about untagged cost

Ask by a tag key your cloud accounts write, such as `team` or `environment`, and the assistant groups the cost by its values, with the cost that carries none. See [Tags and tag coverage](/allocation/tags) and [Raise tag coverage and keep it up](/guides/improve-tag-coverage).

```text
Over the last 30 days, how much of our cost carried no team tag, split by account, largest first?
```

```text
How did the cost without an environment tag change month by month over the last three complete months?
```

## 6. Ask about savings

Ask for the findings in the savings queue, the largest saving first, with their evidence, risk and effort. Setting a finding's status or owner stays in Costfluent unless your organization lets agents change objects. See [Savings](/optimization/savings) and [Run a savings review](/guides/run-a-savings-review).

```text
Which five open findings in our savings queue would save the most each month, and what risk and effort does each carry?
```

```text
Which savings findings have we accepted but not yet implemented, and what evidence does each one give?
```

## 7. Ask about Kubernetes

Ask which clusters, namespaces or workloads cost the most, how much of their cost was idle, and how the CPU and memory they used compare with what they requested. See [Kubernetes efficiency](/optimization/kubernetes-efficiency), [Kubernetes cost by namespace and team](/guides/kubernetes-cost-by-team) and [Reduce Kubernetes idle cost and rightsize workloads](/guides/reduce-kubernetes-idle-cost).

```text
Which namespaces in our clusters cost the most last month, and how much of each cluster's cost was idle?
```

```text
Which workloads used the smallest share of the CPU and memory they requested last month, and what did they cost?
```

## 8. Send a summary from CI

The [command line](/developers/cli) runs each read tool as a command, with the same capability check and result, and prints JSON into a CI log. Give the CI job a token of its own from the **Read only** preset, kept as a CI secret in `COSTFLUENT_API_TOKEN`; for a job that must outlive its creator's membership, use a [service token](/api/authentication#service-tokens). Install the command line in the job as [Install](/developers/cli#install) describes, and run `costfluent list-budgets` on your CI's schedule, so each run's log shows your budgets with their current spend and state. Any other read command of the [Commands](/developers/cli#commands) table runs the same way; [How it behaves](/developers/cli#how-it-behaves) says how a command exits when a call fails, so the job turns red rather than printing nothing.

## 9. Know what it cannot do

The MCP page's [How it behaves](/developers/mcp#how-it-behaves) owns these limits:

- It reads by default. Its write tools, which create and change annotations, cost reports, budgets, cost alerts and dashboards, acknowledge anomalies and set a savings finding's status and owner, stay off until **Let AI agents create and change objects** is turned on, and then only for the write capabilities the token carries; [Let agents create and change objects](/developers/mcp#let-agents-create-and-change-objects) says who can turn it on. The command line's browser sign-in never offers them.
- No tool deletes anything or touches a cloud account, so the assistant can find a saving but never stops or resizes a resource.
- A token reads one organization, and a workspace token only its own workspace.
- Kubernetes figures leave out spend in a currency with no exchange rate and the days before your plan's history starts; the result names both, so ask the assistant what a figure does not count.
- Names, tags and descriptions in a result are written by your users and your cloud accounts. The server tells the assistant to treat them as data, never instructions; still, run it in an assistant that asks before any call that changes something.

## Check the result

- The assistant answers the first question in step 1 with figures, and can say which filter and dates they came from, so you can open the same numbers in **Cost reports**.
- Asked which Costfluent tools it can call, the assistant names read tools only while **Let AI agents create and change objects** is off.
- The CI job's latest log lists your budgets with their state.

## Keep it true

Costfluent recommends asking the spike and budget prompts at the start of each week and the savings and Kubernetes prompts once a month, and running the CI summary weekly. Replace the CI job's token before its expiration, and revoke an assistant's token under **API tokens** when you stop using the assistant.

## Related

- [MCP server](/developers/mcp) and [Command line](/developers/cli)
- [Setup prompt](/developers/assistants/setup-prompt)
- [Save and manage reports](/cost-reports/manage#use-a-report-in-code-or-with-an-assistant)
- [Analyse Costfluent cost in your BI tool or warehouse](/guides/cost-data-in-your-bi-tool)
