Skip to main content

Overview

Auggie automatically loads custom rules and guidelines from several file locations to provide context-aware assistance. These files help Auggie understand your project’s conventions, coding standards, and preferences.
The Auggie CLI uses the same rules system as the VSCode and JetBrains IDE extensions. For more information on IDE specific features like user guidelines, see Rules & Guidelines for Agent and Chat.
Looking for specialized domain knowledge? Check out Skills - a standardized way to provide framework-specific guidance, tool usage patterns, and workflow procedures following the agentskills.io specification.

Supported Rules Files

Auggie loads rules from these locations:
  1. Custom rules (via the --rule flag): a file or directory
  2. Workspace rules folder: <workspace_root>/.augment/rules/ - Recursively searches .md and .mdc files
  3. User rules folder: ~/.augment/rules/ - Recursively searches .md and .mdc files for user-wide rules
  4. AGENTS.md or CLAUDE.md: Loaded from the current directory and every parent directory. In each directory, Auggie loads AGENTS.md if it exists and otherwise CLAUDE.md
  5. Workspace guidelines: <workspace_root>/.augment-guidelines
Run /rules in interactive mode to see which rules are loaded and their types. Use --no-rules to turn off rule discovery.

System prompt files

Two more files change the system prompt itself: The project file is used when it exists; otherwise the user file is used. Rules and AGENTS.md files are still added when you use SYSTEM.md.
SYSTEM.md replaces the built-in instructions Auggie relies on to use its tools well. Prefer APPEND_SYSTEM.md or rules unless you need full control.

User Rules vs Workspace Rules

Rules can be defined at two levels: User rules are stored in your home directory and apply to all projects. Use these for personal preferences, coding style guidelines, or conventions you want to follow across all your work. User rules are always treated as always_apply type and are automatically included in every prompt regardless of any frontmatter configuration. Workspace rules are stored in the project repository and apply only to that specific project. Use these for project-specific guidelines that should be shared with your team via version control.

Rules File Format

Rules files should be written in Markdown format with natural language instructions. Here’s the recommended structure:

Frontmatter Configuration for Rules

Rules files in the <workspace_root>/.augment/rules/ (workspace) directory support frontmatter to configure their behavior. Use YAML frontmatter at the beginning of your rule file to specify how the rule should be applied:
User rules in ~/.augment/rules/ are always treated as always_apply and do not support other frontmatter types. Frontmatter configuration only affects workspace rules.
Rule Types:
  • always_apply: Rule contents are automatically included in every user prompt
  • agent_requested: Rule is automatically detected and attached based on the description field when relevant
  • manual: Rule is attached only when you reference it in a message as $rule-name

Manual rules

To attach a manual rule, type $ followed by the rule name in your message. Interactive mode suggests manual rules as you type. For a rule in a subfolder, include the folder, for example $frontend/react. If the name has spaces, quote it: $"my rule".
User rules in ~/.augment/rules/ are always treated as always_apply regardless of frontmatter.
Terminology mapping (CLI ↔ IDE extensions): Use agent_requested over always_apply if you want to optimize context usage. For these rules, the agent will determine the rule is relevant to your current task, ensuring specialized guidelines are available when needed. Example with frontmatter:
Agent-requested example:

Hierarchical Rules

In addition to workspace-level rules, the agent supports hierarchical rules through AGENTS.md and CLAUDE.md files placed in subdirectories. When working on files in a subdirectory, Augment automatically discovers and applies rule files from that directory and all parent directories.

How Hierarchical Rules Work

  1. When the agent reads, edits, or writes a file, Auggie looks for AGENTS.md or CLAUDE.md in the file’s directory
  2. It then walks up the directory tree, checking each parent directory up to the workspace root
  3. Newly discovered files are added to the context for the rest of the session

Example Directory Structure

When working on src/frontend/App.tsx:
  • src/frontend/AGENTS.md is loaded (current directory)
  • src/AGENTS.md is loaded (parent directory)
  • AGENTS.md at workspace root is loaded via standard rules
  • src/backend/AGENTS.md and tests/AGENTS.md are not loaded (different branches)

Use Cases for Hierarchical Rules

  • Framework-specific guidelines: Place React-specific rules in your frontend directory and Node.js rules in your backend directory
  • Module-specific conventions: Define API design patterns in your api/ directory
  • Test-specific rules: Add testing conventions that only apply when writing tests
  • Team boundaries: Different teams can maintain their own coding standards in their directories

Important Notes

  • Only AGENTS.md and CLAUDE.md files are discovered hierarchically. If a directory has both, only AGENTS.md is used
  • Files in .augment/rules/ are only loaded from the workspace root, not from subdirectories
  • Rules are cached per conversation session to avoid duplicate inclusion
  • Hierarchical rules are combined with workspace and user rules

Best Practices for Rules Files

  1. Be Specific: Provide clear, actionable guidelines rather than vague suggestions
  2. Use Examples: Include code examples when describing patterns or conventions
  3. Keep Updated: Regularly review and update rules as your project evolves
  4. Be Concise: Focus on the most important guidelines to avoid overwhelming the AI
  5. Test Guidelines: Verify that Auggie follows your rules by testing with sample requests

Command-Line Flag

You can load extra rules when starting Auggie. Pass a file or a directory, and repeat the flag to add more:
Rules loaded this way are always applied, in addition to the rules Auggie discovers automatically.

See Also