> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Instrument your coding agent

> Trace Claude Code, Codex, Cursor, and other coding agents in Arize AX to debug failures, track token cost, and review how agents are used.

Coding agents read files, edit code, call models, and run tools across many turns, mostly out of view. Arize AX records each turn as a trace so you can find the tool call that failed, see what drove the token bill, and review who ran what. Use that evidence to fix the agent's instructions and tools, then confirm the change on the next run.

## Connect your coding agent

Each guide covers installation, credentials, and content capture.

* [Claude Code](/docs/ax/integrations/platforms/claude-code/claude-code-tracing.md)
* [Codex](/docs/ax/integrations/platforms/codex/codex-tracing.md)
* [Cursor](/docs/ax/integrations/platforms/cursor/cursor-tracing.md)
* [GitHub Copilot](/docs/ax/integrations/platforms/copilot/copilot-tracing.md)
* [Gemini CLI](/docs/ax/integrations/platforms/gemini/gemini-tracing.md)
* [Kiro CLI](/docs/ax/integrations/platforms/kiro/kiro-tracing.md)
* [Antigravity](/docs/ax/integrations/platforms/antigravity/antigravity-tracing.md)
* [OpenCode](/docs/ax/integrations/platforms/opencode/opencode-tracing.md)
* [Devin](/docs/ax/integrations/platforms/devin/devin-tracing.md)
* [Oh My Pi](/docs/ax/integrations/platforms/oh-my-pi/oh-my-pi-tracing.md)

Run a coding task, then open the project in AX.

## Find a session

Open the project's [**Sessions** tab](/docs/ax/observe/tracing/view-and-manage-traces.md#the-sessions-tab). A [session](/docs/ax/instrument/set-up-sessions.md) groups every trace sharing a `session.id`, so one conversation appears as a sequence of turns. Filter by time range, session ID, or user ID, or sort by duration or token count.

![Claude Code session in Arize AX with conversation turns grouped by session ID](https://storage.googleapis.com/arize-assets/doc-images/claude-session.png)

Claude Code turns grouped in a session in Arize AX

## Investigate failures

Each turn is a trace with a span per model call or tool execution. Expand the span tree to inspect inputs, outputs, duration, and status.

![Claude Code trace in Arize AX showing the span tree and recorded inputs and outputs](https://storage.googleapis.com/arize-assets/doc-images/claude-trace.png)

Inspect model calls and tool activity inside a Claude Code turn

Take an agent stuck on a failing test. Find the turn where it first ran the test, read the tool output, then see what it did next. An edit followed by a retry is fine. Rerunning the same command unchanged is the behavior to fix. Tool output can show a failed test even when the span status is OK.

## Investigate cost and performance

Sort sessions by token count or duration and open the outliers. Look for repeated file reads, redundant model calls, long-running tools, and failed retries. Use [trace and span filters](/docs/ax/observe/tracing/view-and-manage-traces.md#querying-and-filters) to find the same pattern across sessions.

AX uses reported cost attributes when present, otherwise it prices token counts with the model's cost config. Recorded cost can differ from a coding tool's subscription bill. See [Track costs](/docs/ax/instrument/track-costs.md).

## Review activity and support governance

With user metadata captured, you can attribute a session to a person and review its tools, commands, and outputs. Each integration has flags for capturing prompt text, tool arguments, and tool output. Set them before collecting sessions.

Tracing records activity. It does not enforce permissions or spending limits, and local tracing config does not guarantee every action is recorded.

## Improve and monitor across sessions

Turn what you find into a change, such as clarifying the test command in the agent's instructions, then rerun similar tasks and check that retries drop.

* Run [trace and session evaluations](/docs/ax/evaluate/trace-and-session-evals.md) across runs, with test results as evidence.
* Save [custom views](/docs/ax/observe/create-custom-views.md) for recurring checks such as tool errors or high-token traces.
* Build [dashboards](/docs/ax/observe/dashboards.md) and [monitors](/docs/ax/observe/production-monitoring.md) for latency, token usage, and recurring errors.

A completed trace does not prove the code is correct, and volume does not measure productivity.

## Capture coverage

Coverage varies by agent. Cursor CLI exposes fewer events than Cursor IDE, and OpenCode subagent sessions are traced separately from their parent. Your integration guide lists what is captured.
