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:- Custom rules (via the
--ruleflag): a file or directory - Workspace rules folder:
<workspace_root>/.augment/rules/- Recursively searches.mdand.mdcfiles - User rules folder:
~/.augment/rules/- Recursively searches.mdand.mdcfiles for user-wide rules - AGENTS.md or CLAUDE.md: Loaded from the current directory and every parent directory. In each directory, Auggie loads
AGENTS.mdif it exists and otherwiseCLAUDE.md - Workspace guidelines:
<workspace_root>/.augment-guidelines
/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.
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 promptagent_requested: Rule is automatically detected and attached based on the description field when relevantmanual: 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.
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:
Hierarchical Rules
In addition to workspace-level rules, the agent supports hierarchical rules throughAGENTS.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
- When the agent reads, edits, or writes a file, Auggie looks for
AGENTS.mdorCLAUDE.mdin the file’s directory - It then walks up the directory tree, checking each parent directory up to the workspace root
- Newly discovered files are added to the context for the rest of the session
Example Directory Structure
src/frontend/App.tsx:
src/frontend/AGENTS.mdis loaded (current directory)src/AGENTS.mdis loaded (parent directory)AGENTS.mdat workspace root is loaded via standard rulessrc/backend/AGENTS.mdandtests/AGENTS.mdare 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.mdandCLAUDE.mdfiles are discovered hierarchically. If a directory has both, onlyAGENTS.mdis 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
- Be Specific: Provide clear, actionable guidelines rather than vague suggestions
- Use Examples: Include code examples when describing patterns or conventions
- Keep Updated: Regularly review and update rules as your project evolves
- Be Concise: Focus on the most important guidelines to avoid overwhelming the AI
- 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:See Also
- Skills - Extend capabilities with specialized domain knowledge
- Rules & Guidelines for Agent and Chat - Configure rules in VSCode and JetBrains IDEs
- CLI Reference - Complete command-line reference
- Workspace Context - Understanding workspace configuration
- Custom Commands - Create reusable command templates