Skip to main content
AGENTS.md files provide a simple way to give Cascade context-aware instructions that automatically apply based on where the file is located in your project. This is particularly useful for providing directory-specific coding guidelines, architectural decisions, or project conventions.

How It Works

When you create an AGENTS.md file (or agents.md), Devin Desktop automatically discovers it and feeds it into the same Rules engine that powers .devin/rules/ (and the legacy .windsurf/rules/) — just with the activation mode inferred from the file’s location instead of frontmatter:
  • Root directory: Treated as an always-on rule — the full content is included in Cascade’s system prompt on every message.
  • Subdirectories: Treated as a glob rule with an auto-generated pattern of <directory>/** — the content is applied only when Cascade reads or edits files inside that directory.
This location-based scoping makes AGENTS.md ideal for providing targeted guidance without cluttering a single global configuration file.

Creating an AGENTS.md File

Simply create a file named AGENTS.md or agents.md in the desired directory. The file uses plain markdown with no special frontmatter required.

Example Structure

Example Content

Here’s an example AGENTS.md file for a React components directory:

Discovery and Scoping

Devin Desktop automatically discovers AGENTS.md files throughout your workspace:
  • Workspace scanning: All AGENTS.md files within your workspace and its subdirectories are discovered
  • Git repository support: For git repositories, Devin Desktop also searches parent directories up to the git root
  • Case insensitive: Both AGENTS.md and agents.md are recognized

Automatic Scoping

The key benefit of AGENTS.md is automatic scoping based on file location: This means you can have multiple AGENTS.md files at different levels, each providing increasingly specific guidance for their respective directories.

Best Practices

To get the most out of AGENTS.md files:
  • Keep instructions focused: Each AGENTS.md should contain instructions relevant to its directory’s purpose
  • Use clear formatting: Bullet points, headers, and code blocks make instructions easier for Cascade to follow
  • Be specific: Concrete examples and explicit conventions work better than vague guidelines
  • Avoid redundancy: Don’t repeat global instructions in subdirectory files; they inherit from parent directories

Content Guidelines

Comparison with Rules

While both AGENTS.md and Rules provide instructions to Cascade, they serve different purposes: Use AGENTS.md when you want simple, location-based instructions. Use Rules when you need more control over when and how instructions are applied.