GEMINI.mdGEMINI.md (Gemini CLI): where it lives and how tools read it
GEMINI.md is the context file Gemini CLI sends with every prompt. It can also read AGENTS.md or any other name you set in context.fileName.
Where it lives
- Global: ~/.gemini/GEMINI.md.
- GEMINI.md in the workspace directories and their parents.
- GEMINI.md found just in time in directories that tools access, and their ancestors up to a trusted root.
Format
Markdown with no frontmatter. Include other files with @file.md, relative or absolute, through the Memory Import Processor. The file name is configurable via context.fileName, as a string or a list.
# Project context
@./docs/architecture.md
## Commands
- Install: `uv sync`
- Test: `uv run pytest`
- Lint: `uv run ruff check .`
## Rules
- Target Python 3.13 with type hints on public functions.
- Keep database code in app/db/.
- Never run migrations against production.
Precedence and merging
Files load in order: global, then workspace and ancestor directories, then just-in-time discoveries. All of them are concatenated and sent with every prompt, so nothing is overridden.
Tools that read it
| Tool | Support |
|---|---|
| Gemini CLI | Native. Rename it or add AGENTS.md through context.fileName; /memory show and /memory reload inspect it. |
| GitHub Copilot | Reads a root GEMINI.md as agent instructions, as an alternative to AGENTS.md. |
Tips
- Set context.fileName to ["AGENTS.md", "GEMINI.md"] in .gemini/settings.json to share one file with other agents.
- Every loaded file rides along with every prompt, so trim anything the model doesn't need each time.
- Use /memory show to see exactly what Gemini CLI loaded, and /memory reload after editing.
Generate an AGENTS.md and matching rule files for five tools from one form. Open the AGENTS.md generator →
Other instruction files
AGENTS.mdCLAUDE.md.cursor/rules/*.mdc.github/copilot-instructions.md.devin/rules/*.md.clinerules/~/.openclaw/workspace/AGENTS.md