Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

feat(wrap): extend reduce-at-source quiet defaults to telemetry/nag banners (#2550)

Abhay Singh3a3a465bb129
diff --git a/headroom/cli/wrap.py b/headroom/cli/wrap.py
index 6852e0259..42ca8a6d0 100644
--- a/headroom/cli/wrap.py
+++ b/headroom/cli/wrap.py
@@ -439,7 +439,10 @@ _TOOL_SEARCH_FALSY = {"false", "0", "no", "off"}
# Opt out entirely with HEADROOM_WRAP_QUIET=0 (or false/no/off).
_QUIET_CLI_ENV = "HEADROOM_WRAP_QUIET"
_QUIET_CLI_FALSY = {"0", "false", "no", "off"}
-# name -> value, injected only when the user has not already set it.
+# name -> value, injected only when the user has not already set it. Every entry
+# here suppresses ONLY zero-signal chatter — telemetry pings, version nags,
+# funding/first-run banners, progress bars, pager framing — never diffs, errors,
+# summaries, or search results.
_QUIET_CLI_DEFAULTS: dict[str, str] = {
"GIT_PAGER": "cat", # never page (keeps full content, drops pager framing)
"PIP_QUIET": "1", # drop "Requirement already satisfied"/download chatter
@@ -447,6 +450,20 @@ _QUIET_CLI_DEFAULTS: dict[str, str] = {
"npm_config_fund": "false", # drop the funding banner
"npm_config_audit": "false", # drop the audit summary (not a security scan here)
"npm_config_progress": "false", # drop the install progress bar
+ "npm_config_update_notifier": "false", # drop the boxed "update available" notice
+ # Cross-tool telemetry opt-out standard (consoledonottrack.com), honored by
+ # turbo, netlify, gatsby, and many others to drop telemetry pings/banners.
+ "DO_NOT_TRACK": "1",
+ # .NET SDK: telemetry ping + the "Welcome to .NET" logo/copyright banner.
+ "DOTNET_CLI_TELEMETRY_OPTOUT": "1",
+ "DOTNET_NOLOGO": "1",
+ # JS framework telemetry banners printed on build/dev.
+ "NEXT_TELEMETRY_DISABLED": "1",
+ "GATSBY_TELEMETRY_DISABLED": "1",
+ "ASTRO_TELEMETRY_DISABLED": "1",
+ "NG_CLI_ANALYTICS": "false", # Angular CLI analytics ping + first-run prompt
+ # Homebrew's "==> ... hints" chatter (not warnings/errors).
+ "HOMEBREW_NO_ENV_HINTS": "1",
}
diff --git a/tests/test_wrap_quiet_cli.py b/tests/test_wrap_quiet_cli.py
index 0380916cb..479f46bc2 100644
--- a/tests/test_wrap_quiet_cli.py
+++ b/tests/test_wrap_quiet_cli.py
@@ -21,6 +21,28 @@ def test_defaults_injected_into_empty_env(monkeypatch) -> None:
assert "GIT_PAGER" in written and "PYTEST_ADDOPTS" in written
+def test_telemetry_and_nag_suppressors_injected(monkeypatch) -> None:
+ # Telemetry pings, version nags, and first-run/logo banners are zero-signal
+ # tokens; the SAFE reduce-at-source set suppresses them across common tools.
+ monkeypatch.delenv("HEADROOM_WRAP_QUIET", raising=False)
+ env: dict[str, str] = {}
+ written = _configure_quiet_cli_env(env)
+ expected = {
+ "npm_config_update_notifier": "false",
+ "DO_NOT_TRACK": "1",
+ "DOTNET_CLI_TELEMETRY_OPTOUT": "1",
+ "DOTNET_NOLOGO": "1",
+ "NEXT_TELEMETRY_DISABLED": "1",
+ "GATSBY_TELEMETRY_DISABLED": "1",
+ "ASTRO_TELEMETRY_DISABLED": "1",
+ "NG_CLI_ANALYTICS": "false",
+ "HOMEBREW_NO_ENV_HINTS": "1",
+ }
+ for name, value in expected.items():
+ assert env[name] == value
+ assert name in written
+
+
def test_user_value_always_wins(monkeypatch) -> None:
monkeypatch.delenv("HEADROOM_WRAP_QUIET", raising=False)
env = {"GIT_PAGER": "less -R", "PIP_QUIET": "0"}