Skip to content

Commit ce1364d

Browse files
Wauplinclaudedavanstrien
authored
[Docs] how to register an agent harness (#2521)
* docs: how to register an agent harness Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Apply suggestions from code review Co-authored-by: Daniel van Strien <davanstrien@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Daniel van Strien <davanstrien@users.noreply.github.com>
1 parent 6ecc548 commit ce1364d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/hub/agents-overview.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,23 @@ Agent: [Fetches documentation]
182182
result = classifier("I love this product!")
183183
```
184184

185+
## Register your agent harness
186+
187+
Hugging Face maintains a public registry of agent harnesses, the coding agents and tools that interact with the Hub (Claude Code, Codex, Cursor, and more). When `huggingface_hub` detects it is running inside a registered harness, it reports it via the user agent on Hub requests. Registering your harness means this activity is attributed to your tool by name and gives your project a friendly display label, links back to your docs and repository, and a place in upcoming agent leaderboards.
188+
189+
To register a harness, open a Pull Request adding an entry to [`agent-harnesses.ts`](https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/agent-harnesses.ts) in the `@huggingface/tasks` package:
190+
191+
- the harness id (the entry key) should be lowercased and hyphen-separated (example: `"claude-code"`).
192+
- set `prettyLabel` with user-friendly casing (example: `Claude Code`).
193+
- (optional) set `repoUrl` with a link to the harness source code (usually a GitHub repository).
194+
- (optional) set `docsUrl` with a link to the harness documentation or website.
195+
- (optional) set `description` with a short, one-line explanation of the harness.
196+
- define how your harness is detected from the environment:
197+
- If your harness sets one of the standard environment variables (`AI_AGENT` or `AGENT`), its value is used directly as the identifier and no extra config is needed.
198+
- Otherwise, set `envVars` to map environment variable names to value patterns. Use `"*"` to match any non-empty value, an exact string for an exact match, or `"<prefix>*"` for prefix matching.
199+
200+
And that's it! Once the PR is merged, we will start tracking usage of the `hf` CLI by your agent harness.
201+
185202
## Next Steps
186203

187204
- [CLI](./agents-cli) - Command-line interface for Hub operations

0 commit comments

Comments
 (0)