# Antigravity & Gemini CLI Doctor & Token Auditor

> Local diagnostic and token optimization tool for Google Antigravity and Gemini CLI via agycraft-mcp.

Antigravity & Gemini CLI Doctor & Token Auditor is a free AI agent skill on Agensi by Yucheng Wang, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Yucheng Wang](https://www.agensi.io/creators/yucheng-wang)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-12-05
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/antigravity-gemini-cli-doctor-token-auditor
- Tags: llm-ops, gemini-api, mcp-server, debugging, google-antigravity

## About this skill

Stop wasting tokens on inefficient Gemini and Antigravity sessions. This skill provides a specialized diagnostic layer for developers using the `agycraft-mcp` ecosystem to manage quota, debug transport errors, and optimize model selection.

### What it does
- **Token Auditing** Inspects 5h, 24h, 7d, 30d, and all-time rollups (`v2` schema) with `global`/`project` scope isolation, `auth_mode` filtering, and shadow cost estimation.
- **Fault Attribution** Categorizes errors into five fault domains, Structured Output / Function Calling errors, and 4 granular GCP / Vertex AI rules (`gcp-vertex-api-disabled`, `gcp-adc-expired`, `gcp-vertex-iam-or-location`, `gcp-vpc-sc-blocked`).
- **KV Cache Analysis** Detects implicit cache misses under 4,096 tokens to improve prompt efficiency.
- **Model Pairing** Recommends optimal Orchestrator and Worker combinations like Neon and Hydrogen based on task type.
- **Config Validation** Audits `mcp_config.json` and `.geminiignore` for common syntax or environment variable issues.

### How it works
1. **Health Check** Run the offline doctor command to scan local configuration files for mismatches or oversized global rules.
2. **Error Diagnosis** Input specific error codes to receive root-cause attribution and copyable fix commands.
3. **Usage Analysis** Review telemetry for Thinking output ratios and context utilization percentages.
4. **Optimization** Apply generated prescriptions to compact sessions or adjust Thinking budgets.

### Frameworks & tools
Built for Google Antigravity (AGY) and Gemini CLI (`agycraft-mcp` v0.2.6+). Integrates via stdio (`npx -y agycraft-mcp@latest`) and works within Antigravity, Gemini CLI, Claude Code, or Cursor environments.

### Why this beats prompting it yourself
Generic LLMs lack the domain-specific knowledge of Antigravity's rolling quota buckets and specific MCP transport quirks. This skill uses local telemetry and predefined fault domains to give you actionable fixes instead of "try restarting" advice.

### Use cases
- Debugging 429 or 503 errors during heavy automated coding sessions.
- Reducing costs by identifying high Thinking output ratios in simple tasks.
- Resolving MCP transport issues in Claude Code or Cursor configurations.
- Selecting the most cost-effective model for lightweight subagent tasks.

### Known limitations
Requires `agycraft-mcp` installed locally via npm. Cannot directly fix upstream Google API outages or modify your billing settings.

## Requires

- Agycraft MCP
- Node.js

## Technical details

Install & Run (v0.2.6+):
npx -y agycraft-mcp@latest doctor
npx -y agycraft-mcp@latest preflight

Register MCP Server:
### Antigravity CLI
agy mcp add agycraft npx -y agycraft-mcp@latest

### Gemini CLI (project-scoped)
gemini mcp add --scope project agycraft npx -y agycraft-mcp@latest

### mcp_config.json / settings.json
{"mcpServers":{"agycraft":{"command":"npx","args":["-y","agycraft-mcp@latest"]}}}

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Antigravity & Gemini CLI Doctor & Token Auditor skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific problems does the Agycraft MCP Doctor solve?葬},{answer:

This skill is a specialized diagnostic layer for the `agycraft-mcp` ecosystem, helping you identify why you're hitting quota limits, why MCP transport is failing, and how to reduce token waste through KV cache analysis.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
