GEMINI.md explained

What is GEMINI.md?

GEMINI.md is a Markdown context file that Google Gemini CLI loads automatically to give the model project instructions, style rules, and persona.

GEMINI.md meaning

`GEMINI.md` is the context file used by Gemini CLI, Google's open-source terminal AI agent. It is a plain Markdown file that the CLI loads automatically before every interaction, so the model starts each request already knowing your project rules, coding style, and preferences. Instead of repeating the same instructions in every prompt, you define them once in GEMINI.md.

The idea mirrors other agent memory files: CLAUDE.md for Claude Code and AGENTS.md for cross-agent instructions. GEMINI.md is the Gemini-specific version.

What to put in GEMINI.md

How hierarchical loading works

Gemini CLI sources context from several levels and concatenates them before sending to the model:

  1. Global: `~/.gemini/GEMINI.md` provides default instructions for all your projects.
  2. Project: a GEMINI.md in your workspace and its parent directories adds project-specific context.
  3. Local: the CLI scans subdirectories so a GEMINI.md inside a component folder can add highly specific rules that only apply there.

More specific files build on the broader ones, which keeps shared rules in one place while still allowing local overrides.

A short GEMINI.md example

# GEMINI.md

## Project
Python FastAPI service. Source in `app/`.

## Commands
- Install: `uv sync`
- Test: `pytest`
- Run: `uvicorn app.main:app --reload`

## Style
- Type hints required
- Prefer httpx over requests

## Persona
Be concise. Explain trade-offs briefly.

Why GEMINI.md improves AI responses

Giving the model the right context up front means fewer wrong guesses about commands, libraries, and conventions. The assistant produces code that fits your project on the first try more often, which reduces back-and-forth and review time. It is one of the cheapest ways to make a terminal AI agent reliable.

GEMINI.md vs CLAUDE.md vs AGENTS.md

All three are Markdown instruction files loaded automatically by their tools. CLAUDE.md is for Claude Code, GEMINI.md is for Gemini CLI, and AGENTS.md is a cross-agent open format. If you use several tools, keep shared rules in AGENTS.md and tool-specific tweaks in CLAUDE.md or GEMINI.md. See the full guide to AI agent instruction files.

Write GEMINI.md with a live preview

Draft GEMINI.md in the Markdown Docs online editor to preview headings and command blocks, or download Markdown Docs to edit it locally on Windows with autosave.

Related references

FAQ

Where do I put GEMINI.md?

Put a global file at ~/.gemini/GEMINI.md for all projects, and a project GEMINI.md at your repository root. You can add more in subfolders for local rules.

Is GEMINI.md the same as CLAUDE.md?

They serve the same purpose but for different tools. GEMINI.md is read by Gemini CLI; CLAUDE.md is read by Claude Code.

Does Gemini CLI load GEMINI.md automatically?

Yes. Gemini CLI concatenates the GEMINI.md files it finds and sends them to the model with every prompt.

Can I have multiple GEMINI.md files?

Yes. Global, project, and subdirectory files are merged, with more specific files adding to the broader ones.