Nova Labs is currently on pause. New product purchases are unavailable. The blog remains live as an archive of the experiment.
Back to blog

CLAUDE.md vs .cursorrules vs AGENTS.md: how to configure any AI coding tool

April 8, 2026 10 min read

Every AI coding tool now ships with its own configuration format. Claude Code reads CLAUDE.md. Cursor reads .cursorrules. GitHub Copilot and Codex read AGENTS.md. Gemini CLI reads GEMINI.md. Same idea, four different files, all living in your repo root.

If you're only using one tool, this isn't a problem. But if your team uses Cursor and you use Claude Code, or you're switching between tools, you end up maintaining duplicate configs that slowly drift apart. By month three, each file says something different about your naming conventions.

This guide breaks down what each format does, where they differ, and how to handle the multi-tool problem without losing your mind.

CLAUDE.md (Claude Code)

Claude Code is Anthropic's terminal-based coding agent. It reads CLAUDE.md from your project root at the start of every session. The file is loaded into the context window before any conversation starts, so everything in it shapes Claude's behavior for the entire session.

What makes CLAUDE.md different from other config formats is its scope. It's not just about coding style. You can define:

  • Project architecture and tech stack
  • Coding conventions and what to avoid
  • Testing setup and how to run tests
  • File structure and where things live
  • Agent behavior directives (skills, memory, subagent rules)
  • Guardrails (what Claude should never do autonomously)

That last category is specific to Claude Code's agent architecture. You can tell Claude to always ask before running destructive commands, how to handle failures, and what external tools it's allowed to call.

## Project Overview
Next.js 14 App Router, TypeScript strict, Tailwind, Supabase.

## Code Conventions
- Named exports only, no default exports
- No `any` type - use unknown and narrow it
- Tailwind classes only, no CSS modules
- Co-locate tests next to source files

## Guardrails
- Never run `rm` - move files to .trash/ instead
- Ask before modifying database migrations
- Do not add unrequested features or refactoring

Optimal length is 50-150 lines. The file is loaded every session, so every line costs tokens. Keep it to what actually changes Claude's behavior.

.cursorrules (Cursor)

Cursor's .cursorrules file serves the same core purpose: tell your AI assistant how your project works. The format is simpler. It's a plain text or markdown file with no required structure - just rules and context written in natural language.

The main differences from CLAUDE.md:

  • No agent behavior directives - Cursor isn't an autonomous agent in the same way Claude Code is
  • Scoped to a workspace, not a project root (Cursor is editor-based)
  • Applied to both chat and autocomplete, not just explicit sessions
  • No memory or skill references - it's a flat config file
You are working on a Next.js 14 application using TypeScript strict mode and Tailwind CSS.

Rules:
- Use named exports only
- No `any` type
- App Router patterns (server components by default)
- Co-locate test files next to source
- Use Tailwind, never inline styles
- Do not add features beyond what was asked

Notice the imperative tone. Cursor documentation recommends writing rules as direct instructions to the model. CLAUDE.md uses markdown headers and bullet points as structured sections. Same information, slightly different framing.

Cursor also supports .cursorignore to exclude files from indexing, and project-level vs global rules. The global rules file applies across all projects - useful for personal preferences that should follow you everywhere.

AGENTS.md (GitHub Copilot / Codex)

AGENTS.md is the newer format, introduced with OpenAI's Codex CLI and subsequently adopted by GitHub Copilot's agent mode. The name signals the intent: this isn't just a style guide, it's a behavioral specification for an agent that will execute multi-step tasks autonomously.

The structure is more explicit about what the agent is allowed to do:

# Agent Configuration

## Project
TypeScript monorepo with Next.js frontend and Express API.

## Tools Available
- run_command: for running tests and builds
- read_file, write_file: for code modifications
- web_search: disabled

## Conventions
- TypeScript strict mode throughout
- Use pnpm, not npm or yarn
- Run `pnpm test` before committing
- No direct database mutations in route handlers

## Task Execution
- Always run tests after changes
- Create a summary of changes made
- Do not modify files outside the scope of the task

The "tools available" and "task execution" sections have no equivalent in .cursorrules. They matter more when the agent is running commands and making file changes on its own. CLAUDE.md covers this through guardrails; AGENTS.md makes it a first-class section.

