Hugging Face redesigned its CLI for the agents already using it
Hugging Face rebuilt its command line and shipped it as hf, explaining that the design choice was driven by how much agent traffic already hits the Hub. As of April 2026, Claude Code accounted for 48.6 million requests from 39,500 distinct users, and Codex for 36.4 million from 34,800. The previous tooling left both flavors of users worse off: agents resorted to hand-rolling curl calls or navigating the Python SDK, which the team measured at up to six times the token cost of an equivalent CLI run on multi-step tasks. The new design fixes that by giving the same command two renderings. When the CLI detects an agent environment via variables like CLAUDECODE or CODEX_SANDBOX, it switches from a truncated, color-coded table to dense TSV with full timestamps, full tag lists, and no ANSI codes.
The benchmarks are where the case becomes concrete. Across eighteen non-trivial Hub tasks and roughly 520 runs per agent, Claude Code with Sonnet 4.6 reached 94 percent success using hf against 84 percent with curl or the SDK, while spending 1.3 to 1.6 times fewer tokens. Codex with GPT-5.5 went from 92 to 93 percent and 1.6 to 1.8 times fewer tokens. The gap widens on multi-step work: a bucket create, sync and prune chain cost 6x more in tokens via curl than via the CLI. There is also an hf skills add command that drops an auto-generated reference into Claude Code, Codex, Cursor, OpenCode and Pi; with the skill installed, average command calls per run dropped from 10.4 to 6.9 for Claude Code and 10.1 to 7.3 for Codex.
Why it matters
If your agent reaches an external service, the cheapest fix is usually a CLI built for it rather than letting the model improvise HTTP calls, and hf is now a clean reference for what that looks like in practice. The wider read for tool authors: detecting the agent environment and switching output format is a small change that, on Hugging Face's numbers, saves real money and lifts success rates by ten points.