Model Selection, Thinking Levels & Context Token Management
Spend two weeks running agy on real projects and four familiar bottlenecks quickly surface:
- Leaving maximum thinking enabled for a two-line YAML tweak, waiting thirty seconds of internal reasoning for fifty words of output;
- Forcing a single heavy model through everything from architecture design to bulk test edits, burning quota fast while responses get steadily slower;
- Staying in one session for thirty or forty turns until giant logs and abandoned approaches pile up in the window and the model starts losing track of earlier constraints;
- Wiring up five or six MCP servers at once and wondering whether tool schemas have already eaten half your context before you even start working.
Grounded in the actual model list from my local agy v1.5.19 installation and aligned with the official models and context-and-tokens docs, this guide breaks down model selection, Thinking Levels, context window anatomy, and four practical habits for keeping token usage under control.

1. Local agy models Breakdown: Five Model Categories
Visible models vary slightly by account tier (Free / Pro / Ultra / Gemini Enterprise), so the most reliable source of truth is running agy models directly in your terminal. Here is the full list of available models returned locally on agy v1.5.19:

Twenty-plus entries look busy at first glance, but they fall cleanly into five categories with distinct roles:
| Category | Verified Local Model IDs | Role & Best Fit |
|---|---|---|
| Gemini 4 Mainline | gemini-4-neon-{low,medium,high,xhigh}gemini-4-carbon-{low,medium,high}gemini-4-argon-{low,medium,high} |
Neon: Balanced daily driver combining deep reasoning with fast turnaround; supports xhighCarbon: Built for long-chain complex reasoning, large refactors, and multi-agent coordination Argon: Earlier reasoning line, gradually being replaced by Neon |
| Gemini 4 Lightweight Execution | gemini-4-hydrogen-{low,medium,high,xhigh} |
High-speed execution workhorse—snappy feedback for small edits and unit tests; also serves as the execution engine under Orchestrator |
| Orchestrator Routing | gemini-pro-orchestrator-neongemini-pro-orchestrator (Carbon)gemini-pro-orchestrator-argon |
Dynamic multi-model orchestration: Automatically uses a frontier model for exploration and planning, then hands file edits and verification off to Hydrogen within the same turn |
| Flash & Open-Source Models | gemini-3.8-flash-{low,medium,high}gpt-oss-120b-medium |
Flash: High throughput and large context window, ideal for -p scripts and CI checksGPT-OSS: Open-source option fixed at the medium tier |
| Claude 5.5 Partner Line | claude-opus-5-5-{low,medium,high}claude-sonnet-5-5-{low,medium,high} |
Third-party model integration—great for cross-model code review, double-checking complex designs, or matching personal coding style preferences |
Watch model lifecycles: The official model docs explicitly mark legacy and transitional models—gemini-3.8-flash, gemini-4-argon, and gpt-oss-120b-medium—for gradual deprecation, with Gemini 4 Neon, Carbon, and Hydrogen taking over. In shared team CI scripts, pass --model via an environment variable instead of hardcoding specific model IDs across a dozen pipelines.
My own day-to-day picks stay simple:
- Daily driver:
gemini-4-neon-mediumorgemini-pro-orchestrator-neon. - Hard bugs / cross-module refactors:
gemini-4-carbon-highorgemini-4-neon-xhigh. - Quick fixes / repetitive boilerplate:
gemini-4-hydrogen-lowormedium. - Cross-model review: After implementing a feature on Gemini, run a quick diff review with
claude-opus-5-5-highorclaude-sonnet-5-5-high—a second model family often catches blind spots.
2. Thinking Levels (--effort) & Orchestrator Mode
Picking the right model is only half the equation. On the exact same gemini-4-neon, running at low versus xhigh makes a dramatic difference in perceived speed, answer quality, and token spend.
1. Choosing Between the Four Tiers
In agy, you can set the reasoning tier at startup via --effort or a model ID suffix, or adjust it live mid-session with /effort <tier>:
1 | # Option 1: Pass --model and --effort separately |
Here is a practical boundary for the four standard tiers:
| Tier | Best-Fit Tasks | Trade-off |
|---|---|---|
low |
Copy edits, adding unit tests, config lookups, formatting, simple file searches | Near-instant response with minimal thinking tokens |
medium |
Default daily tier—standard feature work, routine bug fixes, API integration | Balanced speed and accuracy; covers ~80% of daily engineering |
high |
Root-cause analysis, concurrency/state-machine bugs, multi-file refactors, design work | Thinks before acting, cutting down back-and-forth rework |
xhigh |
Hard-to-reproduce edge cases, low-level architecture trade-offs (supported on select models such as Neon and Hydrogen) | Noticeably longer thinking latency—turn on only when the problem earns it |
One detail the official docs specifically call out: Gemini’s thinking_level and Claude’s effort do not scale the exact same dimensions. Gemini’s thinking level primarily extends hidden internal reasoning depth, whereas Claude’s effort scales both overall output budget and tool-call overhead. When switching to Claude 5.5 for straightforward tasks, avoid leaving high enabled out of habit.
2. When to Reach Directly for Orchestrator
Many developers assume Orchestrator is just a static prompt-classification router. It is not—it dynamically coordinates two model classes within a single turn:
- A frontier planning model (Neon / Carbon / Argon) performs read-only exploration, breaks down steps, and designs the edit plan;
- Once the plan is solid, mechanical file edits, builds, and unit-test runs are handed off to the ultra-fast
gemini-4-hydrogen; - If tests fail or the build breaks, control returns to the planner to revise the strategy and re-verify until everything passes.
Orchestrator shines on medium-to-high complexity tasks that involve heavy mechanical editing and iterative test runs—for instance, propagating a schema field change across 15 files and getting the entire test suite green. Using a heavy model for all 15 edits is slow and expensive, while a lightweight model alone tends to miss edge cases. Orchestrator captures the best of both worlds.
One hard Orchestrator constraint: Because Orchestrator manages its own internal multi-model reasoning settings, manual --effort flags and /effort commands do not apply to Orchestrator models. When you explicitly need full high or xhigh depth to dissect a low-level bug, switch to standalone gemini-4-neon-xhigh or gemini-4-carbon-high.
3. One-Off Model Switches: /model <model> <prompt>
Often your main session is humming along on a lightweight or balanced model, and you hit a single tricky design call—or want a second opinion on a freshly written diff.
Instead of switching your session model and switching back afterward, invoke another model for a single turn inline:
1 | /model claude-opus-5-5-high Review the current uncommitted changes, focusing on transaction boundaries and concurrency race conditions |
That single turn executes on claude-opus-5-5-high, and your session automatically stays on its original default model afterward.
4. One Flowchart for Picking Models and Tiers
flowchart TD
S["Start a task"] --> Q1{"Complex reasoning or<br/>multi-file changes?"}
Q1 -- "No: small fixes / CI scripts" --> L1["Lightweight model + low / medium<br/>e.g. gemini-4-hydrogen-low<br/>or gemini-3.8-flash-low"]
Q1 -- "Yes" --> Q2{"Heavy mechanical edits<br/>& repeated build/test loops?"}
Q2 -- "Yes" --> O1["Use Orchestrator<br/>e.g. gemini-pro-orchestrator-neon<br/>(auto split: planning + execution)"]
Q2 -- "No" --> Q3{"Need max manual thinking depth<br/>for deep RCA or architecture?"}
Q3 -- "Yes" --> H1["Standalone mainline + high / xhigh<br/>e.g. gemini-4-neon-xhigh<br/>or gemini-4-carbon-high"]
Q3 -- "No" --> M1["Standalone mainline + medium<br/>e.g. gemini-4-neon-medium"]
O1 --> R1{"Need a second perspective<br/>on a critical diff?"}
H1 --> R1
M1 --> R1
R1 -- "Yes" --> C1["One-off model switch<br/>/model claude-opus-5-5-high ..."]
R1 -- "No" --> E1["Stay on current model to preserve prefix cache"]
3. What Actually Lives Inside the Context Window
The official context-and-tokens guide uses a sharp analogy: treat the context window like RAM, not a hard drive. Even when a model advertises a 512K or 1M window, dumping unrelated logs and stale code into it still dilutes attention, spikes latency, and causes answers to drift.
In a typical session, the payload sent to the model is assembled from five layers:
| Layer | Loading Behavior | Budget & Bloat Controls |
|---|---|---|
| System prompt & built-in tools | Pinned prefix on every request | Officially maintained at the very front for maximum cache hit rate |
| Always-On Rules | Auto-injected at session start | Global + project rules share a 20,000-token budget (24,000-byte per-file cap) |
| Skills index | Progressive disclosure (on demand) | Only names and short trigger descriptions stay resident; full SKILL.md is read on match |
| MCP tool definitions | Lazy-loading by default | Full parameter schemas stay on disk and load only when a tool is called |
| Conversation history & tool outputs | Accumulates turn by turn | The real window consumer; compressed into Checkpoints via auto/manual /compact |
Antigravity builds three anti-bloat safeguards directly into these layers so you do not have to micromanage static overhead:
1. Dedicated 20,000-Token Rules Budget & Automatic Downgrade
Global and project AGENTS.md, GEMINI.md, and always-on .agents/rules/*.md files are not injected without limit—they share a hard 20,000-token budget, with a 24,000-byte cap per rule file.
If a team drops a massive style manual into the repo and blows past the cap, Antigravity does not overflow the window. Instead, it automatically downgrades the largest rule files into on-demand pointers, loading their full bodies only when trigger conditions match. Even with that safety net, keep Rules limited to non-negotiable invariants and move multi-step workflows or long references into Skills.
2. Progressive Disclosure for Skills
Each Skill (.agents/skills/<name>/SKILL.md) has a tiny idle footprint: the runtime indexes only its name and description. Only when your request matches a Skill does the agent call read_file to load the full SKILL.md and any references/. As a result, installing a dozen local Skills adds virtually no drag to everyday sessions.
3. Default Lazy Loading for MCP Tools
A classic headache with older agent clients is connecting four or five MCP servers—GitHub, Jira, Chrome DevTools, a database—and watching dozens of JSON tool schemas swallow 20,000–30,000 tokens on turn one.
Antigravity enables MCP lazy loading by default:
- At startup, only a lightweight index of tool names per MCP server enters the context;
- Full parameter schemas stay on local disk (
<appDataDir>/mcp/<serverName>/<toolName>.json), outside active context; - Only when the agent decides to call a specific MCP tool does it read that tool’s schema on demand and execute the call.
That lets you keep your regular MCP servers wired up permanently instead of toggling configs before every task.
4. Four Practical Habits for Controlling Token Usage
The runtime guards Rules, Skills, and MCP overhead for you, but what actually fills the window in practice is the snowball of file reads, command outputs, and long conversation histories. Sticking to four simple habits dramatically improves stability in long sessions.
Habit 1: Watch /context Headroom and /compact at Milestones with Explicit Focus
Do not wait until the model starts forgetting constraints or giving off-target answers before cleaning up context.
- Run
/contextanytime: it renders a breakdown of current token utilization—total capacity, per-category usage (conversation, tool outputs, Rules, Skills, MCP), and how many Checkpoints have been created. - Run manual
/compactat logical milestones: Whenever you wrap up a distinct phase (for example, finishing root-cause diagnosis before starting code edits, or getting Module A’s tests green before moving on to Module B), compact proactively. - Always specify what to preserve: Running a bare
/compactrisks summarizing away the exact constraint you care about most. Make a habit of passing retention instructions:
1 | /compact Keep the migration constraints for the new columns on the users table, the confirmed API response format, and the 2 remaining failing integration test paths |
- Use
/btwfor quick side questions: If you suddenly want to check something tangential mid-task—like the Node version constraint inpackage.json—do not derail the main thread. Use/btwfor an out-of-band lookup so unrelated chatter never pollutes your primary history.
Habit 2: Target Files Precisely with @ Instead of Letting the Model Grep the Whole Repo
Two ways of asking the same question can easily differ by 10x in token spend:
- Vague prompt: “Check why the login endpoint occasionally returns 401” → The agent ends up grepping the entire repository, reading seven or eight middleware and config files, and scanning routing tables—burning 30,000–40,000 input tokens before writing a single line.
- Targeted prompt: “
@src/auth/jwt.ts@src/middleware/session.tsToken refresh occasionally returns 401; focus on expiration checks and the concurrent refresh lock” → Pins the exact two files and isolates the root cause in two steps.
The same rule applies to error logs: paste only the key stack trace plus ~30 lines of surrounding context, or write the full log to disk and let the agent filter it with shell commands. Never dump a 2,000-line build log straight into the prompt box.
Habit 3: Offload Cross-Directory Exploration to a Read-Only Subagent
When surveying a large repository, tracing a config key across dozens of services, or following a cross-module call chain, the agent inevitably reads dozens of files and runs a dozen searches. Roughly 90% of that intermediate output is exploration noise—if it runs in your main session, half the window is already full before implementation even starts.
A cleaner pattern is delegating exploration to a built-in read-only Subagent (such as research):
- The Subagent searches freely and reads dozens of files inside its own isolated context window;
- When finished, it returns only a distilled summary of file paths, line numbers, and findings to the parent session;
- Your main session stays clean, spends only a few hundred tokens to absorb the conclusion, and jumps straight into implementation.
Habit 4: Don’t Accidentally Bust Prompt Caching
Many developers fixate on trimming output tokens while overlooking the real cost driver: the input prefix re-sent on every single turn.
Look back at the real usage metrics captured in the previous post via agy -p ... --output-format json on agy v1.5.19:
1 | { |
Even on a tiny two-step run, 9,987 out of 14,195 input tokens hit cache_read_tokens (~70% cache hit rate). The backend caches the stable prefix—“system prompt + tool definitions + Rules + prior history”—in KV cache. As long as the prefix stays byte-for-byte identical on the next turn, it is reused directly, cutting both latency and quota burn.
Conversely, three common missteps instantly bust the prefix cache, forcing tens of thousands of tokens to be recomputed from scratch on the next turn:
- Flipping the primary model back and forth mid-session: Prefix caches are not shared across model families. When you need a second model to inspect something, use the one-off
/model <model> <prompt>syntax instead of changing your session model. - Repeatedly editing always-on Rules files mid-session: Rules sit near the very start of every request. Changing a single byte invalidates the entire downstream history cache. After updating Rules, start a fresh session to pick them up cleanly.
- Compulsively running
/compactevery couple of turns: Compaction rewrites earlier history, which is equivalent to flushing your warm cache. While window headroom is still healthy (a few turns in, no huge logs), leave it alone—continuous prefix cache hits are both faster and cheaper.

















