Skip to main content

claude_code_reports

Creates, updates, deletes, gets or lists a claude_code_reports resource.

Overview

Nameclaude_code_reports
TypeResource
Idanthropic_admin.usage.claude_code_reports

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
organization_idstringOrganization UUID.
actorstringThe user or API key that performed the Claude Code actions - either a `user_actor` with `email_address` or an `api_actor` with `api_key_name`. (opaque JSON object)
core_metricsstringProductivity metrics - `num_sessions`, `lines_of_code` (`added`/`removed`), `commits_by_claude_code`, `pull_requests_by_claude_code`. (opaque JSON object)
customer_typestringType of customer account - `api` for API customers, `subscription` for Pro/Team customers.
datestringDate in RFC 3339 format (UTC timestamp).
model_breakdownarrayPer-model token counts and estimated costs. Each item carries `model`, `tokens` (input/output/cache_read/cache_creation) and `estimated_cost` (amount in cents USD, currency).
terminal_typestringType of terminal or environment where Claude Code was used (for example `vscode`, `iTerm.app`, `tmux`).
tool_actionsstringTool action acceptance/rejection counts by tool type (`edit_tool`, `multi_edit_tool`, `write_tool`, `notebook_edit_tool`). (opaque JSON object)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectstarting_atGet daily aggregated Claude Code usage analytics. Each record represents one actor's activity for the single UTC day specified by starting_at.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
starting_atstringUTC date in YYYY-MM-DD format; returns metrics for this single day only.

SELECT examples

Get daily aggregated Claude Code usage analytics. Each record represents one actor's activity for the single UTC day specified by starting_at.

SELECT
organization_id,
actor,
core_metrics,
customer_type,
date,
model_breakdown,
terminal_type,
tool_actions
FROM anthropic_admin.usage.claude_code_reports
WHERE starting_at = '{{ starting_at }}' -- required
;