Auto-Pilot Mode
Make your AI automatically analyze files before modifying them—no prompting required.
What is Auto-Pilot Mode?
Auto-Pilot mode injects custom rules into your AI tool that instruct it to automatically call Memoria's analyze_file function before making any changes to a file. This ensures your AI always has context about file dependencies and risks.
Quick Setup
Run the init command with the --all flag to set up rules for all supported AI tools:
npx @byronwade/memoria init --allThis creates rule files for Cursor, Claude Code, Windsurf, and Cline.
Tool-Specific Setup
To set up auto-pilot for a specific tool:
# Cursor
npx @byronwade/memoria init --cursor
# Claude Code
npx @byronwade/memoria init --claude
# Windsurf
npx @byronwade/memoria init --windsurf
# Cline
npx @byronwade/memoria init --clineRule File Locations
Each AI tool reads rules from a specific location:
| AI Tool | Rule File Location |
|---|---|
| Cursor | .cursor/rules/memoria.mdc |
| Claude Code | .claude/memoria.md |
| Windsurf | .windsurfrules |
| Cline | .clinerules |
What the Rules Do
The generated rules instruct your AI to:
- Call
analyze_filebefore modifying any source file - Review the risk score and coupled files in the response
- Update coupled files if they share type definitions or schemas
- Check and update stale tests that depend on the modified file
Example Rule Content
Here's what a typical auto-pilot rule looks like:
# Memoria Integration
Before modifying any source file, ALWAYS call the `analyze_file` MCP tool
to get forensics data about the file.
## Required Steps
1. Call `analyze_file(path: "path/to/file.ts")`
2. Review the risk score and coupled files
3. If files are coupled, update them together
4. Run tests for any stale test files mentioned
## Example Usage
When asked to "update the API handler", first run:
`analyze_file(path: "src/api/route.ts")`
Then review the output before making changes.Auto-Detection
Memoria can detect which AI tools you have configured:
npx @byronwade/memoria initWithout flags, this command scans for existing AI tool configurations and offers to set up rules for detected tools.
Customizing Rules
After running init, you can customize the generated rule files. For example, you might want to:
- Add specific file patterns to always analyze
- Include additional context about your project structure
- Adjust the behavior for certain directories
Don't Delete Rule Files
If you delete the rule files, your AI will no longer automatically call Memoria. You'll need to manually ask it to analyze files.
Verifying Auto-Pilot
To verify auto-pilot is working:
- Open your project in your AI tool
- Ask the AI to modify a file: "Update src/api/route.ts to add logging"
- Watch for the AI to call
analyze_filebefore making changes
If the AI doesn't automatically analyze, check that the rule file is in the correct location and restart your AI tool.
Disabling Auto-Pilot
To disable auto-pilot for a specific tool, simply delete its rule file:
# Disable for Cursor
rm .cursor/rules/memoria.mdc
# Disable for Claude Code
rm .claude/memoria.mdYou can still use Memoria manually by asking your AI to analyze files.