claude_code_reports
Creates, updates, deletes, gets or lists a claude_code_reports resource.
Overview
| Name | claude_code_reports |
| Type | Resource |
| Id | anthropic_admin.usage.claude_code_reports |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
organization_id | string | Organization UUID. |
actor | string | The 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_metrics | string | Productivity metrics - `num_sessions`, `lines_of_code` (`added`/`removed`), `commits_by_claude_code`, `pull_requests_by_claude_code`. (opaque JSON object) |
customer_type | string | Type of customer account - `api` for API customers, `subscription` for Pro/Team customers. |
date | string | Date in RFC 3339 format (UTC timestamp). |
model_breakdown | array | Per-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_type | string | Type of terminal or environment where Claude Code was used (for example `vscode`, `iTerm.app`, `tmux`). |
tool_actions | string | Tool 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | starting_at | Get 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.
| Name | Datatype | Description |
|---|---|---|
starting_at | string | UTC date in YYYY-MM-DD format; returns metrics for this single day only. |
SELECT examples
- list
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
;