Gemini CLI, Antigravity & Jules, Taken Apart
Google built both basic shapes of an agent harness: an interactive one that runs in your terminal and an asynchronous one that works alone in a cloud VM and returns a pull request. Both dismantled into eight layers, with the 2026 product move explained.
1. Case file
- In one sentence.
- Google built the two basic shapes of a coding harness as separate products: an interactive terminal agent (Gemini CLI, now Antigravity CLI for individuals) and an asynchronous cloud agent (Jules) that plans, works alone and returns a pull request.
2. The whole system in one picture
- The left half of the diagram is the interactive harness, the right half the asynchronous one.
๐๏ธ The whole system, layer by layer, with one task traced
Same eight-layer reference stack in every article of the series. Components and calls are drawn from the project's documentation and code; where internals are not public the drawing is inferred from documented behaviour. The monospace box shows what actually moves between layers at each step (simplified).
3. Layer by layer
L1๐ฅ๏ธ Interfaces ยท Where people (or other agents) talk to it
- What it does
- Two front doors for two working styles.
- How it is built here
- Gemini CLI in the terminal (open source, Apache 2.0); free individual access moved to Antigravity CLI on 18 June 2026; Jules from the browser and GitHub โ ๏ธ.
- Design choice
- Google separates the interactive and the asynchronous agent into different products.
- Without it
- One product tries to serve both styles and serves neither well.
L2๐งญ Sessions & orchestration ยท Who owns a task: sessions, background tasks, subagents
- What it does
- Who owns the task, and whether you watch.
- How it is built here
- An interactive session in the CLI; an asynchronous task in Jules โ ๏ธ.
- Design choice
- The real design split: synchronous (you steer each step) vs asynchronous (you review the result).
- Without it
- Long tasks hold you at the keyboard, or short tasks wait in a queue.
L3๐ Agent loop ยท How it decides the next step
- What it does
- How the next step is chosen.
- How it is built here
- The CLI runs a step-by-step tool loop; Jules plans first, then executes โ ๏ธ.
- Design choice
- Plan-first suits unattended work: the human checks direction once, up front.
- Without it
- An unattended agent drifts with no checkpoint.
๐ How this loop compares with the other four, dial by dial, and its RSI level: Inside the Agent Loop
L4๐ง Context engine ยท What the model sees on each turn
- What it does
- Project knowledge.
- How it is built here
- GEMINI.md context files for the CLI; a cloned repository for Jules โ ๏ธ.
- Design choice
- Instructions as plain files in the repo.
- Without it
- The agent misses project conventions.
L5๐ ๏ธ Tools ยท What it can do
- What it does
- Actions and integrations.
- How it is built here
- Built-in tools plus MCP servers ("use MCP servers to connect new capabilities").
- Design choice
- MCP as the extension point, shared with other harnesses.
- Without it
- Every integration needs Google-specific code.
L6๐ก๏ธ Policy & safety ยท What it may do
- What it does
- What needs your OK.
- How it is built here
- Action confirmations in the CLI โ ๏ธ; plan approval in Jules โ ๏ธ.
- Design choice
- Approve actions when you are present; approve the plan when you are not.
- Without it
- Unattended agents act without any human checkpoint.
L7๐ฆ Execution ยท Where actions actually run
- What it does
- Where work runs.
- How it is built here
- The CLI on your machine; Jules in a Google Cloud VM โ ๏ธ.
- Design choice
- Async work runs off your machine so it can take as long as it needs.
- Without it
- Async tasks would tie up your laptop.
L8๐งฌ Model & telemetry ยท Which model, and what gets logged
- What it does
- The model, and the record.
- How it is built here
- Gemini models (the CLI README says it is "not optimized for Gemini 4+"); Jules returns PRs with summaries โ ๏ธ.
- Design choice
- The output of async work is a PR, the unit teams already review.
- Without it
- Work arrives as chat that someone has to turn into code.
4. Connecting the dots
- Same layers, different owners.
- Both halves have all eight layers; what changes is layer 2 (who owns the task), layer 6 (when you approve) and layer 7 (where it runs).
- Products move.
- The 2026 move of individual access to Antigravity CLI is a reminder that the interface layer changes faster than the architecture underneath.
๐งฌ Design DNA: the three decisions that define it
๐ธ Where the tokens go in the traced task (our estimate)
An illustrative split for a ~300k-token task: about $1.20 at an assumed blended $4 per million tokens. Real numbers vary widely with the repo, the model and caching; the shape (context re-sent every turn dominates) is the point.
5. How it evolved
- โ ๏ธ Dates other than the last are from Google announcements as we recall them; Google's blog could not be reached from our build environment.
6. Where it breaks, and what it does about it
| Failure | Layer | What happens | What this system does about it |
|---|---|---|---|
| Drift while unattended | L3 | An async agent heads in the wrong direction. | Plan approval before work starts โ ๏ธ. |
| Product churn | L1 | Access and features move between products. | Check the README and current product pages before standardising. |
| Model mismatch | L8 | The CLI is "not optimized for Gemini 4+". | Use the product the README points to for newer models. |
| Environment gaps | L7 | The cloud VM cannot build the project. | Clear setup instructions in the repo โ ๏ธ. |
| Prompt injection | L5 | Files or MCP results carry instructions. | Confirmations; trusted MCP servers only. |
7. Security and threat model
๐งฑ Trust boundaries
8. Standards it shares, and benchmarks
- Interoperability.
- MCP servers in the CLI.
- GEMINI.md context files: the same idea as AGENTS.md and CLAUDE.md, a different file name.
- Benchmarks.
- The README warns against using Gemini CLI for model benchmarks. See the Frontier Benchmark Tracker for sourced scores.
9. What people use it for
10. How to build one from scratch
- Start small: one loop, two styles.
- This separate toy runs the same loop interactively (with a confirmation) and asynchronously (on a cloned copy, returning a PR-style result). The model is a scripted stub.
"""mini_gemini_jules.py โ one loop, two harness styles (illustrative).
Interactive (Gemini CLI style): every step is shown and the human confirms edits.
Asynchronous (Jules style): the agent writes a plan, works alone on a cloned copy
and returns a pull request. Same loop, different session and execution layers.
The "model" is a scripted stub; standard library only.
"""
import copy
REPO = {"GEMINI.md": "Run: python test_dates.py", "dates.py": "d, m, y = s.split('/')"}
STEPS = [("read", "dates.py"), ("test", None), ("edit", ("dates.py", "y, m, d = s.split('-')")), ("test", None)]
def loop(repo, confirm, log):
for act, arg in STEPS:
if act == "edit":
if not confirm(arg): log.append("edit skipped by user"); continue
repo[arg[0]] = arg[1]; log.append(f"edit {arg[0]}")
elif act == "test": log.append("test " + ("pass" if "y, m, d" in repo["dates.py"] else "fail"))
else: log.append(f"{act} {arg}")
def main():
log = ["load GEMINI.md: " + REPO["GEMINI.md"]]
loop(REPO, lambda a: True, log) # human approves in the terminal
print("interactive: " + " -> ".join(log) + f" ({len(log) - 1} steps shown live, 1 confirmation)")
REPO["dates.py"] = "d, m, y = s.split('/')" # reset for the async run
vm, alog = copy.deepcopy(REPO), []
plan = [a for a, _ in STEPS]
loop(vm, lambda a: True, alog) # no human in the loop
print(f"async: plan {plan} -> worked in cloud copy -> PR with {sum(1 for x in alog if x.startswith('edit'))} file changed, last test: {alog[-1].split()[-1]}")
print(f"your working copy untouched during async run: {REPO['dates.py'] != vm['dates.py']} (the fix arrives only through the PR)")
if __name__ == "__main__":
main()| Phase | What you build | Time* | Team* | Cost* |
|---|---|---|---|---|
| 0 ยท Prototype | Terminal loop with file and shell tools | 1โ2 weeks | 1 | $15โ40k |
| 1 ยท Interactive CLI | Confirmations, context files, MCP client | 2โ3 months | 2โ4 | $200โ500k |
| 2 ยท Async agent | Task queue, cloud VMs, repo cloning, plan approval | 4โ6 months | 6โ10 | $1โ2.5M |
| 3 ยท GitHub integration | Issue โ task, PR creation, status updates | 2โ3 months | 4โ8 | $0.5โ1M |
| 4 ยท Product | Accounts, quotas, scaling VMs, security review | 6โ12 months | 20โ40+ | $5โ12M+ a year (incl. compute) |
*Our estimates, not vendor figures: fully loaded engineer cost assumed at $250k a year (US-style salaries; lower elsewhere), plus model API and infrastructure. Treat as orders of magnitude.
- The hard part.
- For the async half: reliable environments and knowing when to stop and ask. For the interactive half: a confirmation flow people do not learn to click through.
๐งฎ What would running your own cost a month?
Our model: model cost = tasks ร tokens ร price ร 30 days; people = engineers ร $250k รท 12; infrastructure (sandboxes, storage, logs) assumed at 15% of model cost. A blended price mixes cached input, fresh input and output; check your provider's current prices.
11. When to choose it
โ Choose it when
- You want an Apache-2.0 terminal agent, or you are an enterprise Code Assist user.
- You want asynchronous PRs from a cloud agent (Jules).
- You are already on Google Cloud.
โ ๏ธ Think twice when
- You need a stable product line: it changed in 2026.
- You benchmark models with it (the README advises against).
12. How it compares, layer by layer
| Harness | L1Interfaces | L2Sessions & orchestration | L3Agent loop | L4Context engine | L5Tools | L6Policy & safety | L7Execution | L8Model & telemetry |
|---|---|---|---|---|---|---|---|---|
| Claude Code | Terminal, IDE, desktop, web, Slack; Agent SDK | Sessions with resume; subagents; cloud sessions on the web | One general think โ act โ observe loop | CLAUDE.md, auto memory, compaction | Built-in file/shell/search tools, MCP, skills | Permission rules and modes, hooks | Your machine (optional sandboxing โ ๏ธ); cloud for web sessions | Claude models; transcripts, cost and usage telemetry |
| Codex | Terminal, IDE, web (chatgpt.com/codex) | Parallel cloud tasks; local sessions | Agent loop per task | AGENTS.md, repo context | Shell, file edits, MCP | Approval modes โ ๏ธ | OS sandbox locally โ ๏ธ; container per cloud task | OpenAI models; task logs and diffs |
| Gemini CLI / Jules | Terminal (CLI); browser + GitHub (Jules) | Interactive session vs asynchronous task | Agent loop (CLI); plan-then-execute (Jules โ ๏ธ) | GEMINI.md context files | Built-in tools, MCP | Confirmations in the CLI; plan approval in Jules โ ๏ธ | Your machine (CLI); cloud VM (Jules โ ๏ธ) | Gemini models (CLI "not optimized for Gemini 4+") |
| Deep Agents | Your own app (library) | LangGraph threads; sub-agents | Planning loop on LangGraph | Filesystem as memory; offloading | Your tools, MCP, skills | Human-in-the-loop interrupts | Pluggable backends: local, sandboxed, remote | Any chat model; LangGraph state and tracing |
| Hermes Agent | Terminal + Telegram, Discord, Slack, WhatsApp, Signal, email | Gateway, subagents, cron scheduler | Agent loop (details on its docs site โ ๏ธ) | Curated memory, FTS5 session search, user model | Tools, self-written skills (agentskills.io), Python RPC scripts | Depends on backend and configuration โ ๏ธ | Six backends: local, Docker, SSH, Modal, Daytona, Vercel Sandbox | Model you configure โ ๏ธ |
One line per layer; our reading of each project's documentation and code as of 7 Nov 2026.
| Harness | Runs where | Open source | Subagents | Persistent memory | Skills | MCP | Sandbox | Human approval | Async / cloud tasks |
|---|---|---|---|---|---|---|---|---|---|
| Claude Code | Terminal, IDE, desktop, web | โ | โ | โ | โ | โ | โ | โ | โ |
| Codex | Terminal, IDE, cloud | โ (CLI) | โ | โ | โ | โ | โ | โ | โ |
| Gemini CLI / Jules | Terminal (CLI), cloud VM (Jules) | โ (CLI) | โ | โ | โ | โ | โ | โ | โ |
| Deep Agents | Your Python / JS app | โ | โ | โ | โ | โ | โ | โ | โ |
| Hermes Agent | Terminal + chat apps | โ | โ | โ | โ | โ | โ | โ | โ |
โ built in ยท โ partial or via add-ons ยท โ not a feature. Our reading of each project's documentation as of 7 Nov 2026; check before relying on it.
13. The series
Agentic AI System Designs: four kinds of agent system, one teardown each
All of them on one page: Agentic Systems at a Glance.
๐ Glossary: 15 terms used across the series
- Agent loop
- The repeat cycle: the model picks an action, the harness runs it, the result goes back to the model.
- Harness
- Everything around the model that turns it into a working agent: loop, tools, context, policy, execution.
- Context window
- The text the model can see at once. Everything the agent knows on a turn has to fit in it.
- Context compaction
- Summarising older conversation so a long task keeps fitting in the context window.
- Tool schema
- A machine-readable description of a tool (name, inputs) that tells the model how to call it.
- MCP
- Model Context Protocol: an open standard for connecting agents to outside tools and data.
- Subagent
- A second agent with its own context, used for a side task; only its summary comes back.
- Skill
- A packaged set of instructions (and sometimes scripts) the agent loads when relevant.
- Hook
- Your own command that runs automatically before or after an agent action.
- Sandbox
- A restricted place to run commands so mistakes or attacks cannot reach the rest of the system.
- Approval mode
- The rule for what the agent may do without asking you first.
- Prompt injection
- Instructions hidden in data the agent reads (a file, a web page) that try to hijack it.
- Trace
- The full record of a run: every model call, tool call and result.
- AGENTS.md / CLAUDE.md / GEMINI.md
- Plain markdown files of project instructions that harnesses read at the start of a session.
- Asynchronous agent
- An agent you hand a task to and leave; it returns a result (often a pull request) later.
14. Sources
- Sources
- google-gemini/gemini-cli on GitHub (README)
- Jules product site (jules.google) โ ๏ธ not reachable from our build environment