Designing the hf CLI as an agent-optimized way to work with the Hub
Which summary reads better? Pick one — models revealed after.Both summaries are AI-generated.
Hugging Face has rebuilt its official hf command-line interface to serve both human users and AI coding agents like Claude Code, Codex, and Cursor, which increasingly use the tool to interact with the Hub. The CLI detects when an agent is driving it and adjusts its output accordingly—stripping color and formatting in favor of compact, structured data—and benchmarks showed that the no-CLI baseline can consume up to six times more tokens than using hf on complex tasks. Hugging Face began tracking agent traffic in April 2026, with Claude Code and Codex leading usage at roughly 40,000 users and nearly 49 million requests for Claude Code alone.
The Hugging Face CLI (hf CLI) has been redesigned to optimize interactions for both human users and AI coding agents like Claude Code and Codex. It now detects agent usage via environment variables, tailoring outputs to be compact and structured for agents while maintaining rich formatting for humans. Early data shows significant agent adoption, with Claude Code and Codex leading in user numbers and request volume on the Hub.