---
title: "GEMINI.md (Gemini CLI): paths and format · DotsAgent"
description: "Where GEMINI.md lives, its format and frontmatter, how global and nested copies merge, and which tools read it. Checked 2026-10-01."
url: https://dotsagent.io/instructions/files/gemini-md
---

GEMINI.md

# GEMINI.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.

`GEMINI.md`

```
# 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](https://geminicli.com/docs/cli/gemini-md/) | Native. Rename it or add AGENTS.md through context.fileName; /memory show and /memory reload inspect it. |
| [GitHub Copilot](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) | 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 →](https://dotsagent.io/instructions)

## Other instruction files

[AGENTS.md](https://dotsagent.io/instructions/files/agents-md)

[CLAUDE.md](https://dotsagent.io/instructions/files/claude-md)

[.cursor/rules/*.mdc](https://dotsagent.io/instructions/files/cursor-rules)

[.github/copilot-instructions.md](https://dotsagent.io/instructions/files/github-copilot-instructions)

[.devin/rules/*.md](https://dotsagent.io/instructions/files/windsurf-rules)

[.clinerules/](https://dotsagent.io/instructions/files/cline-rules)

[~/.openclaw/workspace/AGENTS.md](https://dotsagent.io/instructions/files/openclaw-workspace)

## Sources

1. [geminicli.com](https://geminicli.com/docs/cli/gemini-md/)/docs/cli/gemini-md/

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
