Rules & Instructions
PraisonAI automatically discovers and applies rules/instructions from multiple sources, similar to Cursor, Windsurf, Claude Code, and Codex CLI.Supported Instruction Files
PraisonAI automatically loads these files from your project root and git root:| File | Description | Priority |
|---|---|---|
PRAISON.md | PraisonAI native instructions | High (500) |
PRAISON.local.md | Local overrides (gitignored) | Higher (600) |
CLAUDE.md | Claude Code memory file | High (500) |
CLAUDE.local.md | Local overrides (gitignored) | Higher (600) |
AGENTS.md | OpenAI Codex CLI instructions | High (500) |
GEMINI.md | Gemini CLI memory file | High (500) |
.cursorrules | Cursor IDE rules (legacy) | High (500) |
.windsurfrules | Windsurf IDE rules (legacy) | High (500) |
.claude/rules/*.md | Claude Code modular rules | Medium (50) |
.windsurf/rules/*.md | Windsurf modular rules | Medium (50) |
.cursor/rules/*.mdc | Cursor modular rules | Medium (50) |
.praison/rules/*.md | Workspace rules | Medium (0) |
~/.praison/rules/*.md | Global rules | Low (-1000) |
Local Override Files:
CLAUDE.local.md and PRAISON.local.md are personal overrides that should be gitignored. They have higher priority than the main files, allowing you to customize rules without affecting the shared project configuration.Quick Start
Rules are automatically loaded when you create an Agent:Rule File Format
Rules support YAML frontmatter for advanced configuration:Activation Modes
| Mode | Description | Use Case |
|---|---|---|
always | Always applied (default) | General guidelines |
glob | Applied when file matches pattern | Language-specific rules |
manual | Only via @mention | Security checklists, special procedures |
ai_decision | AI decides when to apply | Context-dependent rules |
@Import Syntax (like Claude Code)
Include other files in your rules using the@path/to/file syntax:
Import Depth Limit: Imports are limited to 5 levels deep to prevent circular dependencies. Code spans like
`@org/package` are not treated as imports.Git Root Discovery
PraisonAI automatically discovers rules from the git repository root, enabling monorepo support:Storage Structure
Programmatic Rules Management
Creating Rules Programmatically
AI Decision Activation
Forai_decision rules, PraisonAI can use an LLM to decide if a rule should be applied:
Without an LLM function,
ai_decision rules default to being included. This ensures rules are not accidentally skipped.Agent Integration
The Agent class automatically initializes RulesManager:Cross-Tool Compatibility
PraisonAI rules are compatible with other AI coding assistants:| Tool | File | Compatibility |
|---|---|---|
| Claude Code | CLAUDE.md | ✅ Full |
| Codex CLI | AGENTS.md | ✅ Full |
| Gemini CLI | GEMINI.md | ✅ Full |
| Cursor | .cursorrules, .cursor/rules/*.mdc | ✅ Partial |
| Windsurf | .windsurfrules, .windsurf/rules/*.md | ✅ Partial |
PraisonAI reads the same instruction files used by other AI coding assistants, making it easy to switch between tools while maintaining consistent behavior.
Best Practices
Use PRAISON.md for project-specific rules
Use PRAISON.md for project-specific rules
Create a
PRAISON.md file in your project root with guidelines specific to your project. This file is automatically loaded with high priority.Use glob patterns for language-specific rules
Use glob patterns for language-specific rules
Put language-specific rules in
.praison/rules/ with appropriate glob patterns. For example, python.md with globs: ["**/*.py"].Use manual activation for checklists
Use manual activation for checklists
Security checklists, deployment procedures, and other special rules should use
activation: manual and be invoked via @mention when needed.Set appropriate priorities
Set appropriate priorities
Use higher priority (50+) for critical rules that should override others. Default priority is 0 for workspace rules, -1000 for global rules.
Keep rules concise
Keep rules concise
Rules are injected into the system prompt, consuming context window. Keep rules focused and concise to leave room for conversation.

