203| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |203| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
204| `user_prompt` | Prompt text. Value is `<REDACTED>` unless the gate is set | `OTEL_LOG_USER_PROMPTS` |204| `user_prompt` | Prompt text. Value is `<REDACTED>` unless the gate is set | `OTEL_LOG_USER_PROMPTS` |
205| `user_prompt_length` | Prompt length in characters | |205| `user_prompt_length` | Prompt length in characters | |
206| `interaction.sequence` | 1-based counter of interactions in this session | |206| `interaction.sequence` | 1-based counter of interactions, counted per Claude Code process rather than per session, as described for [`event.sequence`](#event-correlation-attributes) | |
207| `parent.source` | How the span got its trace parent: `env` when it parented under an inbound `TRACEPARENT`, `none` when it started its own trace. Requires Claude Code v2.1.268 or later | |207| `parent.source` | How the span got its trace parent: `env` when it parented under an inbound `TRACEPARENT`, `none` when it started its own trace. Requires Claude Code v2.1.268 or later | |
208| `interaction.duration_ms` | Wall-clock duration of the turn | |208| `interaction.duration_ms` | Wall-clock duration of the turn | |
209 209
625| Attribute | Description |625| Attribute | Description |
626| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |626| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
627| `prompt.id` | UUID v4 identifier linking all events produced while processing a single user prompt |627| `prompt.id` | UUID v4 identifier linking all events produced while processing a single user prompt |
628| `event.sequence` | 0-based counter for ordering events, counted per Claude Code process rather than per session |
628| `message.uuid` | UUID of the message as persisted in the session transcript, the `~/.claude/projects/*/*.jsonl` files. Present on `assistant_response`, and on `user_prompt` except for command dispatches, which can produce zero or many messages. On `assistant_response`, this is the response's final transcript entry, which the next turn's `parentUuid` chains from. Requires Claude Code v2.1.214 or later |629| `message.uuid` | UUID of the message as persisted in the session transcript, the `~/.claude/projects/*/*.jsonl` files. Present on `assistant_response`, and on `user_prompt` except for command dispatches, which can produce zero or many messages. On `assistant_response`, this is the response's final transcript entry, which the next turn's `parentUuid` chains from. Requires Claude Code v2.1.214 or later |
629| `client_request_id` | Client-generated UUID sent as the `x-client-request-id` request header. Present on `api_request` and `api_error` on first-party API connections; absent on third-party provider backends and when the request was retried through the non-streaming fallback. Pairs a request with its response and remains available for failures such as timeouts that never produced a server `request_id`. Matches the same attribute on the `llm_request` trace span. Requires Claude Code v2.1.214 or later |630| `client_request_id` | Client-generated UUID sent as the `x-client-request-id` request header. Present on `api_request` and `api_error` on first-party API connections; absent on third-party provider backends and when the request was retried through the non-streaming fallback. Pairs a request with its response and remains available for failures such as timeouts that never produced a server `request_id`. Matches the same attribute on the `llm_request` trace span. Requires Claude Code v2.1.214 or later |
630 631
631To trace all activity triggered by a single prompt, filter your events by a specific `prompt.id` value. This returns the user\_prompt event, any api\_request events, and any tool\_result events that occurred while processing that prompt.632To trace all activity triggered by a single prompt, filter your events by a specific `prompt.id` value. This returns the user\_prompt event, any api\_request events, and any tool\_result events that occurred while processing that prompt.
632 633
634`event.sequence` starts at 0 each time a Claude Code process starts and counts up for the life of that process. It keeps counting across `/clear`, which assigns a new `session.id`. If you [resume a session without forking](/docs/en/how-claude-code-works#resume-or-fork-sessions), the session keeps its `session.id` but takes its `event.sequence` values from the process that resumed it, so within one session a later event can carry a lower value than an earlier one, or repeat one. To order a session's events, sort by `event.timestamp` and use `event.sequence` to order events that share a timestamp.
635
633For message-level reconstruction, each event class carries a key that matches a field in the session transcript. The transcript entry format is [internal to Claude Code](/docs/en/sessions#where-transcripts-are-stored) and changes between versions, so a pipeline that joins on these fields can break on any release; treat the joins as version-specific rather than a stable contract:636For message-level reconstruction, each event class carries a key that matches a field in the session transcript. The transcript entry format is [internal to Claude Code](/docs/en/sessions#where-transcripts-are-stored) and changes between versions, so a pipeline that joins on these fields can break on any release; treat the joins as version-specific rather than a stable contract:
634 637
635* `message.uuid` on `user_prompt` and `assistant_response`638* `message.uuid` on `user_prompt` and `assistant_response`
647* All [standard attributes](#standard-attributes)650* All [standard attributes](#standard-attributes)
648* `event.name`: `"user_prompt"`651* `event.name`: `"user_prompt"`
649* `event.timestamp`: ISO 8601 timestamp652* `event.timestamp`: ISO 8601 timestamp
650* `event.sequence`: monotonically increasing counter for ordering events within a session653* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
651* `prompt_length`: Length of the prompt654* `prompt_length`: Length of the prompt
652* `prompt`: Prompt content. Redacted by default. Set `OTEL_LOG_USER_PROMPTS=1` to include it655* `prompt`: Prompt content. Redacted by default. Set `OTEL_LOG_USER_PROMPTS=1` to include it
653* `message.uuid`: UUID of the resulting user message, matching the persisted transcript entry. Absent on command dispatches, which can produce zero or many messages. Requires Claude Code v2.1.214 or later656* `message.uuid`: UUID of the resulting user message, matching the persisted transcript entry. Absent on command dispatches, which can produce zero or many messages. Requires Claude Code v2.1.214 or later
665* All [standard attributes](#standard-attributes)668* All [standard attributes](#standard-attributes)
666* `event.name`: `"assistant_response"`669* `event.name`: `"assistant_response"`
667* `event.timestamp`: ISO 8601 timestamp670* `event.timestamp`: ISO 8601 timestamp
668* `event.sequence`: monotonically increasing counter for ordering events within a session671* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
669* `response_length`: Length of the response text in characters672* `response_length`: Length of the response text in characters
670* `response`: Response text, truncated at the content limit (60 KB by default). Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on673* `response`: Response text, truncated at the content limit (60 KB by default). Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on
671* `model`: Model identifier (for example, "claude-sonnet-5")674* `model`: Model identifier (for example, "claude-sonnet-5")
684* All [standard attributes](#standard-attributes)687* All [standard attributes](#standard-attributes)
685* `event.name`: `"tool_result"`688* `event.name`: `"tool_result"`
686* `event.timestamp`: ISO 8601 timestamp689* `event.timestamp`: ISO 8601 timestamp
687* `event.sequence`: monotonically increasing counter for ordering events within a session690* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
688* `tool_name`: Name of the tool691* `tool_name`: Name of the tool
689* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.692* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.
690* `success`: `"true"` or `"false"`693* `success`: `"true"` or `"false"`
716* All [standard attributes](#standard-attributes)719* All [standard attributes](#standard-attributes)
717* `event.name`: `"api_request"`720* `event.name`: `"api_request"`
718* `event.timestamp`: ISO 8601 timestamp721* `event.timestamp`: ISO 8601 timestamp
719* `event.sequence`: monotonically increasing counter for ordering events within a session722* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
720* `model`: Model used (for example, "claude-sonnet-5")723* `model`: Model used (for example, "claude-sonnet-5")
721* `cost_usd`: Estimated cost in USD724* `cost_usd`: Estimated cost in USD
722* `cost_usd_micros`: Estimated cost in millionths of a US dollar, emitted as an integer725* `cost_usd_micros`: Estimated cost in millionths of a US dollar, emitted as an integer
743* All [standard attributes](#standard-attributes)746* All [standard attributes](#standard-attributes)
744* `event.name`: `"api_error"`747* `event.name`: `"api_error"`
745* `event.timestamp`: ISO 8601 timestamp748* `event.timestamp`: ISO 8601 timestamp
746* `event.sequence`: monotonically increasing counter for ordering events within a session749* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
747* `model`: Model used (for example, "claude-sonnet-5")750* `model`: Model used (for example, "claude-sonnet-5")
748* `error`: Error message751* `error`: Error message
749* `status_code`: HTTP status code as a number. Absent for non-HTTP errors such as connection failures.752* `status_code`: HTTP status code as a number. Absent for non-HTTP errors such as connection failures.
767* All [standard attributes](#standard-attributes)770* All [standard attributes](#standard-attributes)
768* `event.name`: `"api_refusal"`771* `event.name`: `"api_refusal"`
769* `event.timestamp`: ISO 8601 timestamp772* `event.timestamp`: ISO 8601 timestamp
770* `event.sequence`: monotonically increasing counter for ordering events within a session773* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
771* `model`: Model identifier from the request774* `model`: Model identifier from the request
772* `request_id`: Anthropic API request ID from the response's `request-id` header, such as `"req_011..."`. Present only when the API returns one.775* `request_id`: Anthropic API request ID from the response's `request-id` header, such as `"req_011..."`. Present only when the API returns one.
773* `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name. See [`api_request`](#api-request-event) for definitions.776* `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name. See [`api_request`](#api-request-event) for definitions.
791* All [standard attributes](#standard-attributes)794* All [standard attributes](#standard-attributes)
792* `event.name`: `"api_request_body"`795* `event.name`: `"api_request_body"`
793* `event.timestamp`: ISO 8601 timestamp796* `event.timestamp`: ISO 8601 timestamp
794* `event.sequence`: monotonically increasing counter for ordering events within a session797* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
795* `body`: JSON-serialized Messages API request parameters, such as the system prompt, messages, and tools, truncated at the content limit (60 KB by default). Extended-thinking content in prior assistant turns is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`).798* `body`: JSON-serialized Messages API request parameters, such as the system prompt, messages, and tools, truncated at the content limit (60 KB by default). Extended-thinking content in prior assistant turns is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`).
796* `body_ref`: Absolute path to a `<dir>/<uuid>.request.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`).799* `body_ref`: Absolute path to a `<dir>/<uuid>.request.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`).
797* `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1`800* `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1`
810* All [standard attributes](#standard-attributes)813* All [standard attributes](#standard-attributes)
811* `event.name`: `"api_response_body"`814* `event.name`: `"api_response_body"`
812* `event.timestamp`: ISO 8601 timestamp815* `event.timestamp`: ISO 8601 timestamp
813* `event.sequence`: monotonically increasing counter for ordering events within a session816* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
814* `body`: JSON-serialized Messages API response, including the id, content blocks, usage, and stop reason, truncated at the content limit (60 KB by default). Extended-thinking content is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`).817* `body`: JSON-serialized Messages API response, including the id, content blocks, usage, and stop reason, truncated at the content limit (60 KB by default). Extended-thinking content is redacted. Emitted only in inline mode (`OTEL_LOG_RAW_API_BODIES=1`).
815* `body_ref`: Absolute path to a `<dir>/<request_id>.response.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`).818* `body_ref`: Absolute path to a `<dir>/<request_id>.response.json` file containing the untruncated body. Emitted only in file mode (`OTEL_LOG_RAW_API_BODIES=file:<dir>`).
816* `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1`819* `body_length`: Untruncated body length. UTF-8 bytes when `OTEL_LOG_RAW_API_BODIES=file:<dir>`, or UTF-16 code units when `=1`
830* All [standard attributes](#standard-attributes)833* All [standard attributes](#standard-attributes)
831* `event.name`: `"tool_decision"`834* `event.name`: `"tool_decision"`
832* `event.timestamp`: ISO 8601 timestamp835* `event.timestamp`: ISO 8601 timestamp
833* `event.sequence`: monotonically increasing counter for ordering events within a session836* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
834* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")837* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")
835* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.838* `tool_use_id`: Unique identifier for this tool invocation. Matches the `tool_use_id` passed to hooks, allowing correlation between OTel events and hook-captured data.
836* `decision`: Either `"accept"` or `"reject"`839* `decision`: Either `"accept"` or `"reject"`
863* All [standard attributes](#standard-attributes)866* All [standard attributes](#standard-attributes)
864* `event.name`: `"permission_mode_changed"`867* `event.name`: `"permission_mode_changed"`
865* `event.timestamp`: ISO 8601 timestamp868* `event.timestamp`: ISO 8601 timestamp
866* `event.sequence`: monotonically increasing counter for ordering events within a session869* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
867* `from_mode`: The previous permission mode, for example `"default"`, `"plan"`, `"acceptEdits"`, `"auto"`, or `"bypassPermissions"`870* `from_mode`: The previous permission mode, for example `"default"`, `"plan"`, `"acceptEdits"`, `"auto"`, or `"bypassPermissions"`
868* `to_mode`: The new permission mode871* `to_mode`: The new permission mode
869* `trigger`: What caused the change. One of `"shift_tab"`, `"exit_plan_mode"`, `"auto_gate_denied"`, or `"auto_opt_in"`. Absent when the transition originates from the SDK or bridge872* `trigger`: What caused the change. One of `"shift_tab"`, `"exit_plan_mode"`, `"auto_gate_denied"`, or `"auto_opt_in"`. Absent when the transition originates from the SDK or bridge
879* All [standard attributes](#standard-attributes)882* All [standard attributes](#standard-attributes)
880* `event.name`: `"auth"`883* `event.name`: `"auth"`
881* `event.timestamp`: ISO 8601 timestamp884* `event.timestamp`: ISO 8601 timestamp
882* `event.sequence`: monotonically increasing counter for ordering events within a session885* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
883* `action`: `"login"` or `"logout"`886* `action`: `"login"` or `"logout"`
884* `success`: `"true"` or `"false"`887* `success`: `"true"` or `"false"`
885* `auth_method`: Authentication method, such as `"oauth"`888* `auth_method`: Authentication method, such as `"oauth"`
897* All [standard attributes](#standard-attributes)900* All [standard attributes](#standard-attributes)
898* `event.name`: `"mcp_server_connection"`901* `event.name`: `"mcp_server_connection"`
899* `event.timestamp`: ISO 8601 timestamp902* `event.timestamp`: ISO 8601 timestamp
900* `event.sequence`: monotonically increasing counter for ordering events within a session903* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
901* `status`: `"connected"`, `"failed"`, or `"disconnected"`904* `status`: `"connected"`, `"failed"`, or `"disconnected"`
902* `transport_type`: Server transport, such as `"stdio"`, `"sse"`, or `"http"`905* `transport_type`: Server transport, such as `"stdio"`, `"sse"`, or `"http"`
903* `server_scope`: Scope the server is configured at, such as `"user"`, `"project"`, or `"local"`906* `server_scope`: Scope the server is configured at, such as `"user"`, `"project"`, or `"local"`
920* All [standard attributes](#standard-attributes)923* All [standard attributes](#standard-attributes)
921* `event.name`: `"internal_error"`924* `event.name`: `"internal_error"`
922* `event.timestamp`: ISO 8601 timestamp925* `event.timestamp`: ISO 8601 timestamp
923* `event.sequence`: monotonically increasing counter for ordering events within a session926* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
924* `error_name`: Error class name, such as `"TypeError"` or `"SyntaxError"`927* `error_name`: Error class name, such as `"TypeError"` or `"SyntaxError"`
925* `error_code`: Node.js errno code such as `"ENOENT"` when present on the error928* `error_code`: Node.js errno code such as `"ENOENT"` when present on the error
926 929
935* All [standard attributes](#standard-attributes)938* All [standard attributes](#standard-attributes)
936* `event.name`: `"plugin_installed"`939* `event.name`: `"plugin_installed"`
937* `event.timestamp`: ISO 8601 timestamp940* `event.timestamp`: ISO 8601 timestamp
938* `event.sequence`: monotonically increasing counter for ordering events within a session941* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
939* `marketplace.is_official`: `"true"` if the marketplace is an official Anthropic marketplace, `"false"` otherwise942* `marketplace.is_official`: `"true"` if the marketplace is an official Anthropic marketplace, `"false"` otherwise
940* `install.trigger`: `"cli"` or `"ui"`943* `install.trigger`: `"cli"` or `"ui"`
941* `plugin.name`: Name of the installed plugin. For third-party marketplaces this is included only when `OTEL_LOG_TOOL_DETAILS=1`944* `plugin.name`: Name of the installed plugin. For third-party marketplaces this is included only when `OTEL_LOG_TOOL_DETAILS=1`
953* All [standard attributes](#standard-attributes)956* All [standard attributes](#standard-attributes)
954* `event.name`: `"plugin_loaded"`957* `event.name`: `"plugin_loaded"`
955* `event.timestamp`: ISO 8601 timestamp958* `event.timestamp`: ISO 8601 timestamp
956* `event.sequence`: monotonically increasing counter for ordering events within a session959* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
957* `plugin.name`: name of the plugin. For plugins outside the official marketplace and built-in bundle the value is `"third-party"` unless `OTEL_LOG_TOOL_DETAILS=1`960* `plugin.name`: name of the plugin. For plugins outside the official marketplace and built-in bundle the value is `"third-party"` unless `OTEL_LOG_TOOL_DETAILS=1`
958* `marketplace.name`: marketplace the plugin was installed from, when known. Redacted to `"third-party"` under the same condition as `plugin.name`961* `marketplace.name`: marketplace the plugin was installed from, when known. Redacted to `"third-party"` under the same condition as `plugin.name`
959* `plugin.version`: version from the plugin manifest. Included only when the name is not redacted and the manifest declares a version962* `plugin.version`: version from the plugin manifest. Included only when the name is not redacted and the manifest declares a version
979* All [standard attributes](#standard-attributes)982* All [standard attributes](#standard-attributes)
980* `event.name`: `"skill_activated"`983* `event.name`: `"skill_activated"`
981* `event.timestamp`: ISO 8601 timestamp984* `event.timestamp`: ISO 8601 timestamp
982* `event.sequence`: monotonically increasing counter for ordering events within a session985* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
983* `skill.name`: Name of the skill. For user-defined and third-party plugin skills the value is the placeholder `"custom_skill"` unless `OTEL_LOG_TOOL_DETAILS=1`986* `skill.name`: Name of the skill. For user-defined and third-party plugin skills the value is the placeholder `"custom_skill"` unless `OTEL_LOG_TOOL_DETAILS=1`
984* `invocation_trigger`: How the skill was triggered (`"user-slash"`, `"claude-proactive"`, or `"nested-skill"`)987* `invocation_trigger`: How the skill was triggered (`"user-slash"`, `"claude-proactive"`, or `"nested-skill"`)
985* `skill.source`: Where the skill was loaded from (for example, `"bundled"`, `"userSettings"`, `"projectSettings"`, `"plugin"`)988* `skill.source`: Where the skill was loaded from (for example, `"bundled"`, `"userSettings"`, `"projectSettings"`, `"plugin"`)
998* All [standard attributes](#standard-attributes)1001* All [standard attributes](#standard-attributes)
999* `event.name`: `"at_mention"`1002* `event.name`: `"at_mention"`
1000* `event.timestamp`: ISO 8601 timestamp1003* `event.timestamp`: ISO 8601 timestamp
1001* `event.sequence`: monotonically increasing counter for ordering events within a session1004* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1002* `mention_type`: Type of mention (`"file"`, `"directory"`, `"agent"`, `"mcp_resource"`, `"peer"`). The `"peer"` value means you mentioned [one of your other Claude Code sessions](/docs/en/cross-session-messaging). Requires Claude Code v2.1.232 or later1005* `mention_type`: Type of mention (`"file"`, `"directory"`, `"agent"`, `"mcp_resource"`, `"peer"`). The `"peer"` value means you mentioned [one of your other Claude Code sessions](/docs/en/cross-session-messaging). Requires Claude Code v2.1.232 or later
1003* `success`: Whether the mention resolved successfully (`"true"` or `"false"`)1006* `success`: Whether the mention resolved successfully (`"true"` or `"false"`)
1004 1007
1013* All [standard attributes](#standard-attributes)1016* All [standard attributes](#standard-attributes)
1014* `event.name`: `"api_retries_exhausted"`1017* `event.name`: `"api_retries_exhausted"`
1015* `event.timestamp`: ISO 8601 timestamp1018* `event.timestamp`: ISO 8601 timestamp
1016* `event.sequence`: monotonically increasing counter for ordering events within a session1019* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1017* `model`: Model used1020* `model`: Model used
1018* `error`: Final error message1021* `error`: Final error message
1019* `status_code`: HTTP status code as a number. Absent for non-HTTP errors.1022* `status_code`: HTTP status code as a number. Absent for non-HTTP errors.
1032* All [standard attributes](#standard-attributes)1035* All [standard attributes](#standard-attributes)
1033* `event.name`: `"hook_registered"`1036* `event.name`: `"hook_registered"`
1034* `event.timestamp`: ISO 8601 timestamp1037* `event.timestamp`: ISO 8601 timestamp
1035* `event.sequence`: monotonically increasing counter for ordering events within a session1038* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1036* `hook_event`: hook event type, such as `"PreToolUse"` or `"PostToolUse"`1039* `hook_event`: hook event type, such as `"PreToolUse"` or `"PostToolUse"`
1037* `hook_type`: hook implementation type: `"command"`, `"prompt"`, `"mcp_tool"`, `"http"`, or `"agent"`1040* `hook_type`: hook implementation type: `"command"`, `"prompt"`, `"mcp_tool"`, `"http"`, or `"agent"`
1038* `hook_source`: where the hook is defined: `"userSettings"`, `"projectSettings"`, `"localSettings"`, `"flagSettings"`, `"policySettings"`, or `"pluginHook"`1041* `hook_source`: where the hook is defined: `"userSettings"`, `"projectSettings"`, `"localSettings"`, `"flagSettings"`, `"policySettings"`, or `"pluginHook"`
1052* All [standard attributes](#standard-attributes)1055* All [standard attributes](#standard-attributes)
1053* `event.name`: `"hook_execution_start"`1056* `event.name`: `"hook_execution_start"`
1054* `event.timestamp`: ISO 8601 timestamp1057* `event.timestamp`: ISO 8601 timestamp
1055* `event.sequence`: monotonically increasing counter for ordering events within a session1058* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1056* `hook_event`: Hook event type, such as `"PreToolUse"` or `"PostToolUse"`1059* `hook_event`: Hook event type, such as `"PreToolUse"` or `"PostToolUse"`
1057* `hook_name`: Full hook name including matcher, such as `"PreToolUse:Write"`1060* `hook_name`: Full hook name including matcher, such as `"PreToolUse:Write"`
1058* `num_hooks`: Number of matching hook commands1061* `num_hooks`: Number of matching hook commands
1072* All [standard attributes](#standard-attributes)1075* All [standard attributes](#standard-attributes)
1073* `event.name`: `"hook_execution_complete"`1076* `event.name`: `"hook_execution_complete"`
1074* `event.timestamp`: ISO 8601 timestamp1077* `event.timestamp`: ISO 8601 timestamp
1075* `event.sequence`: monotonically increasing counter for ordering events within a session1078* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1076* `hook_event`: Hook event type1079* `hook_event`: Hook event type
1077* `hook_name`: Full hook name including matcher1080* `hook_name`: Full hook name including matcher
1078* `num_hooks`: Number of matching hook commands1081* `num_hooks`: Number of matching hook commands
1097* All [standard attributes](#standard-attributes)1100* All [standard attributes](#standard-attributes)
1098* `event.name`: `"hook_plugin_metrics"`1101* `event.name`: `"hook_plugin_metrics"`
1099* `event.timestamp`: ISO 8601 timestamp1102* `event.timestamp`: ISO 8601 timestamp
1100* `event.sequence`: monotonically increasing counter for ordering events within a session1103* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1101* `plugin_id`: plugin identifier in `<name>@<marketplace>` form1104* `plugin_id`: plugin identifier in `<name>@<marketplace>` form
1102* `hook_event`: hook event type that emitted the metrics1105* `hook_event`: hook event type that emitted the metrics
1103* Up to 20 plugin-emitted metric keys. Names match `^[a-z][a-z0-9_]{0,39}$`. Values are boolean or number.1106* Up to 20 plugin-emitted metric keys. Names match `^[a-z][a-z0-9_]{0,39}$`. Values are boolean or number.
1113* All [standard attributes](#standard-attributes)1116* All [standard attributes](#standard-attributes)
1114* `event.name`: `"compaction"`1117* `event.name`: `"compaction"`
1115* `event.timestamp`: ISO 8601 timestamp1118* `event.timestamp`: ISO 8601 timestamp
1116* `event.sequence`: monotonically increasing counter for ordering events within a session1119* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1117* `trigger`: `"auto"` or `"manual"`1120* `trigger`: `"auto"` or `"manual"`
1118* `success`: `"true"` or `"false"`1121* `success`: `"true"` or `"false"`
1119* `duration_ms`: Compaction duration1122* `duration_ms`: Compaction duration
1133* All [standard attributes](#standard-attributes)1136* All [standard attributes](#standard-attributes)
1134* `event.name`: `"subagent_completed"`1137* `event.name`: `"subagent_completed"`
1135* `event.timestamp`: ISO 8601 timestamp1138* `event.timestamp`: ISO 8601 timestamp
1136* `event.sequence`: monotonically increasing counter for ordering events within a session1139* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1137* `agent_type`: The subagent type. Built-in agent names and agents from official-marketplace plugins appear verbatim; other agent names are replaced with `"custom"` unless `OTEL_LOG_TOOL_DETAILS=1` is set1140* `agent_type`: The subagent type. Built-in agent names and agents from official-marketplace plugins appear verbatim; other agent names are replaced with `"custom"` unless `OTEL_LOG_TOOL_DETAILS=1` is set
1138* `agent.source`: Where the agent definition came from: `built-in`, `plugin`, or the settings source that defined a custom agent, such as `userSettings` or `projectSettings`1141* `agent.source`: Where the agent definition came from: `built-in`, `plugin`, or the settings source that defined a custom agent, such as `userSettings` or `projectSettings`
1139* `is_built_in`: Whether the subagent is a built-in agent type1142* `is_built_in`: Whether the subagent is a built-in agent type
1157* All [standard attributes](#standard-attributes)1160* All [standard attributes](#standard-attributes)
1158* `event.name`: `"feedback_survey"`1161* `event.name`: `"feedback_survey"`
1159* `event.timestamp`: ISO 8601 timestamp1162* `event.timestamp`: ISO 8601 timestamp
1160* `event.sequence`: monotonically increasing counter for ordering events within a session1163* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1161* `event_type`: Survey lifecycle event, for example `"appeared"`, `"responded"`, or `"transcript_prompt_appeared"`1164* `event_type`: Survey lifecycle event, for example `"appeared"`, `"responded"`, or `"transcript_prompt_appeared"`
1162* `appearance_id`: Unique ID linking the events emitted for one survey instance1165* `appearance_id`: Unique ID linking the events emitted for one survey instance
1163* `survey_type`: Which survey produced the event. `"session"` is the "How is Claude doing?" rating prompt1166* `survey_type`: Which survey produced the event. `"session"` is the "How is Claude doing?" rating prompt
1179* All [standard attributes](#standard-attributes)1182* All [standard attributes](#standard-attributes)
1180* `event.name`: `"retention_sweep"`1183* `event.name`: `"retention_sweep"`
1181* `event.timestamp`: ISO 8601 timestamp1184* `event.timestamp`: ISO 8601 timestamp
1182* `event.sequence`: monotonically increasing counter for ordering events within a session1185* `event.sequence`: per-process counter for ordering events, described under [Event correlation attributes](#event-correlation-attributes)
1183* `result`: `"complete"` when the sweep ran, `"skipped"` when Claude Code paused it1186* `result`: `"complete"` when the sweep ran, `"skipped"` when Claude Code paused it
1184* `period_days`: The `cleanupPeriodDays` value from merged settings, in days, or `30` when no source sets it. On skipped events, the value the sweep would have used, computed from the settings sources Claude Code could read1187* `period_days`: The `cleanupPeriodDays` value from merged settings, in days, or `30` when no source sets it. On skipped events, the value the sweep would have used, computed from the settings sources Claude Code could read
1185* `used_default`: `"true"` when no readable settings source sets `cleanupPeriodDays`, `"false"` otherwise. On complete events, `"true"` means the 30-day default applied1188* `used_default`: `"true"` when no readable settings source sets `cleanupPeriodDays`, `"false"` otherwise. On complete events, `"true"` means the 30-day default applied