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 Is Project Initialization?
Project initialization is a process where Crush analyzes your codebase and creates a context file with project-specific information. This helps Crush understand your project’s structure, conventions, and patterns right from the start. The initialization process:- Scans your project directory
- Identifies the tech stack, frameworks, and tools
- Discovers coding conventions and patterns
- Analyzes project structure and organization
- Creates a context file with this information
When Does Initialization Happen?
Crush automatically offers to initialize a project when:- You run Crush in a new project directory for the first time
- The project has no existing context files (like
AGENTS.md,CRUSH.md, etc.) - The directory contains files (not an empty directory)
- No initialization flag exists in
./.crush/
.crush/init flag file and restarting Crush.
The Generated Context File
By default, initialization creates a file calledAGENTS.md in your project root. This file contains:
Project Overview
- Programming languages detected
- Frameworks and libraries in use
- Build tools and task runners
- Package managers
Code Conventions
- Formatting style discovered from existing code
- Naming patterns for files, functions, and variables
- Common architectural patterns
- Testing approaches
Project Structure
- Directory organization
- Key directories and their purposes
- Configuration file locations
Build and Development
- Build commands
- Test commands
- Development server commands
- Linting and formatting tools
Example AGENTS.md
Here’s an example of what Crush might generate for a Go project:Customizing the Initialization File
You can configure which file Crush creates during initialization using theinitialize_as option:
"AGENTS.md"(default)"CRUSH.md""CLAUDE.md""docs/LLMs.md"(subdirectory)".github/ai-context.md"
Subdirectory Initialization
You can place the initialization file in a subdirectory:How to Initialize a Project
First-Time Initialization
- Navigate to your project directory
- Run
crush - When prompted, accept the initialization offer
- Wait for Crush to analyze your project
- Review the generated file and edit as needed
Re-Initializing a Project
If you want to re-run initialization (for example, after major project changes):- Remove the initialization flag:
- Optionally, back up your existing context file:
- Run
crushagain - Accept the initialization prompt
- Compare the new file with your backup and merge any manual changes
When to Re-Initialize
Consider re-initializing when:- You’ve made significant architectural changes
- You’ve adopted new frameworks or libraries
- Your coding conventions have evolved
- You’ve reorganized your project structure
- The existing context file is outdated
Manual Editing vs. Initialization
While initialization provides a great starting point, you can:- Edit the generated file: Add project-specific details that Crush couldn’t detect
- Add additional context files: Create
CRUSH.local.mdfor personal preferences - Mix approaches: Use initialization for structure, manual editing for domain knowledge
- Business logic context and domain knowledge
- API contracts and external dependencies
- Performance considerations
- Security requirements
- Team-specific conventions
Skipping Initialization
You can skip initialization if:- You prefer to write context files manually
- You’re using a standard project template with existing context
- The project is very simple and doesn’t need context
- You’re just experimenting with Crush
.crush/init file to prevent future prompts:
Initialization and Context Files
Initialization creates one context file (by default,AGENTS.md). You can still:
- Create additional context files manually
- Use other supported filenames (see Context Files guide)
- Configure custom context paths in
crush.json
What Initialization Does NOT Do
Initialization does not:- Modify your existing code
- Create configuration files (except the context file)
- Change your project structure
- Install dependencies or tools
- Commit anything to version control
Troubleshooting
Initialization Not Triggering
If Crush doesn’t offer to initialize:- Check if a context file already exists (like
AGENTS.md,CRUSH.md) - Check if
.crush/initflag file exists - Ensure your directory has files (empty directories skip initialization)
Generated File Is Empty or Incomplete
If the generated context file lacks important information:- Ensure your project files are present and not ignored
- Check that configuration files (like
package.json,go.mod) are in place - Manually edit the file to add missing context
- Consider using a more descriptive project structure
Initialization Takes Too Long
For very large projects:- Ensure your
.gitignoreor.crushignoreis properly configured - Check that
node_modules,vendor, or similar directories are ignored - Consider using a smaller, more focused directory for initialization
Best Practices
- Review and refine: The generated file is a starting point—edit it to add important details
- Version control: Commit
AGENTS.mdso your team benefits from the context - Keep it updated: Re-initialize or manually update when your project changes significantly
- Combine with local files: Use
CRUSH.local.mdfor personal preferences alongside the sharedAGENTS.md - Don’t over-rely: Initialization is great, but manual context often captures nuances better