# Code Agents Intelligence

Understand where AI coding agent spend goes, what each agent produces, and whether that usage is aligned with the work the company is paying for. Code Agents Intelligence gives engineering leaders, platform teams, FinOps managers, and AI owners a unified view of every coding agent's activity — token usage, costs, code impact, models, sessions, and user behavior — across every developer and every session.

Code Agents Intelligence is purpose-built for external developer tools — Claude Code, Claude Cowork, Codex CLI, Gemini CLI, Copilot, and Cursor.

If you are building and monitoring your own AI applications — AI agents, chatbots, LLM-based applications — see [Getting started with AI Observability](https://coralogix.com/docs/user-guides/ai/getting_started/index.md) and the [Application Catalog](https://coralogix.com/docs/user-guides/ai/app_catalog/index.md) instead.

## What you need

- A Coralogix account with a **Send-Your-Data API key**. In Coralogix, navigate to **Settings**, then **API Keys**.
- One or more coding agents installed and connected to Coralogix.

## Connect an agent

Each agent has its own setup guide. Complete the setup before opening the dashboard.

## Access Code Agents Intelligence

1. In Coralogix, navigate to **AI Center**, then the **Code agents** tab. You land directly on a single code agent's dashboard — switch agents using the picker at the top.
1. Use the time range picker to set the period you want to analyze.

Each agent's dashboard has four tabs: **Overview**, **Cost**, **Usage**, and **Users**.

## Overview

The Overview tab gives you the health snapshot you need before diving deeper—active models, total spend, and session volume for the selected period.

**Key Insights** surfaces the most critical metrics at a glance:

- **Models in use** — Primary models invoked across sessions.
- **Estimated total cost** — Spend calculated from token usage and model pricing.
- **Total sessions** — Number of Claude Code sessions in the selected period.

The **Cost summary** widget displays a trend line alongside the counter, so you can see direction at a glance without switching tabs.

## Cost

Gain a clear breakdown of where your AI spend is going—and who is driving it.

- **Model cost distribution** — A doughnut chart showing cost share by model. Use this to identify which models account for the majority of spend and whether that matches your intended usage.
- **High-spending users** — A ranked bar chart of users by estimated cost. Use this to detect outliers, verify that usage aligns with expectations, and prioritize conversations about responsible usage.
- **Activity** — Session and request volume over time, giving context to the cost figures.
- **Code impact** — Commits, pull requests, and AI suggestion acceptance rates correlated with cost. Use this to evaluate whether high-spend users are also driving proportional delivery output.
- **Productivity ratio** — The ratio of accepted AI suggestions to total suggestions generated. A higher ratio indicates that the output Claude generates closely aligns with developer intent.
- **Tool calls** — Breakdown of tools invoked by Claude during sessions (for example, file edits, shell commands, web searches), showing where Claude spends its execution budget.

## Cost in Claude Code

The Claude Code dashboard has a dedicated **Cost** tab that goes a step further, built to answer one question: where is your Claude Code spend going, and where can you cut it? Every figure is derived from Claude Code's own usage metrics over the time range and filters you've set.

Four numbers at the top give you the headline:

- **Total cost** and **Cost change** — spend for the period and how it compares to the previous equal period, so you see at a glance whether spend is rising or falling.
- **Avg cost per session** — total cost divided by sessions; a quick read on how expensive a typical Claude Code session is.
- **Cache hit rate** — how much of your input is served from cached context. A higher rate means you re-pay less for the same context — the single biggest lever on input-token cost.

Below them, **Token breakdown** splits usage into input, output, and cached tokens so you can see what's actually driving the bill, and **Cost over time** shows when spend spiked across the window.

Two tables tell you *what* and *who* is spending:

- **Cost by model** — cost, share of spend, cache hit rate, and effective cost per million tokens for each model. Use it to confirm spend sits on the models you intend, and to spot expensive models with poor cache reuse.
- **High-spending users** — your top spenders by cost, share, and tokens — the starting point for a usage conversation when a few people drive most of the bill.

**Optimization insights** turns those numbers into action: ranked, metric-based suggestions for cutting spend — for example, flagging when prompt caching is barely hitting and pointing you to the cache hit rate so you can expand caching and lower input-token cost. Each card links straight to the widget it relates to.

## Usage

Understand how Claude Code runs and what tangible code output it produces.

- **Session activity** — Session count and request volume over the selected period.
- **Code impact** — Commits, pull requests, and lines of code attributed to Claude Code sessions. Use this to correlate AI usage with real development output.
- **Acceptance rate** — The percentage of AI-generated suggestions accepted by developers. A declining acceptance rate can indicate model drift or context quality issues.
- **Tool calls** — Which tools Claude invoked most across sessions, helping you understand the operational patterns Claude follows.

## Users

Identify your most active users and investigate individual session patterns.

- **Active users** — Ranked list of users by cost in the selected period, with Sessions, Tokens, Active time, Lines of code, Commits, PRs, and Models per user.
- Select any user to drill into their session activity, token consumption, code impact, and model usage over time.

## Data scopes

Use [data scopes](https://coralogix.com/docs/user-guides/account-management/user-management/scopes/index.md) to restrict which code agent data each user can see. Scope support depends on the primary signal the dashboard for each agent runs on:

| Agent         | Primary signal | Scope support |
| ------------- | -------------- | ------------- |
| Claude Code   | Metrics        | Forthcoming   |
| Claude Cowork | Metrics        | Forthcoming   |
| Codex CLI     | Logs           | Available     |
| Copilot CLI   | Metrics        | Forthcoming   |
| Cursor        | Spans          | Available     |
| Gemini CLI    | Metrics        | Forthcoming   |

## Troubleshoot

**The Claude Code dashboard reports fewer tokens than a custom dashboard built on the same metric.**

When you compare token totals between the Claude Code dashboard and a Custom Dashboards widget built on the same metric, the Code Agents number can come out lower. The Code Agents widgets use PromQL `increase()` over the visible time range, and for short windows or sparse time series, `increase()` can skip individual data points — the resulting total ends up smaller than a raw counter sum. For longer time ranges, the two values converge.

If you need an exact counter total, build a [Custom Dashboards](https://coralogix.com/docs/user-guides/custom-dashboards/introduction/index.md) widget with `sum by (cx_application_name) (claude_code_token_usage_tokens_total{})`.

## Permissions

By default, the **Code agents** tab in AI Center is restricted to admins. Non-admins do not see it in the navigation. To grant access to additional roles, manage scopes and role bindings through [Permissions](https://coralogix.com/docs/user-guides/aaa/access-control/permissions/permissions-list/index.md).

## Next steps

Discover every AI model and integration in your codebase with [AI Security Posture Management](https://coralogix.com/docs/user-guides/ai/spm/index.md).
