Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview

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.

…
Ultracite’s rules
{
  "context": {
    "fileName": [
      "GEMINI.md",
      "AGENTS.md"
    ]
  }
}
Merged
Where Gemini CLI looks for instructions
  1. 1.gemini/settings.jsonIts context.fileName decides which names count as context files. init sets it to GEMINI.md and AGENTS.md.
  2. 2~/.gemini/GEMINI.mdYour instructions for every project.
  3. 3AGENTS.mdUltraciteRead in your workspace directories and their parents, beside GEMINI.md, once context.fileName lists it.
  4. 4A 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. Once context.fileName is set, the names in it are what Gemini reads, which is why init keeps GEMINI.md in the list.
Trusted folders
With folder trust on, an untrusted folder ignores .gemini/settings.json, so only GEMINI.md loads 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.md lines pull other Markdown files into a context file, by relative or absolute path.
Check it
/memory show prints the combined context Gemini sees.
Reload
/memory reload re-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
  1. 01Gemini edits a file with write_file or replace.
  2. 02Following AGENTS.md, it calls run_shell_command with npx ultracite fix or npx ultracite check.
  3. 03The policy engine allows the command, or asks you first if no rule covers it.
  4. 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 antigravity instead. The project itself still ships releases.

  • Hooks exist, unconfigured

    Gemini CLI runs AfterTool hooks from the hooks key in .gemini/settings.json, matched by a regex such as write_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.md arrives 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. init installs the Ultracite skill into .agents/skills/, so Gemini CLI finds it; /skills list shows it.

Gemini CLI questions, answered

Does Gemini CLI read AGENTS.md?
Not by default: it reads GEMINI.md. Add AGENTS.md to context.fileName in .gemini/settings.json, which ultracite init --agents gemini does for you while keeping GEMINI.md in 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.json lists it under context.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 only GEMINI.md loads.
Does Gemini CLI support hooks?
Yes: AfterTool hooks in .gemini/settings.json run after a tool, filtered by a tool-name regex. Ultracite doesn’t configure one, so Gemini CLI lints by running the commands in AGENTS.md.
How do I stop Gemini CLI asking before every lint?
Add a policy file in ~/.gemini/policies/ with toolName = "run_shell_command", commandPrefix = "npx ultracite" and decision = "allow". Policy files in a project’s .gemini/policies/ don’t take effect yet.

Ship less slop

One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.