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.
Supported Rules Files
Auggie looks for rules files in the following order of precedence:- Custom rules file (via
--rulesflag):/path/to/custom-rules.md - CLAUDE.md: Compatible with Claude Code and other AI tools
- AGENTS.md: Compatible with Cursor and other AI development tools
- Workspace guidelines:
<workspace_root>/.augment/guidelines.md(legacy format) - Workspace rules folder:
<workspace_root>/.augment/rules/- Recursively searches .md files in the workspace - User rules folder:
~/.augment/rules/- Recursively searches .md files for user-wide rules
User Rules vs Workspace Rules
Rules can be defined at two levels:| Scope | Location | Availability |
|---|---|---|
| User | ~/.augment/rules/ | Available in all workspaces |
| Workspace | <workspace_root>/.augment/rules/ | Available in current workspace only |
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.| Frontmatter Field | Purpose | Options | Default |
|---|---|---|---|
type | Controls when the rule is applied | always_apply, agent_requested | always_apply |
description | Brief description of the rule’s purpose (required for agent_requested type) | Any text | None |
always_apply: Rule contents are automatically included in every user promptagent_requested: Rule is automatically detected and attached based on the description field when relevant
Manual rules are not yet supported in the CLI. In the CLI, workspace rules in
<workspace_root>/.augment/rules/ are currently treated as always_apply rules and automatically included. User rules in ~/.augment/rules/ are always always_apply. The manual type only works in the IDE extensions where you can use @ mentions to selectively attach rules.agent_requested (also called auto in IDE extensions) 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 you work on a file, Augment looks for
AGENTS.mdandCLAUDE.mdin the file’s directory - It then walks up the directory tree, checking each parent directory for these files
- All discovered rules are included in the context for that work session
- The search stops at the workspace root (since workspace root rules are already loaded separately)
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 - 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 specify a custom rules file when starting Auggie:See Also
- 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