Gemini CLI reads AGENTS.md once you ask it to
Gemini CLI reads only GEMINI.md until context.fileName says otherwise, so init merges GEMINI.md and AGENTS.md into that list in .gemini/settings.json and both files load. There’s no Ultracite hook for it: Gemini runs ultracite fix and ultracite check through its shell tool because the rules say to, after you approve them or allow them in a policy.
Gemini CLI by GoogleChecked against Gemini CLI 0.63.0
# Ultracite Code Standards
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
## Quick Reference
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`
Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
…{
"context": {
"fileName": [
"GEMINI.md",
"AGENTS.md"
]
}
}- 1
.gemini/settings.jsonItscontext.fileNamedecides which names count as context files.initsets it toGEMINI.mdandAGENTS.md. - 2
~/.gemini/GEMINI.mdYour instructions for every project. - 3
AGENTS.mdUltraciteRead in your workspace directories and their parents, besideGEMINI.md, oncecontext.fileNamelists it. - 4
A folder a tool touchesWhen a tool reads a file or directory, context files there and in its parents, up to a trusted root, load too.
How Gemini CLI reads the rules
Gemini CLI gathers context files from your home directory, your workspace and its parents, and any folder a tool touches, then concatenates them. Every one of those searches uses the names in context.fileName, so listing AGENTS.md there is the whole setup.
- Default name
GEMINI.md. Oncecontext.fileNameis set, the names in it are what Gemini reads, which is whyinitkeepsGEMINI.mdin the list.- Trusted folders
- With folder trust on, an untrusted folder ignores
.gemini/settings.json, so onlyGEMINI.mdloads there. Folder trust is off by default. - Combined
- Every context file found is concatenated and sent with each prompt. The footer shows how many loaded.
- Imports
@file.mdlines pull other Markdown files into a context file, by relative or absolute path.- Check it
/memory showprints the combined context Gemini sees.- Reload
/memory reloadre-scans every context file after you edit one.
Gemini CLI lints through its shell tool
The rules give Gemini ultracite fix and ultracite check, which it runs with run_shell_command. Unless a policy rule allows a command, Gemini asks you first, and in a non-interactive run a rule that asks counts as a deny. A user policy that allows the npx ultracite prefix lets both run without a prompt.
[[rule]]
toolName = "run_shell_command"
commandPrefix = "npx ultracite"
decision = "allow"
priority = 100- 01Gemini edits a file with
write_fileorreplace. - 02Following
AGENTS.md, it callsrun_shell_commandwithnpx ultracite fixornpx ultracite check. - 03The policy engine allows the command, or asks you first if no rule covers it.
- 04Gemini reads the linter’s output from the tool result and fixes what’s left.
Worth knowing about Gemini CLI
Consumer accounts moved on
Since June 18, 2026, Gemini CLI doesn’t serve Google AI Pro, Ultra or Code Assist for individuals accounts, and Google points those users to Antigravity CLI. If that’s you, run
init --agents antigravityinstead. The project itself still ships releases.Hooks exist, unconfigured
Gemini CLI runs
AfterToolhooks from thehookskey in.gemini/settings.json, matched by a regex such aswrite_file|replace. It fingerprints project hooks, so a changed command counts as a new, untrusted hook and you’re warned before it runs. Ultracite doesn’t set one up for Gemini CLI.Context loads just in time
When a tool touches a file or folder, Gemini CLI loads the context files there and in its parents up to a trusted root. A package’s own
AGENTS.mdarrives when Gemini starts working in it.The Ultracite skill
Gemini CLI loads workspace skills from
.gemini/skills/or its.agents/skills/alias, and the alias wins when both hold a skill with the same name.initinstalls the Ultracite skill into.agents/skills/, so Gemini CLI finds it;/skills listshows it.
Gemini CLI questions, answered
- Does Gemini CLI read AGENTS.md?
- Not by default: it reads
GEMINI.md. AddAGENTS.mdtocontext.fileNamein.gemini/settings.json, whichultracite init --agents geminidoes for you while keepingGEMINI.mdin the list. - Can I still use Gemini CLI?
- Google AI Pro, Ultra and Gemini Code Assist for individuals accounts lost access on June 18, 2026, and Login with Google no longer works for them; Google points them to Antigravity CLI. Gemini Code Assist Standard and Enterprise subscriptions are on a separate deprecation schedule.
- Why isn’t Gemini CLI loading AGENTS.md?
- Check that
.gemini/settings.jsonlists it undercontext.fileName, then run/memory reload. If folder trust is on and the folder isn’t trusted, Gemini CLI ignores the project’s settings file, so onlyGEMINI.mdloads. - Does Gemini CLI support hooks?
- Yes:
AfterToolhooks in.gemini/settings.jsonrun after a tool, filtered by a tool-name regex. Ultracite doesn’t configure one, so Gemini CLI lints by running the commands inAGENTS.md. - How do I stop Gemini CLI asking before every lint?
- Add a policy file in
~/.gemini/policies/withtoolName = "run_shell_command",commandPrefix = "npx ultracite"anddecision = "allow". Policy files in a project’s.gemini/policies/don’t take effect yet.
Keep going
- AgentAntigravity CLIGoogle’s terminal coding agent, which took over from Gemini CLI for consumer accounts in June 2026.
- AgentJulesGoogle’s asynchronous agent that works on your repo in a cloud VM and opens pull requests.
- AgentCodexOpenAI’s coding agent for the terminal, IDEs, the ChatGPT desktop app and cloud tasks.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.