Disable Telemetry
Strip Datadog and first-party analytics calls from the bundle.
ID disable-telemetry · Default on · Compatible * · Source
What it does
Stops both outbound analytics paths in a running Claude Code:
- The Datadog log exporter (
https://http-intake.logs.us5.datadoghq.com/...) never flushes, and its endpoint URL is blanked as an extra safeguard. - The first-party event logger (OpenTelemetry exporter tagged
com.anthropic.claude_code.events) never initializes, which also stops retries of previously-queued events.
Nothing gets sent over the wire. If analytics events are produced internally, they just sit in a queue that never drains.
How it works
Three surgical cuts:
- Kill the analytics sink.
initializeAnalyticsSink()callsattachAnalyticsSink({ logEvent, logEventAsync }). The patch finds that call by looking for aCallExpressionwhose sole argument is an object literal containing bothlogEventandlogEventAsynckeys, then rewrites it tovoid 0. With no sink attached,logEvent()just pushes to an internal queue that nothing drains. - Noop the Datadog flush.
flushLogs()is identified by containing the"DD-API-KEY"header string. The patch picks the smallest zero-parameter function that contains the string (there's a module wrapper around it) and insertsreturn;at the top of its body. It also replaces the Datadog endpoint literal with""as belt-and-braces. - Noop the 1P init.
initialize1PEventLogging()is identified by the instrumentation-scope string"com.anthropic.claude_code.events". Same treatment — smallest zero-parameter container, early return at the top.