Copy-paste brain files for your AI coding tools.
CLAUDE.md · AGENTS.md · GEMINI.md · Cursor rules (.mdc) · copilot-instructions.md
Generator · Guides · Newsletter · @BrainStacksAI
Your AI forgets your project every time you open a new chat. A brain file fixes that: a short Markdown file in your repo that your AI tool loads automatically at the start of every session, with your stack, commands, rules, and where to keep memory. Write it once, and you stop re-explaining your project (and stop finding API keys in your code).
This repo is a free library of ready-made brain files for common project types, in the format each tool expects. They're built with the same logic as the free BrainStack Brain File Generator, so you can start from a template here or generate a pre-filled one in your browser.
| Tool | File it reads | Where it goes |
|---|---|---|
| Claude Code | CLAUDE.md |
Project root (or .claude/CLAUDE.md). Global: ~/.claude/CLAUDE.md. Supports @path imports; recent versions also read AGENTS.md when there's no CLAUDE.md. |
| AGENTS.md agents (OpenAI Codex, Cursor, GitHub Copilot cloud agent, Google Antigravity, and others) | AGENTS.md |
Project root. Nested AGENTS.md files in subfolders add folder rules. |
| Gemini CLI and Google Antigravity | GEMINI.md |
Project root and subfolders. Global: ~/.gemini/GEMINI.md. Plain Markdown, no frontmatter. |
| Cursor | .cursor/rules/*.mdc |
Must be .mdc with frontmatter (description, globs, alwaysApply). Cursor also reads AGENTS.md. |
| GitHub Copilot | .github/copilot-instructions.md |
Repository-wide. Path-specific: .github/instructions/*.instructions.md with applyTo. |
Not sure? Start with AGENTS.md: the most tools read it. More detail: GEMINI.md vs CLAUDE.md vs AGENTS.md vs Cursor rules vs Copilot.
Every project type comes in all five formats. Same rules, each tool's file name and format.
| Folder | What's inside |
|---|---|
memory/ |
A docs/brain/ memory folder (NOW.md handoff, decision log, architecture, gotchas, glossary). Every template tells the AI to use it. |
extras/one-source-of-truth/ |
Use several AI tools on one repo with a single AGENTS.md plus tiny pointer files (CLAUDE.md with @AGENTS.md, Gemini CLI settings.json, and more). |
extras/scoped-rules/ |
Rules that load only for some files: Cursor globs, Claude Code .claude/rules paths, Copilot applyTo, Antigravity .agents/rules triggers. |
extras/global/ |
A personal "about me" file for ~/.claude/CLAUDE.md or ~/.gemini/GEMINI.md. |
- Pick your project type in the table above and open the file for your tool.
- Copy it to the same path in your project.
CLAUDE.md,AGENTS.md, andGEMINI.mdgo in the root; the Cursor file goes in.cursor/rules/; the Copilot file goes in.github/. - Replace every
TODO. Put in your real versions and commands. Exact versions are what stop your AI from writing outdated code. - Delete what doesn't apply. Shorter files get followed better. Aim for under ~150 lines.
- Copy
memory/docs/into your project root if you want the AI to keep session notes and a decision log. - Test it. Start a fresh session and ask: "What are the rules for this project, and what command runs the tests?" If the answer doesn't match your file, it isn't loaded.
- Commit it. Your AI's brain is now versioned and backed up with your code.
Prefer not to edit by hand? The Brain File Generator fills all of this in from a short form, in your browser. Nothing is uploaded.
Or grab one from the command line, for example:
curl -fsSL -o AGENTS.md https://raw.githubusercontent.com/TheRealSnouk/brainstack-templates/main/templates/web-app/AGENTS.md- Be specific. "Run
npm testbefore saying you're done" beats "test your changes". - Pin versions. "Godot 4.5, never Godot 3 syntax" saves hours.
- Write security rules down. No secrets in code, only deploy the build folder, ask before destructive commands.
- Grow it from mistakes. When you correct the AI on the same thing twice, add a rule.
- No secrets in brain files, ever. They're committed to git and sent to the model.
- What a brain file is (and why your AI keeps forgetting)
- GEMINI.md vs CLAUDE.md vs AGENTS.md vs Cursor rules vs Copilot instructions
- How to write a GEMINI.md for Gemini CLI and Antigravity
- Set up your AI for a vibe-coded web app in 10 minutes
- Set up an AI agent for a Godot or Unity game project
- Set up AI for a Discord bot project
- Give your AI long-term memory (and back it up)
Official docs: Claude Code memory · AGENTS.md · Gemini CLI GEMINI.md · Antigravity rules · Cursor rules · Copilot custom instructions
AI tools change fast. These templates were checked against the official docs in October 2026; if something behaves differently, please open an issue.
The free BrainStack newsletter sends one short email when there's a new guide, template, or AI setup trick worth stealing. Subscribers also get the Brain File Starter Pack: these templates in one zip, plus a printable quickstart.
Fixes and new templates are welcome. See CONTRIBUTING.md.
MIT. Use these in any project, commercial or not. No attribution required (but a star helps others find it ⭐).
BrainStack is independent and not affiliated with Anthropic, Google, OpenAI, Cursor (Anysphere), or GitHub. Product names are trademarks of their owners.