All News
huggingfacecoding-agentstelemetryopen-sourcedeveloper-tools

A Reddit teardown called huggingface_hub's agent tracking silent. Hugging Face published a blog post and a traffic chart.

A Reddit post says Hugging Face's Python client secretly fingerprints your coding agent. The source code and a two-day-old bug report tell a narrower story.

Vlad MakarovVlad Makarovreviewed and published
5 min read
A Reddit teardown called huggingface_hub's agent tracking silent. Hugging Face published a blog post and a traffic chart.

On September 12, a post on r/LocalLLM claimed the huggingface_hub Python package "silently fingerprints which AI coding agent you're using and sends it as telemetry." Posted at 16:45 UTC by u/Xylon95, it collected roughly 250 upvotes and about 45 comments over the following day. The central evidence is real: the client contains a detection module, that module reads environment variables, and what it finds travels with Hub requests. The word "silently" is the part that does not hold up, and the sharpest finding attached to this story is a bug report filed two days before the post, in the same client.

What the teardown found

Tracing an unexpected HTTPS connection from a local ASR model, u/Xylon95 opened his Hugging Face cache and found ~/.cache/huggingface/.agent_harnesses.json, a roughly 6 KB registry of 26 AI coding agents keyed by the environment variables each one sets. He named the module _detect_agent.py; on main it lives at src/huggingface_hub/utils/_detect_agent.py. It is real, Apache-2.0 licensed and dated 2026. Its docstring opens with "Detect whether the process is being invoked by an AI coding agent," and notes that AI_AGENT and AGENT are treated as a universal standard while tool-specific checks are "ordered by priority (first match wins)."

The signals it keys on are short and public.

AgentEnvironment variable
CursorCURSOR_TRACE_ID
Claude CodeCLAUDECODE / CLAUDE_CODE
CopilotCOPILOT_MODEL / COPILOT_GITHUB_TOKEN
Any registered harnessAI_AGENT or AGENT

Where the post was wrong about how it works

The registry is not compiled into any release. It is served by the Hub from {ENDPOINT}/api/agent-harnesses, fetched "at most once a day" and cached locally "so the list can be updated without requiring a new client release." That explains the 24-hour refresh he observed, and why his suggested block, HF_HUB_OFFLINE=1, switches the fetch off entirely. The code uses a 24-hour TTL constant and a three-second fetch timeout, and the docstring says detection is "entirely best-effort," with any fetch or read error "swallowed — detection must never make a process fail."

The framing problem is the word "secret." Hugging Face's own blog post from June 4, 2026 describes the practice in the open: "We started tracking agent usage of the Hub in April 2026. The hf CLI (and the huggingface_hub Python SDK it's built on) detects when a coding agent is driving it by reading the environment variables agents set ... That single signal does two jobs: it shapes the CLI's output ... and it tags each Hub request with an agent/<name> user-agent, so we can attribute traffic to the agent driving it." The same post publishes the resulting counts: Claude Code leads with 39.5k distinct users and 48.6M requests, Codex follows at 34.8k users and 36.4M, then antigravity, cursor-cli, openclaw, cursor, gemini and pi. The docstring also points to a public registration page where agent builders can add their own harness.

One factual gap in the Reddit post is worth stating plainly. u/Xylon95 describes the identified agent as being sent as telemetry in its own right; what Hugging Face documents is user-agent tagging of Hub requests the client was already making. Attributing traffic to the tool that generated it is a narrower claim than opening a separate reporting channel, and nothing in the thread demonstrates the second.

The bug that matters

On September 10, two days before the post, a user filed GitHub issue #4860: "[CLI] auto mode picks agent for Warp users: progress bars and colors silently disabled (TERM_PROGRAM=WarpTerminal)." The registry entry for Warp keys on TERM_PROGRAM=WarpTerminal, which Warp sets in every shell it opens, not only when its own agent mode is driving a command. Any person running hf inside Warp is therefore classified as an agent: auto output mode drops progress bars and ANSI colors, and --format human does not bring them back. The report measured the same 90.9 MB download producing 42 bytes of output under TERM_PROGRAM=WarpTerminal, against 892-949 bytes with bars for Apple_Terminal or an unset variable. The documented workaround is to unset the key for the command, as in env -u TERM_PROGRAM hf download ....

The issue records a data consequence alongside the cosmetic one. The registry is documented for attribution, yet the same detection result now decides rendering, so human Warp sessions are counted as Warp agent usage in the published agent-usage dataset. The equivalent entry in huggingface.js lives at packages/tasks/src/agent-harnesses.ts, and the analogous Zed entry keys on ZED_TERM, which only the integrated terminal sets — exactly the narrower key the Warp entry could adopt.

What the episode leaves standing

Detection sits in the shared Python client rather than in the CLI alone, so every library that touches the Hub inherits it, from transformers to faster-whisper to any wrapper script, whether or not its authors asked for it. The same pattern shows up wherever agent identity is inferred from context rather than declared, the subject of earlier work on agent identity stacks. The opt-out that works is HF_HUB_OFFLINE=1, which stops the registry fetch and the reporting with it, and also stops every model and dataset download. A user who wants attribution off but still needs to pull files has no middle setting.

Whether attribution should be a default at all is a design question Hugging Face answered in April and documented in June, with numbers attached. The measurable defect is narrower: one environment variable that a terminal emulator sets unconditionally, an output mode that falls back one way only, and a workaround that asks users to know which key to unset.

Related Articles

Scroll down

to load the next article