Writing a Good AGENTS.md

· Source: philschmid.de - RSS feed · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Intermediate, quick

Summary

An `AGENTS.md` or `GEMINI.md` file serves as a critical configuration point for coding agents, injected into every conversation to onboard the agent to a codebase. Research from "Evaluating AGENTS.md" (ETH Zurich, 2025) and practical experience from HumanLayer indicate that poorly configured `AGENTS.md` files actively degrade performance. Auto-generated files reduce task success rates by approximately 3% and increase inference costs by over 20%, while human-written files offer only marginal improvements of about 4% but still raise costs by up to 19%. Stronger models like GPT-5.2 do not consistently generate better context files, and codebase overviews within `AGENTS.md` do not accelerate agent navigation. The primary issue is that agents follow unnecessary instructions, increasing reasoning tokens by 14-22%, especially when content duplicates existing documentation.

Key takeaway

For AI Engineers configuring coding agents, you should meticulously craft your `AGENTS.md` file, prioritizing brevity and clarity over comprehensive detail. Focus on providing essential context like your tech stack, project purpose, and build/test instructions, while omitting redundant overviews or auto-generated content. This approach will reduce inference costs and improve task success rates by preventing agents from following unnecessary or duplicated instructions.

Key insights

Effective `AGENTS.md` files are concise, human-written, and focus on essential, non-redundant information.

Principles

Method

Structure `AGENTS.md` with "WHAT" (tech stack), "WHY" (project purpose), and "HOW" (build/test instructions), keeping it under 300 lines and using progressive disclosure for task-specific documentation.

In practice

Topics

Best for: AI Engineer, Machine Learning Engineer, Prompt Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by philschmid.de - RSS feed.