Documentation Index
Fetch the complete documentation index at: https://mintlify.com/charmbracelet/crush/llms.txt
Use this file to discover all available pages before exploring further.
What Are Context Files?
Context files are markdown files that contain project-specific instructions, conventions, and context for Crush. They help the AI understand your project’s unique requirements, coding standards, and preferences. When you start Crush, it automatically reads these files and includes their content in the system prompt, giving the AI awareness of your project’s specific needs.Supported Context Files
Crush looks for the following context files in your project root (in order of precedence):.github/copilot-instructions.md.cursorrules.cursor/rules/CLAUDE.mdCLAUDE.local.mdGEMINI.md/gemini.mdcrush.md/Crush.md/CRUSH.mdcrush.local.md/Crush.local.md/CRUSH.local.mdAGENTS.md/agents.md/Agents.md
Local Variants
Files with.local in the name (e.g., CRUSH.local.md, CLAUDE.local.md) are intended for local development settings that shouldn’t be committed to version control.
Recommended .gitignore entries:
- Personal preferences and workflows
- Local development environment specifics
- Experimental instructions you’re testing
- Sensitive information that shouldn’t be shared
How Crush Uses Context Files
When you start Crush or begin a new session:- Crush scans your project root for context files
- All matching files are read sequentially
- Their contents are combined and included in the system prompt
- The AI agent uses this context to understand your project
Creating Your First Context File
The easiest way to create a context file is through project initialization:- Run Crush in a project for the first time
- Crush will offer to analyze your project
- It creates an
AGENTS.mdfile with discovered conventions
What to Include in Context Files
Good context files typically include:Project Information
- Tech stack and frameworks
- Language version and tooling
- Build system and commands
- Testing framework and conventions
Coding Standards
- Formatting rules and linters
- Naming conventions
- Error handling patterns
- Documentation requirements
Architecture and Patterns
- Directory structure
- Design patterns in use
- Key architectural decisions
- Module boundaries
Domain Knowledge
- Business logic context
- Important domain concepts
- API contracts
- Data models
Project-Specific Preferences
- Preferred libraries for common tasks
- Code review requirements
- Performance considerations
- Security guidelines
Example Context File
Best Practices
Keep It Focused
- Include information that helps the AI make better decisions
- Avoid duplicating information that’s obvious from the code
- Update the file when conventions change
Use Markdown Formatting
- Use headers to organize sections
- Use code blocks for examples
- Use bullet points for lists
- Use bold or italic for emphasis
Be Specific
- Instead of “write good tests,” specify “use Jest with describe/it blocks”
- Instead of “follow conventions,” list the actual conventions
- Include examples for complex patterns
Maintain Accuracy
- Review and update context files regularly
- Remove outdated information
- Keep it synchronized with your actual practices
Custom Context Paths
You can configure additional context file paths in yourcrush.json:
- Store context files in a
docs/directory - Use custom naming conventions
- Include multiple context files from different locations
Context Files vs. Initialization
While project initialization creates anAGENTS.md file automatically, you can:
- Edit this file manually to refine the context
- Add other context files (like
CRUSH.local.md) for additional instructions - Re-run initialization to update the file as your project evolves
Troubleshooting
Context File Not Being Read
- Ensure the file is in your project root (where you run
crush) - Check that the filename exactly matches one of the supported names
- Verify the file has
.mdextension - Look at Crush logs to see which files were loaded:
crush logs
Context Too Large
If your context files are very large:- Keep only the most important information
- Use concise language and bullet points
- Split concerns across multiple files (e.g.,
AGENTS.mdfor code,CRUSH.local.mdfor personal preferences) - Remember that context consumes tokens from your context window