Cursor Rules, AGENTS.md, and .cursorignore explained
Understand Cursor Rules, AGENTS.md, and .cursorignore for project context, rule inheritance, and index control. Includes setup, examples, and common fixes.
Short answer
Cursor Rules tell Cursor how to work in a project. AGENTS.md is a repository instruction file many coding agents can read. .cursorignore controls which files or directories Cursor should not index or read.
They all relate to project context, but they solve different problems: Rules guide behavior, AGENTS.md gives cross-agent instructions, and .cursorignore excludes content.
Comparison
| File / feature | Main role |
|---|---|
| Cursor Rules | Project, team, or user-level rules for Cursor |
AGENTS.md | Cross-agent repository instructions and collaboration norms |
.cursorignore | Files or directories Cursor should ignore |
| API Key / Base URL | Model request setup, not project rules |
Good content for Rules
- Project coding style
- Framework conventions
- Component and directory rules
- Test and validation requirements
- Cursor editing behavior
Good content for .cursorignore
- Large build artifacts
- Dependency directories
- Generated files
- Sensitive directories that should not be indexed
- Large files unrelated to current development
Common mistakes
- Writing API Keys in Rules or
AGENTS.md. - Treating
.cursorignoreas a complete security system. - Keeping outdated rules that mislead the AI.
- Thinking Base URL configuration replaces project rules.
- Mixing Cursor Rules with Claude Code
CLAUDE.md.
About BetterToken
BetterToken handles model API access and usage visibility. Cursor Rules, AGENTS.md, and .cursorignore handle project context and editing behavior.
API access is only the first step. Long-term output quality depends heavily on clear rules and controlled context.
Related docs
- How to configure a custom OpenAI API in Cursor
- How to configure MCP in Cursor
- What is AGENTS.md in Codex CLI?
- What is CLAUDE.md in Claude Code?