AGENTS.md is still evolving. The spec isn't locked down the same way .cursorrules is after years of Cursor adoption. Expect the format to change as Codex and Copilot's agent modes mature.

GEMINI.md (Gemini CLI)

Google's Gemini CLI reads GEMINI.md from the project root. It's the newest of the four formats and the most minimal. The approach mirrors CLAUDE.md structurally - markdown file, project root, session-scoped - but with less documentation around what's supported.

## Project
FastAPI backend, Python 3.12, SQLAlchemy with Alembic migrations.

## Conventions
- Type hints on every function
- Pydantic models for request/response validation
- Use pytest, run with `pytest -v`
- No print() statements - use structlog

## Notes
- Read existing code before suggesting changes
- Migrations live in alembic/versions/

If you're using the Gemini CLI alongside other tools, the GEMINI.md content should largely mirror your CLAUDE.md. The behavioral directives are less developed at this point - it's primarily a coding context file rather than an agent behavior spec.

Comparison

Feature CLAUDE.md .cursorrules AGENTS.md GEMINI.md
Format Markdown (structured) Plain text / markdown Markdown (structured) Markdown
Scope Project root Workspace Project root Project root
Coding conventions Yes Yes Yes Yes
Agent behavior Yes (guardrails, skills) Limited Yes (tools, task execution) Minimal
Tool permissions Yes No Yes No
Global rules Via ~/.claude/ Yes (global config) No No
Applies to autocomplete No (session-scoped) Yes No No
Best for Agentic workflows, complex projects Daily coding in Cursor Autonomous task agents Gemini CLI users

The multi-tool problem

Here's what actually happens on teams using multiple tools: someone writes a solid .cursorrules file. Then Claude Code gets added to the workflow. Someone copies the cursorrules content into a new CLAUDE.md. A month later, the TypeScript rules get updated in one file but not the other. The Go conventions get added to CLAUDE.md but never make it to AGENTS.md. You now have four files that each describe a slightly different version of your project.

This is friction that compounds. The more repos you have, the worse it gets. Every new developer has to figure out which file is current. Every convention change has to be made in four places.

The core conventions - how you write code, how tests are structured, what to avoid - don't change based on which AI tool is reading them. Only the format and the tool-specific sections differ.

The cleanest solution is to define your conventions once and generate the format-specific files from that source. That's what ContextKit's generator does: answer five questions about your project, and it outputs CLAUDE.md, .cursorrules, AGENTS.md, and GEMINI.md in the correct format for each tool.

Which format should you prioritize?

If you're using one tool, that tool's format is the only one that matters. Don't over-engineer it.

If you're deciding which tool to invest in first:

  • Use CLAUDE.md if you're doing agentic work - multi-step tasks, autonomous workflows, anything where the AI is making decisions and running commands on its own
  • Use .cursorrules if you're primarily in the Cursor editor and want conventions applied to both chat and autocomplete
  • Use AGENTS.md if your team is already in the GitHub Copilot ecosystem and agent mode is the primary way you work
  • Use GEMINI.md if you're experimenting with Gemini CLI - it's the thinnest format to set up

For most individual developers, CLAUDE.md is worth the investment even if you occasionally use Cursor too. The agent capabilities justify the slightly more structured format, and the guardrails section alone prevents enough mistakes to pay for itself.

Set up all four in one go

If you want to cover all four formats without writing each file by hand, ContextKit generates them from a single input. You describe your project once - stack, conventions, testing setup, what to avoid - and it produces the correct file for each tool. Free, runs in the browser, copy to clipboard.

It also handles the format differences automatically. The agent behavior sections that matter for CLAUDE.md and AGENTS.md get included where relevant. The simpler .cursorrules format strips out the directives that Cursor doesn't use. You get four files that are consistent with each other, not four slightly different interpretations of the same conventions.

If you want to go deeper on CLAUDE.md specifically - structure, sections, examples for different stacks - the complete CLAUDE.md guide covers it in detail.

Want to build your own AI OS?

The AI OS Blueprint gives you the complete system: 53-page playbook, working skills, and a clonable repo. Starting at $47.

30-day money-back guarantee. No subscription.