Skip to content
← Back to release · 2.1.280
New features / v2.1.280

Hook output size in OpenTelemetry events

CHANGELOG · original

Added hook output sizes and the number of oversized outputs saved to a file to the hook_execution_complete OpenTelemetry event
Open official changelog ↗

Documentation

Documentation excerpt

Hook execution complete event

Logged when all hooks for a hook event have finished.

Event Name: claude_code.hook_execution_complete

Attributes:

  • All standard attributes
  • event.name: "hook_execution_complete"
  • event.timestamp: ISO 8601 timestamp
  • event.sequence: per-process counter for ordering events, described under Event correlation attributes
  • hook_event: Hook event type
  • hook_name: Full hook name including matcher
  • num_hooks: Number of matching hook commands
  • num_success: Count that completed successfully
  • num_blocking: Count that returned a blocking decision
  • num_non_blocking_error: Count that failed without blocking
  • num_cancelled: Count cancelled before completion
  • total_duration_ms: Wall-clock duration of all matching hooks
  • stdout_chars: Total characters of stdout across the matching hooks that succeeded. Requires Claude Code v2.1.280 or later
  • additional_context_chars: Total characters of additionalContext returned by the matching hooks. Requires Claude Code v2.1.280 or later
  • system_message_chars: Total characters of systemMessage returned by the matching hooks. Requires Claude Code v2.1.280 or later
  • initial_user_message_chars: Total characters of initialUserMessage returned by the matching hooks. Requires Claude Code v2.1.280 or later
  • num_outputs_persisted: Number of hook outputs over the 10,000-character cap that Claude Code saved to a file. Requires Claude Code v2.1.280 or later
  • managed_only: "true" when only managed-policy hooks are permitted
  • hook_source: "policySettings" or "merged"
  • safe_mode: "true" when the session was started with --safe-mode, "false" otherwise. Requires Claude Code v2.1.169 or later
  • hook_definitions: JSON-serialized hook configuration. Included only when both detailed beta tracing and OTEL_LOG_TOOL_DETAILS=1 are enabled

Documentation snapshot · 2026-09-23

Change details