GrepBoard/Manuals
605 manuals ·

Gemini CLI Is Not Loading Your GEMINI.md

·Tested on Gemini CLI 0.64.0 · Node.js 24.22 · Ubuntu 24.04·Test scope ↓·6 steps

GEMINI.md rules ignored? List the files Gemini CLI loaded with /memory list, then check folder trust, the file name, the .git boundary and context.fileName.

You wrote rules in GEMINI.md and the answers did not change, so the file was probably never read. Before guessing, look at the list of files the CLI actually loaded.

[1] List the loaded files. In the interactive UI, type /memory list. The same command through -p looks like this (one global file and one project file exist).

console
$ cd /srv/app$ gemini -p "/memory list"There are 2 GEMINI.md file(s) in use: /home/user/.gemini/GEMINI.md/srv/app/GEMINI.md

If the file you expect is missing, work through steps 2–5. If it is listed but the rules are still ignored, loading is fine and the problem is the instruction text. Print the content with /memory show.

[2] Check that the folder is trusted. In an untrusted folder the project-level GEMINI.md is not read; in the installed bundle's source, project memory is emptied when the folder is not trusted. Interactively, a new folder prompts for trust — accept it. In non-interactive runs (-p, CI) the CLI stops instead:

console
$ gemini -p "/memory show"Gemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments

[3] Check the file name. The default is exactly GEMINI.md. On a Linux filesystem, create gemini.md and GEMINI.txt and both are skipped.

console
$ lsGEMINI.txt  gemini.md$ gemini -p "/memory list"There are 1 GEMINI.md file(s) in use: /home/user/.gemini/GEMINI.md

The one file listed is the global one. Rename yours to GEMINI.md.

[4] Check the location. Per the official docs, files are read from three places.

ScopeLocation
Global~/.gemini/GEMINI.md
Project and parentsthe workspace folder and its parent folders
Subdirectorythe folder of a file a tool touches, and its ancestors

The upward search stops at the folder that contains .git. In the test, a GEMINI.md placed outside the .git folder was not loaded.

console
$ ls -A /srv/outer /srv/outer/app/srv/outer:app  GEMINI.md /srv/outer/app:.git$ cd /srv/outer/app && gemini -p "/memory list"There are 1 GEMINI.md file(s) in use: /home/user/.gemini/GEMINI.md

Without any .git, the upward search ends at the folder you started in. Opened in proj/sub, only proj/sub/GEMINI.md was read and proj/GEMINI.md was not; after creating .git in proj, both were read. To change the boundary, set context.memoryBoundaryMarkers in settings.json (default [".git"], restart required, an empty array disables the upward search). The settings file is the same one used in step 5.

[5] If the repository uses another name such as AGENTS.md, add it with context.fileName. It accepts a string or an array.

.gemini/settings.json
{  "context": {    "fileName": ["AGENTS.md", "GEMINI.md"]  }}

Before the setting, AGENTS.md was not in the list; after it, it was.

console
$ gemini -p "/memory list"There are 2 GEMINI.md file(s) in use: /home/user/.gemini/GEMINI.md/srv/app/AGENTS.md

[6] After editing a file mid-session, force a re-read. The docs give /memory reload; in 0.64.0, /memory refresh produced the same result (an alias).

console
$ gemini -p "/memory reload"Reloading memory from source files...Memory reloaded successfully. Loaded 525 characters from 2 file(s)

/memory show prints everything that was loaded: the exact text the model receives, global first and then project, each part wrapped in --- Context from: <path> ---.

Docs: GEMINI.md · Memory management tutorial · Trusted folders

#gemini-cli#gemini-md#memory