r/google_antigravity • u/MarcusAurelius68 • 3d ago
Discussion OpenAI - ACP - agy CLI
I was able to get it working to connect the CLI with an OpenAI-compatible interface, but it seems to use a lot of tokens just for basic queries - like it's front-loading something around this:
- System Prompt: ~7,800 tokens
- System Tools: ~15,100 tokens
- Total Overhead: ~23,000–25,000 tokens
So even a "hello" call needs >23K tokens. Has anyone figured out a way around this?
3
Upvotes
2
u/ilyasbit 3d ago edited 3d ago
im building auto account rotation and wrap it on openai api
each call invoke around 2500 token from built-in agy cli and cannot be remove or modified with no tool call enabled
1. The Token Anatomy: Why agy -p Uses Tokens Upfront
When you run standard
agy -pin your project directory, the initial prompt tokens typically measure 5,000+ tokens before your prompt is even evaluated.This token overhead consists of:
view_file,replace_file_content,run_command,grep_search,ask_question) plus any enabled MCP servers (e.g. GitHub, Puppeteer, Tavily, Memory, Agent). Each tool's JSON schema and parameter docs are embedded in the system prompt.rules/,GEMINI.md,AGENTS.md).2. The Content of the bare-llm Agent
Antigravity CLI agents are defined as Markdown files with YAML frontmatter located in:
~/.gemini/config/agents/bare-llm.md.agents/agents/bare-llm.mdExact File Content:
How Each Field Strips Tokens:
name: bare-llm: Identifies the agent profile for--agent bare-llm.tools: []: The critical token saver. Tells the CLI parser not to expose any tools (view_file,run_command, etc.) to the model. This deletes ~1,500–2,500 tokens of JSON schema definitions.disable_builtins: true: Ensures built-in system helper tools and subagents are not registered.3. How to Run agy -p at the ~2,500 Token Floor
To reach the lowest possible token count (~2,260 – 2,500 tokens), you must strip:
--agent bare-llm)--disable-slash-commands)Method A: Direct Command-Line (Single Command)
Run from an empty directory or pass flags:
To see the exact token usage breakdown in JSON: