Skip to main content
Glama

Agy X-Ray

See inside Google Antigravity's context window, workspace file activity, and session history — as a 100% native MCP App side pane.

Zero ASAR patches · Zero CDP injection · Zero runtime dependencies · Survives every Antigravity update

GitHub Stars CI Node.js >= 20 Runtime Deps: 0 MCP Apps SEP-1865 Platform License: MIT

English · 简体中文 · Quick Start · Features · Architecture · Offline CLI & Workbench · FAQ

Follows your GitHub & Antigravity light/dark theme automatically. Preview locally with npm run workbench using synthetic demo data — never touches your daily Antigravity install.

Non-Affiliation Disclaimer
Agy X-Ray is an independent MIT open-source community plugin and is not affiliated with or endorsed by Google LLC.
It uses only Antigravity's documented plugin, Lifecycle Hooks, and MCP Apps (SEP-1865) interfaces — it never patches app.asar or injects into Electron/CDP.


Why Agy X-Ray?

When running long multi-turn or multi-subagent sessions in Google Antigravity 2.0, three daily frustrations show up fast:

  1. Context Black Box — You see total tokens climbing, but not which tool outputs ("Token Vampires") bloated the window or which turn broke your prompt prefix cache.

  2. Missing Lightweight File Tree — After Antigravity 2.0 shifted to an Agent Manager workbench, quickly scanning every file the agent read, edited, or created—and jumping straight to the source—takes too many clicks.

  3. Buried Past Sessions & Artifacts — That root-cause analysis or plan you solved 10 days ago is sitting inside local transcript.jsonl and *.md artifacts, with no fast bilingual search or one-click way to pull it into your next prompt.

Capability

Client Patch / CDP Mods

Pure CLI Scripts

Agy X-Ray (Native MCP App)

Survives Antigravity desktop updates

Often breaks

Yes

Always (100% official APIs)

Native Side Pane (aux_pane) + Sidebar (global) UI

Fragile DOM hack

No UI

Native iframe + host theme vars

One-click open touched files in Antigravity

No

No

Yes (toggle-aux-pane)

One-click inject past excerpts into next prompt

No

Manual copy

Yes (updateModelContext)

Runtime dependencies after clone

Patcher / rebuild

Varies

0 runtime deps (pre-bundled)


Related MCP server: Unified Memory

Quick Start

agy plugin install https://github.com/tone-leh/agy-xray

No npm install, no build step, no API keys. The repository ships pre-bundled zero-dependency dist/server.cjs, dist/hook.cjs, and single-file dist/ui/app.html (~479 KB).

Option 2: Direct Clone into Antigravity Plugins Folder

# macOS / Linux
git clone https://github.com/tone-leh/agy-xray.git ~/.gemini/config/plugins/agy-xray

# Windows (PowerShell)
git clone https://github.com/tone-leh/agy-xray.git "$env:USERPROFILE\.gemini\config\plugins\agy-xray"

Antigravity auto-discovers new plugins immediately—no restart required. Open Agy X-Ray from:

  • The Side Pane + menu (aux_pane entrypoint),

  • The Left Sidebar (global full-page entrypoint), or

  • Ask in chat: "Open Agy X-Ray to inspect this session's context and touched files."


What You Get

1. Context Composition X-Ray & Turn Growth Chart

  • Parses real Antigravity 2.0 transcript.jsonl step metrics (input_tokens fresh + cache_read_tokens cached = exact effective context window per turn).

  • Visualizes Prefix Cache Hit %, Peak Window, Stacked Composition (Cached Prefix · Fresh Input · Tool Outputs · Thinking · Model Output), and a Turn-by-Turn Stacked Bar Chart so cache drops stand out instantly.

  • Ranks Tool Output Hotspots ("Token Vampires") by payload KB, estimated tokens, and truncation counts (truncated_fields), paired with automated health diagnostics.

2. Live Workspace File Tree (toggle-aux-pane)

  • Tracks every file touched by read_file, view_file, edit_file, write_file, replace_file_content, and more, with R / E / W operation pills, touch counts, and last step index.

  • Filter by All / Modified / Read Only or path substring.

  • Click Open to launch the file natively in an Antigravity side-pane tab (com.google.antigravity/toggle-aux-pane), or + Context to attach a structured reference pill to your next message (updateModelContext).

  • Indexes local transcripts and markdown artifacts (implementation_plan.md, walkthrough.md, reports) across Desktop (~/.gemini/antigravity/brain), CLI, and IDE directories.

  • Built-in pure-TypeScript BM25 + CJK bigram tokenizer — zero native C++ SQLite compilation issues on macOS, Linux, or Windows.

  • Click Inject on any historical match or artifact to attach its redacted excerpt straight into your next conversation turn.

