Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/huggingface/transformers/copilot-instructionsgit clone --depth 1 https://github.com/huggingface/transformersWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00773 | $0.00773 |
| Opus 5 | $0.00387 | $0.00387 |
| Sonnet 5 | $0.00155 | $0.00155 |
| Haiku 4.5 | $0.00077 | $0.00077 |
Grade A, and why
transformers copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.
copilot-instructions.md Guide for Hugging Face Transformers
This copilot-instructions.md file provides guidance for code agents working with this codebase.
Core Project Structure
/src/transformers: This contains the core source code for the library/models: Code for individual models. Models inherit from base classes in the root/src/transformersdirectory.
/tests: This contains the core test classes for the library. These are usually inherited rather than directly run./models: Tests for individual models. Model tests inherit from common tests in the root/testsdirectory.
/docs: This contains the documentation for the library, including guides, tutorials, and API references.
Coding Conventions for Hugging Face Transformers
- PRs should be as brief as possible. Bugfix PRs in particular can often be only one or two lines long, and do not need large comments, docstrings or new functions in this case. Aim to minimize the size of the diff.
- When writing tests, they should be added to an existing file. The only exception is for PRs to add a new model, when a new test directory should be created for that model.
- Code style is enforced in the CI. You can install the style tools with
pip install -e .[quality]. You can then runmake fixupto apply style and consistency fixes to your code.
Copying and inheritance
Many models in the codebase have similar code, but it is not shared by inheritance because we want each model file to be self-contained. We use two mechanisms to keep this code in sync:
- "Copied from" syntax. Functions or entire classes can have a comment at the top like this:
# Copied from transformers.models.llama.modeling_llama.rotate_halfor# Copied from transformers.models.t5.modeling_t5.T5LayerNorm with T5->MT5These comments are actively checked by the style tools, and copies will automatically be updated when the base code is updated. If you need to update a copied function, you should either update the base function and usemake fixupto propagate the change to all copies, or simply remove the# Copied fromcomment if that is inappropriate. - "Modular" files. These files briefly define models by composing them using inheritance from other models. They are not meant to be used directly. Instead, the style tools
automatically generate a complete modeling file, like
modeling_bert.py, from the modular file likemodular_bert.py. If a model has a modular file, the modeling file should never be edited directly! Instead, changes should be made in the modular file, and then you should runmake fixupto update the modeling file automatically.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 40 lines · 773 tokens per session scan A 51d12faef435
transformers copilot-instructions.md is an instructions file published in the GitHub repository huggingface/transformers (164,637 stars, last pushed 2d ago), licensed Apache-2.0. It adds 773 tokens to every session, about $0.0039 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
huggingface_hub AGENTS.md
AGENTS.md instructions for huggingface/huggingface_hub, covering agent guide for huggingfacehub, project overview, setup, key commands and code structure.
huggingface_hub CLAUDE.md
Claude Code instructions for huggingface/huggingface_hub, a project described as: The official CLI and Python client for the Hugging Face Hub.
DocsGPT AGENTS.md
Instructions for arc53/DocsGPT, covering agents.md, check existing dev prerequisites first, normal local development commands, backend and frontend.
compromise AGENTS.md
Instructions for spencermountain/compromise, covering agents.md — using compromise, read these first, 30-second mental model, rules that prevent most mistakes and not supported (don't try).
Kokoro-FastAPI AGENTS.md
AGENTS.md instructions for remsky/Kokoro-FastAPI, covering agents.md, layout, commands, conventions and gotchas.
PINA AGENTS.md
Instructions for PINA-org/PINA, covering pina — physics-informed neural architectures, quick reference, workflow: problem → model → solver → trainer, problem types and condition types.