claudeacp: Config.NoNonessentialTraffic and Config.ExportTelemetry #16

Merged
mikluko merged 1 commit from quiet-claude into main 2026-11-16 10:50:02 +00:00
Owner

spec-bb1.42, the library's part (the owner: nothing to third parties from Claude Code, the telemetry to his own collector, "возможно как опцию"). Two options beside TaskTools, both off by default (zero values keep today's behaviour) and both keeping a variable the environment already has, the agent's own or a session's _meta env:

  • Config.NoNonessentialTraffic sets CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY, DISABLE_AUTOUPDATER, CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL to 1. The list is from Claude Code's data-usage and env-vars documentation and measured (the finding-out is on spec-bb1.42): one say hi turn on claude 2.1.325 behind a logging CONNECT proxy opens 3 connections to api.anthropic.com by default and 1 with these set. The WebFetch domain check is a setting (skipWebFetchPreflight), not a variable; the README says it is not set.
  • Config.ExportTelemetry sets CLAUDE_CODE_ENABLE_TELEMETRY=1, OTEL_METRICS_EXPORTER=otlp, OTEL_LOGS_EXPORTER=otlp only when the environment names an OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT, or the metrics or logs one): with no address there is no export, and the address, protocol and resource attributes stay the deployment's (an OpenTelemetry operator's injection, for the sandbox). Measured: with every switch above set, claude still exports (two POST /v1/metrics and two POST /v1/logs to a local receiver in that turn), so the two options do not fight.

The three options' variables are set in one place (envDefaults) instead of one block each. Tests: TestNoNonessentialTrafficVariables, TestExportTelemetryVariables (off by default; set; the environment's and a session's value kept; no endpoint no export; a session's endpoint counts). README and changelog (Unreleased/Added). go test ./... -race and golangci-lint pass. No release here; the version is cut as 0.7.0 was, after review.

spec-bb1.42, the library's part (the owner: nothing to third parties from Claude Code, the telemetry to his own collector, "возможно как опцию"). Two options beside `TaskTools`, both off by default (zero values keep today's behaviour) and both keeping a variable the environment already has, the agent's own or a session's `_meta` env: - `Config.NoNonessentialTraffic` sets `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, `DISABLE_ERROR_REPORTING`, `DISABLE_FEEDBACK_COMMAND`, `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`, `DISABLE_AUTOUPDATER`, `CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL` to `1`. The list is from Claude Code's data-usage and env-vars documentation and measured (the finding-out is on spec-bb1.42): one `say hi` turn on claude 2.1.325 behind a logging CONNECT proxy opens 3 connections to `api.anthropic.com` by default and 1 with these set. The WebFetch domain check is a setting (`skipWebFetchPreflight`), not a variable; the README says it is not set. - `Config.ExportTelemetry` sets `CLAUDE_CODE_ENABLE_TELEMETRY=1`, `OTEL_METRICS_EXPORTER=otlp`, `OTEL_LOGS_EXPORTER=otlp` **only when the environment names an OTLP endpoint** (`OTEL_EXPORTER_OTLP_ENDPOINT`, or the metrics or logs one): with no address there is no export, and the address, protocol and resource attributes stay the deployment's (an OpenTelemetry operator's injection, for the sandbox). Measured: with every switch above set, claude still exports (two `POST /v1/metrics` and two `POST /v1/logs` to a local receiver in that turn), so the two options do not fight. The three options' variables are set in one place (`envDefaults`) instead of one block each. Tests: `TestNoNonessentialTrafficVariables`, `TestExportTelemetryVariables` (off by default; set; the environment's and a session's value kept; no endpoint no export; a session's endpoint counts). README and changelog (Unreleased/Added). `go test ./... -race` and golangci-lint pass. No release here; the version is cut as 0.7.0 was, after review.
claudeacp: Config.NoNonessentialTraffic and Config.ExportTelemetry
All checks were successful
CI / Changelog (pull_request) Successful in 9s
CI / Test (pull_request) Successful in 27s
CI / Lint (pull_request) Successful in 30s
61a8fd8fe1
NoNonessentialTraffic sets claude's switches for what it sends besides the
model's requests; ExportTelemetry turns its OTLP export on when the environment
names an endpoint. Both keep a variable the environment already has, and share
the place where the options' variables are set with TaskTools.

Assisted-By: Claude <noreply@anthropic.com>
mikluko deleted branch quiet-claude 2026-11-16 10:50:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/claudeacp!16
No description provided.