4. Secret-Redacted Session Brief Export

  • One-click Export Brief generates a clean Markdown summary of token efficiency, diagnostics, hotspots, and touched files—automatically stripping Bearer tokens, JWTs, API keys (sk-, AIza, ghp_, AKIA), and private key blocks before copy/share.


Architecture

MCP Tools & Visibility Isolation

Tool

Visibility

Surface

Purpose

open_xray

Model + App

aux_pane + global

Opens the interactive dashboard (works with empty {} launch)

analyze_context

Model + App

Inline / Pane

Returns compact token, cache, and hotspot diagnostics

get_file_activity

Model + App

Inline / Pane

Lists read/edited/written workspace files for the session

search_sessions

Model + App

Text + Data

Runs local bilingual BM25 search across transcripts & artifacts

export_session_brief

Model + App

Text + Data

Outputs a secret-redacted Markdown recap

app_list_sessions

App-only

UI

Fast session switcher list (hidden from model context)

app_get_session_detail

App-only

UI

Full trajectory & turn data without hitting the 1 MiB trajectory cap

app_search_sessions

App-only

UI

Interactive Time Machine search inside the iframe

app_export_brief

App-only

UI

Clipboard/context brief export from UI header


Try Without Installing (Offline Workbench & CLI)

Want to test Agy X-Ray in a sandbox without touching your daily Antigravity setup?

git clone https://github.com/tone-leh/agy-xray.git
cd agy-xray
npm install

# 1. Launch the zero-touch offline workbench (uses synthetic demo data)
npm run workbench
# Open http://127.0.0.1:4387 — toggle Aux Pane / Global view & Dark / Light theme

# 2. Or inspect local Antigravity transcripts read-only from your terminal
node dist/cli.cjs doctor
node dist/cli.cjs list
node dist/cli.cjs analyze --demo
node dist/cli.cjs search "PKCE" --demo

Privacy & Security

  • 100% Local-First: Zero network calls, zero analytics, zero cloud sync. All parsing and BM25 indexing run strictly on your machine.

  • Read-Only on Transcripts: Never mutates Antigravity transcripts, config.json, or client binaries.

  • Fail-Open Hooks: hooks.json only records lightweight active-session pointers into ${PLUGIN_DATA}/live-state.json (<10 ms) and fails open on any error so it can never block your agent loop.

  • Automatic Redaction: Exported briefs and search snippets scrub common credentials, Bearer/JWT tokens, and private keys.


FAQ

Does agy-xray work alongside agy-fast, agy-session-guard, or other plugins?
Yes. It uses its own namespaced MCP server (agy-xray_xray), never patches client files, and complements context-saving or compact-guard plugins cleanly.

Why bundle dist/ in the repo?
So agy plugin install https://github.com/tone-leh/agy-xray works immediately with Node.js ≥ 20 and zero npm install step on macOS, Linux, and Windows.

How do I build and run tests locally?

npm ci
npm run typecheck
npm test

License

MIT © tone-leh

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables users to inspect real-time prompt cache hit rate, task throughput, and per-model token usage for Antigravity sessions and 5h/1d/7d windows through an interactive local dashboard. It combines lifecycle hook timing with local transcript data, with zero outbound network telemetry.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Antigravity agents to read and write Claude Code auto memory and CLAUDE.md/rules context while browsing OpenAI Codex CLI memories strictly read-only, with a native dashboard UI for editing, inspecting, and searching that memory. It also keeps prompt caching stable through deterministic startup snapshots, mid-session freezes, and append-only lazy rule injection.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables real-time monitoring of Google Antigravity context usage with detailed Messages/Thinking/Tool breakdowns, cache and checkpoint telemetry, one-click compaction, and smart suggested replies across Desktop, IDE, and CLI/tmux.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables browsing, editing, and previewing workspace files — Markdown, images, PDFs, and Git diffs — directly inside Google Antigravity's sidebars. Provides a file tree with quick search, CodeMirror-based editing with syntax highlighting, and one-click chat context attachment, all without consuming model tokens.
      MIT