AGENTS.md
Project-level instructions and docs index for AI coding agents
What is AGENTS.md?
AGENTS.md is a project-level instruction file that lives at your repository root. It provides guidance to AI coding agents about how to work with your projectβincluding using sus for secure package installation and accessing package documentation.
Based on Vercel's research, passive context in AGENTS.md outperforms active skill retrieval (100% vs 79% pass rate in agent evals). This is why sus now uses a centralized docs index approach instead of per-agent-folder skills.
How It Works
When you initialize sus and add packages, here's what happens:
sus initcreates project configuration and optionally sets up the docs indexsus addsaves package documentation to.sus-docs/- The
AGENTS.mdfile is updated with a compressed index of all installed packages
Getting Started
Initialize sus
Run sus init in your project root:
sus init π§ initializing sus...
Enable AGENTS.md docs index for AI coding agents? (Y/n) Y
β created sus.json
β created .sus-docs/
β updated AGENTS.md with sus docs index
β sus initialized successfully!Use -y to skip prompts and use defaults:
sus init -yAdd Packages
When you add packages with sus, documentation is automatically indexed:
sus add expressπ checking express@4.21.0...
β
not sus
ββ publisher: expressjs (verified)
ββ downloads: 32M/week
ββ cves: 0
ββ trust score: 95/100
π¦ installed
π updated AGENTS.md docs indexRemove Packages
When you remove packages, the docs index is updated automatically:
sus remove expressπ¦ removed express
π updated AGENTS.md docs indexProject Structure
After initialization and adding packages, your project will have:
your-project/
ββ AGENTS.md # Instructions + docs index for AI agents
ββ sus.json # sus configuration
ββ .sus-docs/ # Package documentation (gitignored)
β ββ express.md
β ββ lodash.md
β ββ axios.md
ββ package.jsonsus.json
The configuration file stores your sus settings:
{
"agents_md": true
}| Field | Description | Default |
|---|---|---|
agents_md | Enable AGENTS.md docs index | false |
.sus-docs/
Package documentation is saved here. Each file contains:
- Quick start examples
- Key APIs and usage patterns
- Best practices and gotchas
- Required capabilities/permissions
Add .sus-docs/ to your .gitignore. The docs are regenerated from the AGENTS.md index when needed.
AGENTS.md Structure
sus adds a compressed docs index to your AGENTS.md following Vercel's format:
# AGENTS.md
[sus Docs Index]|root: ./.sus-docs
|IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning
|packages:{express.md,lodash.md,axios.md}
[/sus Docs Index]This compressed format:
- Points agents to the
.sus-docs/directory - Lists all available package documentation files
- Instructs agents to use retrieval-led reasoning (read the docs) over pre-training knowledge
What the Instructions Tell Agents
The sus section in AGENTS.md instructs AI agents to:
- Use sus for package installation - Instead of
npm installoryarn add, agents should usesus add - Check the docs index - After installing, agents can reference the
.sus-docs/folder for package documentation - Follow security best practices - Use
--strictmode when security is critical
Why Docs Index?
The docs index approach offers several advantages over per-agent-folder skills:
| Per-Agent Skills (Old) | Docs Index (New) |
|---|---|
| Scattered across multiple folders | Centralized in .sus-docs/ |
| Requires agents to actively search | Passive context in AGENTS.md |
| 79% pass rate in evals | 100% pass rate in evals |
| Agent-specific paths | Universal format |
Based on Vercel's research, AI agents perform better when documentation is provided as passive context rather than requiring active retrieval.
Supported Agents
The AGENTS.md file is recognized by most AI coding agents:
| Agent | Support |
|---|---|
| Cursor | β Reads AGENTS.md from project root |
| Claude Code | β Reads AGENTS.md from project root |
| Windsurf | β Reads AGENTS.md from project root |
| Codex CLI | β Reads AGENTS.md from project root |
| Gemini CLI | β Reads AGENTS.md from project root |
| OpenCode | β Reads AGENTS.md from project root |
Combining with Other Instructions
AGENTS.md can contain any project-level instructions for AI agents. The sus section is just one part. You might also include:
- Project architecture overview
- Coding conventions and style guides
- Testing requirements
- Deployment procedures
- Security policies
Example structure:
# Project Instructions for AI Agents
## Architecture
This is a Next.js application with...
## Coding Standards
- Use TypeScript strict mode
- Follow ESLint configuration
- Write tests for new features
## sus Package Security
This project uses sus for secure package installation...
## Deployment
Changes to main are automatically deployed to...Manual Setup
If you prefer to set up manually without sus init:
- Create
sus.json:
{
"agents_md": true
}-
Create or update
AGENTS.mdwith the sus section shown above -
Add
.sus-docs/to.gitignore
Related
- CLI Commands - Full reference for sus commands
- Quickstart - Get started with sus
- Threat Detection - How sus detects security threats
On this page