Skip to main content

Overview

Every AI coding tool reads project-specific instructions from config files. This reference covers all major tools so you can configure your project once and support multiple workflows.

Quick Reference

ToolConfig FileGlobal LocationNested Support
Claude CodeCLAUDE.md~/.claude/CLAUDE.mdYes
Gemini CLIGEMINI.md~/.gemini/GEMINI.mdYes
OpenCodeAGENTS.md~/.opencode/AGENTS.mdYes
Cursor.cursorrules~/.cursor/rules/Yes
GitHub Copilotcopilot-instructions.mdN/ANo
Windsurf.windsurfrules~/.codeium/windsurf/Yes
AiderCONVENTIONS.md~/.aider.conf.ymlNo
OpenAI CodexAGENTS.mdN/AYes

Detailed Configuration

Project file: CLAUDE.md in project rootGlobal file: ~/.claude/CLAUDE.mdNested support: Yes - place CLAUDE.md in subdirectories for module-specific context
project/
├── CLAUDE.md              # Project-wide instructions
├── src/
│   ├── CLAUDE.md          # src-specific context
│   └── api/
│       └── CLAUDE.md      # API module context
└── .claude/
    └── settings.json      # Tool configuration
Example content:
# Project: My App

## Tech Stack
- TypeScript, React, Node.js
- PostgreSQL with Prisma ORM

## Conventions
- Use functional components with hooks
- Prefer named exports
- Tests in `__tests__/` directories

## Commands
- `npm run dev` - Start development
- `npm test` - Run tests

Universal Template

Use this template that works across most tools:
# Project: [Name]

## Overview
[1-2 sentence description]

## Tech Stack
- [Language/Framework]
- [Database]
- [Key libraries]

## Project Structure
- `/src` - Source code
- `/tests` - Test files
- `/docs` - Documentation

## Conventions
- [Coding style rules]
- [Naming conventions]
- [File organization]

## Commands
- `[dev command]` - Start development
- `[test command]` - Run tests
- `[build command]` - Build for production

## Important Notes
- [Critical warnings]
- [Non-obvious behaviors]
- [Security considerations]

Multi-Tool Setup

Support multiple AI tools in one project:
project/
├── CLAUDE.md              # Claude Code
├── GEMINI.md              # Gemini CLI
├── AGENTS.md              # OpenCode / Codex
├── .cursorrules           # Cursor
├── .windsurfrules         # Windsurf
├── .github/
│   └── copilot-instructions.md
└── CONVENTIONS.md         # Aider
DRY approach: Create one source file and symlink others:
# Create main instructions
echo "# Project Instructions..." > CLAUDE.md

# Symlink for other tools
ln -s CLAUDE.md GEMINI.md
ln -s CLAUDE.md AGENTS.md
ln -s CLAUDE.md .cursorrules
ln -s CLAUDE.md .windsurfrules

Best Practices

  • Keep instructions under 2000 words (fits in context)
  • Update when tech stack changes
  • Include “why” not just “what”
  • List common commands developers need
  • Note non-obvious project quirks
Avoid:
  • Duplicating documentation that’s elsewhere
  • Including secrets or credentials
  • Over-specifying obvious conventions
  • Contradicting tool defaults without reason