Skip to main content

Using AI coding assistants

This page describes how you can accelerate your MAX and Mojo development with popular AI coding assistants (Cursor, Claude Code, GitHub Copilot, Windsurf, and others) using the following resources:

  • Documentation files (llms.txt): Raw text files that AI tools use for website navigation hints and direct access to up-to-date API documentation.

  • Project context files (CLAUDE.md and AGENTS.md): Markdown files in your project that provide AI assistants with build commands, coding conventions, and project structure.

  • Cursor project rules (.cursor/rules/): Modular-specific rules that activate based on the files you're editing, providing consistent guidance for MAX and Mojo development.

Giving our docs to your AI assistant

To improve code quality and accuracy from your AI assistant, add Modular's documentation to your AI tool's context. We provide different llms.txt files that are optimized for different use cases:

  • llms.txt for a list of links with brief descriptions
  • llms-full.txt for comprehensive documentation (requires large context window)
  • llms-python.txt for MAX Python APIs, pipelines, or graph construction
  • llms-mojo.txt for Mojo code, GPU kernels, or MAX library APIs

If you're in Cursor, use the @ syntax in the chat window to reference documentation directly. For example, to insert the MAX Python API documentation, add this to your chat:

@docs.modular.com/llms-python.txt

For all other tools (Claude Code, Copilot, Windsurf, and others), just tell the AI to fetch the documentation:

Read https://docs.modular.com/llms-python.txt for MAX Python API documentation

For more details, see the section below about our llms.txt files.

Working in the Modular repository

When you clone the Modular repo, your AI tool will automatically discover project context (either CLAUDE.md or AGENTS.md) files that provide:

  • Build and test commands
  • Project architecture overview
  • Coding conventions and commit message guidelines
  • Common development workflows

Different tools look for different files (either CLAUDE.md or AGENTS.md, which are identical)—for compatibility details, see the section below about Modular context files.

Cursor users: The repository also includes project rules in .cursor/rules/ that activate based on the files you're editing. These rules provide file-specific guidance for Mojo and MAX development. See Modular Cursor rules for the full list.

Starting a new project

For your own MAX and Mojo projects, the entirety of our CLAUDE.md and AGENTS.md files are probably not useful for your own projects because they're specific to the Modular repository.

However, you might find some parts useful, such as the section about Critical development notes, which you can copy to your own CLAUDE.md or AGENTS.md file.

Cursor users: You also might want to copy the Modular Cursor rules below to your .cursor/rules/ directory.

Resources for AI assistants

Here are all the resources we provide for AI assistants.

Modular llms.txt files

Our documentation supports the llms.txt proposed standard, providing LLM-friendly documentation files:

FileDescriptionBest for
llms.txtIndex of links with brief descriptionsTools that can follow links
llms-full.txtAll docs in a single file (huge)Comprehensive context
llms-python.txtMAX Python APIsPython-based MAX development
llms-mojo.txtMojo stdlib, MAX AI Kernels, MAX libraryMojo and kernel development

Modular Cursor rules

Copy these rules to your .cursor/rules/ directory for consistent AI assistance with Mojo and MAX development:

  • general_behavior_rules.mdc: General rules for code creation. Emphasizes simplicity, thorough investigation, using existing solutions, descriptive naming, robust error handling, and documentation.

  • git.mdc: Best practices for Git including code organization, commit strategies, branching models, and collaborative workflows.

  • max_development.mdc: Guidelines for MAX development covering project context, task execution, code quality, testing practices, and documentation.

  • mojo.mdc: Mojo coding standards, performance optimizations, and best practices for GPU-accelerated code.

Modular context files

Project context files (CLAUDE.md and AGENTS.md) provide AI coding assistants with essential project information, such as:

  • Build and test commands
  • Project architecture overview
  • Coding conventions and commit message guidelines
  • Common development workflows

Although CLAUDE.md is primarily used for Claude Code, some other AI tools also read it, but perhaps not by default when working in the repository—you might need to explicitly tell your AI to read it.

The AGENTS.md filename is a more generic name that other coding assistants have adopted.

To ensure compatibility with other tools, we provide both CLAUDE.md and AGENTS.md files—our AGENTS.md file is just a symlink to the CLAUDE.md file.