Skip to main content
Agent automatically creates this file in your project’s root directory using proven best practices. Agent includes its contents in the context to help it understand your preferences, project structure, and coding style.
Agent using replit.md to build a project

How replit.md works

Agent first creates a replit.md file in your project’s root directory using proven best practices. This file includes:
  • Basic project information
  • Recommended coding patterns
  • Common preferences for your project type
When Agent processes your requests, it automatically reads your replit.md file and uses its contents to:
  • Understand your project’s architecture and conventions
  • Follow your preferred coding patterns and style
  • Use your specified package managers and dependencies
Agent can also update your replit.md file as it learns more about your project and makes changes to your application.
You can edit the replit.md file to customize Agent’s behavior.

Setting up replit.md

Automatic generation

When you create a new project with Agent, it automatically generates a replit.md file using proven best practices. This file appears in your project’s root directory and includes:
  • Basic project information
  • Recommended coding patterns
  • Common preferences for your project type

Manual creation

You can create your own replit.md file by adding a new file named replit.md in your project’s root directory. Agent will automatically detect and use this file in future conversations.
replit.md must be located in your project’s root directory to work properly.

Regenerating replit.md

If your replit.md file becomes corrupted or you want to start fresh:
  1. Delete the existing replit.md file from your project root
  2. Start a new conversation with Agent
  3. Agent will automatically generate a new replit.md file based on your current project

Best practices

Be specific and clear

Write clear, specific instructions that help Agent understand exactly what you want:
For a more detailed guide on prompt formatting, check out the Anthropic prompt engineering guide.

Use examples

Examples help Agent understand your preferences better than abstract descriptions:

Define communication preferences

Tell Agent how you prefer to receive information and updates:

Specify project context

Help Agent understand your project’s purpose and constraints:

Example replit.md configurations

Web application project

Data analysis project

API development project

Advanced usage

Dynamic project guidance

Update your replit.md file as your project evolves to provide current context:

Integration with external tools

Reference external documentation and tools in your replit.md:

Combining web search with replit.md

Agent can perform web searches to find current information, libraries, and solutions. When combined with your replit.md file, you get both up-to-date knowledge and project-specific guidance.

Best practices for web search integration

Be specific about what you want Agent to research:
Guide Agent on how to apply external knowledge:
Example request that leverages both: “Research the latest React 18 performance optimization techniques and implement them following the component patterns defined in replit.md This approach gives you solutions that are both current and tailored to your specific project needs.

Limitations

File size and content limits

While there’s no strict character limit for replit.md, extremely large files may not be fully processed. Keep your replit.md focused and concise for best results.

Root directory requirement

replit.md must exist in your project’s root directory. Agent won’t automatically detect files in subdirectories.

Context scope

replit.md provides context for Agent conversations but doesn’t automatically apply to other AI tools.

Next steps

Ready to customize Agent for your project?
  1. Start simple: Create a basic replit.md with your key preferences
  2. Iterate and improve: Update your replit.md as you work with Agent
  3. Share patterns: Use successful replit.md configurations across similar projects
  4. Monitor effectiveness: Pay attention to how well Agent follows your guidelines and adjust accordingly
Learn more about working with Agent or explore other AI tools. Enterprise: Pre-configure replit.md in custom templates to give every builder in your organization a consistent starting context. For design-specific guidance, see setting up a design system.