gemini-doctor

gemini-doctor is a command for Claude Code from azmym/gemini-plugin. It costs 18 tokens per session (1,061 once invoked), scanned A, original, MIT.

A diagnostic command for checking whether Gemini grounding works in the current session. It checks the API key, the connection to the Gemini service, and the path used to ground prompts.

In plain words
What is it for?
Use it to troubleshoot Gemini grounding and see evidence for which part of the setup is working or failing.
Why use it?
It helps distinguish a missing configuration or unavailable service from a session that simply needs to be restarted.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the gemini-plugin plugin — 9 skills, 6 commands, 5 agents, 7 hooks shipped together

Good fit Use it to troubleshoot Gemini grounding and see evidence for which part of the setup is working or failing.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add azmym/gemini-plugin
Claude Code
/plugin install gemini-plugin

Made for: Claude Code.

Or install gemini-plugin, the plugin that ships this one along with the rest of its 9 skills, 6 commands, 5 agents, 7 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gemini-doctor

README.md
[![agentmods](https://agentmods.dev/badge/commands/azmym/gemini-plugin/gemini-doctor.svg)](https://agentmods.dev/commands/azmym/gemini-plugin/gemini-doctor)
Your own site
<a href="https://agentmods.dev/commands/azmym/gemini-plugin/gemini-doctor"><img src="https://agentmods.dev/badge/commands/azmym/gemini-plugin/gemini-doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,061 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.01061
Opus 5 $0.00009 $0.00531
Sonnet 5 $0.00004 $0.00212
Haiku 4.5 $0.00002 $0.00106

Measured 7d ago against content hash 6feb65ecfab8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

gemini-doctor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/gemini-doctor.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running the /gemini-plugin:gemini-doctor slash command. Your job is to diagnose, with EVIDENCE, whether Gemini grounding actually works in THIS session, and to distinguish a real outage from a stale session that needs a restart.

Run all four checks below, then print the summary table. Do not skip a check because an earlier one failed; each is independent diagnostic signal.

Check 1: API key configured

Read the API key presence WITHOUT printing the key itself. Run:

test -n "${CLAUDE_PLUGIN_OPTION_GEMINI_API_KEY:-}${GEMINI_API_KEY:-}" && echo "key: present" || echo "key: MISSING"

PASS if "key: present". If MISSING, the user has not configured the API key (re-run plugin install, or set it in plugin config).

Check 2: MCP server reachable from the MAIN agent

Use ToolSearch with the query select:mcp__plugin_gemini-plugin_gemini__gemini_search_grounded to load the tool schema. If that returns no match, also try select:mcp__gemini__gemini_search_grounded (the namespace used for a manual, non-plugin install).

  • PASS if either tool schema loads. Record the exact tool name that matched; call this RESOLVED_TOOL.
  • FAIL if neither loads (the MCP server is not registered in this session).

If a tool resolved, CALL it once with a trivial query (parameter is prompt), for example {"prompt": "what is the current stable Node.js LTS version"}.

  • PASS if it returns real results with citation URLs.
  • FAIL if the call errors (server registered but not responding, for example a bad API key or the uvx process failing to start).

Check 3: Subagent grounding path (THE important one)

This is the check that catches the stale-session bug: the main agent can reach the MCP server, but the gemini-researcher subagent loaded at session start has an outdated definition and cannot.

Spawn @agent-gemini-plugin:gemini-researcher with this exact task:

DIAGNOSTIC: Report the exact names of every tool in your inventory whose name
contains "gemini" or "search". Then, if you have a grounded-search tool, call it
with the query "current stable Node.js LTS version" and report whether it
returned real URLs. Return your JSON verdict with the resolved tool name in the
reasoning field, or "NO GEMINI TOOL IN INVENTORY" if you have none.

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 109 lines · 18 tokens per session scan A 6feb65ecfab8

Subscribe to this mod's changes

gemini-doctor is a command published in the GitHub repository azmym/gemini-plugin (1 stars, last pushed yesterday), licensed MIT. It adds 18 tokens to every session and 1,061 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.