Cross-platform Antigravity Plugin & Sidecar UI Pane for Windows and Linux (pure Node.js, zero external dependencies).
As an Antigravity conversation grows, two things silently degrade the agent's effectiveness:
- Context Compaction (
CHECKPOINTevents): Each time a conversation hits the model's context window ceiling, Antigravity compacts older turns into a summary and retains only the last 10 user prompts verbatim. Repeated compactions gradually dilute earlier architectural constraints and debugging details. - Git Repository Drift (
commits behind HEAD): When commits are created in another terminal, branch, or conversation, an older chat's mental model of the repository falls out of sync withHEAD.
AGY Cockpit runs as a lightweight sidecar panel inside Antigravity (Auxiliary Pane and Sidebar). It monitors live context window usage, compaction tiers, cumulative token consumption (including spawned subagents), 5-hour and weekly model quota limits, and Git drift across all your projects, and provides a Two-Step Smart Handoff to seamlessly continue work in a fresh conversation.
- Overview
- Features
- 1. Real-Time Context Pollution & Prompt Retention
- 2. Total Token Usage & Subagent Breakdown
- 3. Git / Repository Drift Detection
- 4. Workspace Scoping, Live Activity Indicators, Search & Archiving
- 5. Two-Step Smart Handoff & Dynamic Model Selector
- 6. Antigravity Contract Verifier & Self-Diagnostics (
--doctor)
- Installation & Updates (Windows & Linux)
- Performance Architecture
- License
- Human-Centric Metrics: Tracks conversations strictly in terms of Compacts (
"type":"CHECKPOINT") and User Prompts ("type":"USER_INPUT"), never raw internal step indices. - Compaction Health Tiers:
0 to 2 compacts(with0compacted prompts): Fresh (#10b981)3 to 5 compacts(or0 to 2compacts once earlier prompts are compacted): Warm (#eab308)6 to 9 compacts: Heavy (#f97316)10+ compacts: Polluted (#ef4444)
- Prompt Retention Tracking: Each Antigravity compaction retains the last 10 user prompts in full. When earlier prompts have been compacted, the active card displays
Prompts: 10 full · M compacted. - Dynamic Context Window Ceiling (Zero Hardcoded Limits):
- Reads
currentTokens = input_tokens + cache_read_tokensfrom the latestPLANNER_RESPONSE. - Records
compactTriggerTokensimmediately preceding eachCHECKPOINTand computesobservedCompactCeilingas their rolling median. - Adapts automatically if Antigravity changes the context window size in future updates. If
currentTokensexceeds a previously observed ceiling before a new compact triggers, the stale percentage is hidden (observing new ceiling) until the next compaction is observed.
- Reads
- Interactive Context Window Breakdown Modal:
- Clicking the Context window meter (
n / ~m (x%)) on the active card opens an on-demand breakdown of the active context window (since the latestCHECKPOINTcompaction, or from conversation start if uncompacted) with zero overhead on background polling:- Base vs Active Turn Growth: Separates initial base context (
System & Rules / Initial BaseorBase + Compaction Summary, including cached system prefix tokens) from active turn token growth (+X.Xk tokacross prompts and tool calls). - Loaded Skills: Lists
SKILL.mdand skill files read in the active window (plus any skills read prior to the last compaction) with exact byte and token footprints. - Tool Activity by Category: Groups active-window tool calls and outputs into
File Reads & Search,Terminal & Tasks,Code Edits & Writes, andSubagents & MCPwith call counts and byte/token volume bars. - Top 5 Heaviest Steps & Most Touched Files: Ranks the 5 largest individual tool steps (
argBytes + outputBytes, accounting for<truncated N bytes>markers inO(1)) and the most read/edited project files in the active window.
- Base vs Active Turn Growth: Separates initial base context (
- Clicking the Context window meter (
- Tracks cumulative token usage across every turn of a conversation:
- New Input Tokens (
input_tokens) - Cached Read Tokens (
cache_read_tokens) - Output Tokens (
output_tokens)
- New Input Tokens (
- Automatically links spawned subagent conversations (
invoke_subagent/sender=<uuid>) to their parent chat, hiding subagents from the main conversation list while aggregating their token consumption on the parent conversation card. - Interactive Subagent Pill & Inline Breakdown (
+X.Xk · N sub ▾): Clicking the subagent pill expands an inline list showing each spawned subagent's↳role/title, token consumption, and live status (Done, thinking dots•••, or amber! Waiting permission/? Waiting answer). Clicking any subagent row opens that subagent's conversation directly in Antigravity. - Live Subagent Status Propagation: If a background subagent is actively thinking (
•••) or waiting on tool permission (!) or a user answer (?), its status automatically propagates to the parent conversation card and project filter tab. - 5-Hour & Weekly Model Usage Quota Ring: Displays a live progress ring in the top bar matched to the active conversation's model family (
Anthropic Claude,Google Gemini,OpenAI) or the highest usage bottleneck across families. Clicking the quota pill refreshes live usage and opens the Model usage limits modal with per-window usage bars (5-hour,Daily,Weekly,Monthly), remaining percentages, and live reset countdowns.
- Detects the Git repository root associated with each conversation and compares the conversation's last activity timestamp against
HEAD(excluding commits created inside that conversation). - Displays
HEAD in syncorN commits behind HEAD, and lists the missed commit hashes, subjects, and timestamps inside the expandableHistory & Commitsdrawer.
- Pinned Active Chat Card: Pins the active conversation of the current workspace at the top with a live context meter and token breakdown. Clicking any conversation row in the list switches to that chat in Antigravity and pins it at the top.
- Project-Scoped Filter Tabs & Live Thinking / Waiting / Unread Indicators: Syncs with
~/.gemini/config/projects/andwindow.sidecar.getWorkspaceUris()(onWorkspaceChange) to automatically scope the conversation list to the active project, with tabs (per-project tabs,Unscoped / General,All (N), andArchived (N)) to switch across workspaces. Project tabs and conversation cards display animated thinking dots (•••) while an agent is streaming or executing tools, amber!(waiting for permission approval) or?(waiting for your answer to a question) badges when stalled on user input, and an unread blue dot (●) once a background reply completes. - Quick New Conversation (
+ New): Spawn a new conversation directly from the filter bar inside any project workspace or as a general (No Project (General)) chat without leaving the panel. - Turn Previews (
You:/AI:): Compact cards inOther conversationspreview both your latest prompt (You:) and the model's latest response (AI:) on separate lines. - Conversation Pinning, Custom Renaming, Archiving & Deletion: Right-click any project tab to start a
+ New chat in "<Project>"or Archive the project, or use the bottom-right gear menu (⚙) on any conversation card to Pin to top / Unpin from top, Rename... (with Reset Default), Copy ID, Archive (restorable fromArchived (N)), or permanently Delete (DeleteCascadeTrajectorywith confirmation). - Instant Full-Text Search & Prompt History: Filters conversations in real time across custom/auto titles,
USER_INPUTprompts, andTask Overviewcheckpoint summaries. ExpandingHistory & Commitsshows missed Git commits, the latest compact overview, and user prompts clamped to 3 lines (Show more/Show less).
- Step 1 (Optional Focus, AI Generation & Cancellation): Click Smart Handoff to open an editable focus box where you can optionally specify instructions for the next chat (such as focusing on a specific subtask or writing the handoff in another language), then click Generate Handoff Prompt. AGY Cockpit sends an
[AGY Cockpit Smart Handoff]request to the conversation's agent instructing it to produce a self-contained<HANDOFF_PROMPT>without calling any tools. While generating, you can click Cancel at any time to abort the in-flight agent invocation (CancelCascadeInvocation). - Step 2 (Review, Edit, Select Model & Launch): As soon as the agent replies, the extracted
<HANDOFF_PROMPT>is cached for that conversation and loaded directly into the plugin's editor so you can review or edit it before clicking Start New Chat or Copy. Re-opening Smart Handoff on a conversation that already generated a handoff opens directly in Step 2; clearing the text box (for example withCtrl+AandBackspace) returns the drawer to Step 1 so you can enter new instructions and regenerate. - Dynamic Model & Thinking Tier Selector: Discovers all models and thinking tiers available to your account from the local Antigravity Language Server, pre-selects the active conversation's current model and thinking tier by default, and launches the new conversation directly with the chosen model and thinking tier from Step 0 inside the same project and workspace.
- Automated AGY Update Protection:
node setup.cjs --doctor(andnode setup.cjs --doctor --jsonfor machine-readable output) verifies all 9 internal Antigravity contracts (plugin_installation_sync,app_data_dirs,transcript_schema,annotations_pbtxt,projects_registry,language_server_binary,language_server_live_rpc,agentapi_cli, andsidecar_bridge_and_perf), automatically probing the live running sidecar when reachable or falling back to offline CLI verification. The running sidecar also checks the 8 runtime contracts whenever it boots or when thelanguage_serverbinary changes on disk after an Antigravity update. - Sticky Bottom Warning Drawer: Stays completely invisible when all contracts pass (
ok). If an Antigravity update renames or changes an RPC, CLI flag, or transcript schema field, a sticky floating bar appears at the bottom of the panel with a collapsible contract list, Re-run Doctor, and Copy Fix Prompt (ready to paste into any coding agent with exact failed contract IDs andserver.cjssymbols).
Requires Node.js 18+. Works out of the box on both Windows and Linux.
You can ask any Antigravity agent to install or update the plugin for you by pasting this prompt in chat:
Install the AGY Cockpit plugin from this repository by running `node setup.cjs` (use BypassSandbox: true so it can write to ~/.gemini/config/plugins/agy-cockpit), verify with `node setup.cjs --check` and `node setup.cjs --doctor`, and give me the AGY Cockpit sidecar pill link.
If you are an AI agent asked to install or update AGY Cockpit on a user's system (Windows or Linux):
- Clone or locate the repository (if not already open in the workspace).
- Run the installer outside the sandbox:
- Because
setup.cjsinstalls files into~/.gemini/config/plugins/agy-cockpit/(outside the project workspace) and restarts the running sidecar process, executenode setup.cjswithBypassSandbox: trueif standard sandbox mode blocks writes to~/.gemini/config.
- Because
- Verify the installation & runtime contracts:
- Run
node setup.cjs --checkand confirm the JSON output reports"pluginInstalled": true,"readmeInstalled": true, and"sidecarInstalled": true. - Run
node setup.cjs --doctorand confirm all 9 contracts pass.
- Run
- Surface the sidecar pill & restart notice:
- Always include the clickable pill link in your response:
[AGY Cockpit](sidecar://agy-cockpit/agy-cockpit/ui.html) - If this is a first-time installation (creating
~/.gemini/config/plugins/agy-cockpitfor the first time), inform the user to restart or reload Antigravity once so Antigravity discovers the new plugin directory. - If this is an update to an existing installation, no Antigravity restart is needed (
setup.cjsautomatically restartsserver.cjsand the UI hot-reloads).
- Always include the clickable pill link in your response:
From the repository root on Windows or Linux:
node setup.cjsVerify installation status or run the full Antigravity contract verifier (--doctor):
node setup.cjs --check
node setup.cjs --doctor- In-Panel One-Click Update (
Updatebutton): AGY Cockpit checks GitHub (subamanis/agy-cockpit, branchmain) in the background on startup and every hour. When a newer commit is available, an amber indicator dot appears next to the top-right Update button. Clicking Update pulls/downloads the latest release, validatesserver.cjs, updates~/.gemini/config/plugins/agy-cockpit/, and hot-reloads the server and panel automatically (or confirmsAlready on latest versionwhen up to date). - Manual CLI Update: Because Antigravity runs the plugin from
~/.gemini/config/plugins/agy-cockpit/, pulling new commits manually in the git repository requires re-runningnode setup.cjsto sync the updated files and auto-restart the sidecar server (no Antigravity restart is required on updates;server.cjsrestarts automatically andui.htmlhot-reloads on the next poll):
git pull
node setup.cjs
node setup.cjs --doctorOr ask your Antigravity AI agent:
Update the AGY Cockpit plugin by running `git pull` and `node setup.cjs` (with BypassSandbox: true), then verify all contracts pass with `node setup.cjs --doctor`.
To stop the sidecar server and remove the plugin from ~/.gemini/config/plugins/agy-cockpit:
node setup.cjs --uninstallOnce installed, AGY Cockpit is automatically enabled and available in:
- The right Auxiliary Pane (
Extensions/ sidecar tab) - The left Sidebar (
Pluginssection) - Any Antigravity chat response via the pill link:
[AGY Cockpit](sidecar://agy-cockpit/agy-cockpit/ui.html)
Important
Portability Note (How to Share or Move Across Machines):
Always install on a new Windows or Linux machine by cloning this repository and running node setup.cjs. Do not copy the installed ~/.gemini/config/plugins/agy-cockpit/ folder directly from one computer to another, because setup.cjs writes the host machine's resolved Node.js executable path (process.execPath, such as an nvm or nvm4w binary path) into the installed sidecar.json so GUI launches can always locate node.
- Incremental Append-Only Transcript Indexing:
server.cjscachesmtimeMs,size,parsedBytes, andlastLineOffsetper conversation in memory and persistsindex_cache.json.- On subsequent polls, only the tail from
lastLineOffset(stat.size - lastLineOffset) is read from disk so in-place rewrites of the active step are caught, and"type":"GENERIC"lines are skipped beforeJSON.parse(< 1 msper status poll on warm cache).
- Directory & File Mtime Gating:
- Guards
annotations/*.pbtxtand~/.gemini/config/projects/*.jsonbehind directory and per-filemtimeMschecks so unchanged cold conversations and project manifests incur zero redundant disk I/O on/api/statuspolls.
- Guards
- Git Reflog Tail Parser +
.git/HEADMtime Guard:server.cjsinspects.git/HEADand.git/logs/HEADmtimeMswith a 1.5s TTL before reading Git state.
- Persistent Binary Symbol Cache & Tail-Only Diagnostics:
diagnostics_cache.jsonpersists verifiedlanguage_serverRPC and CLI symbols keyed by binarymtimeMsand size, andreadFileTailLines()reads only the last 512 KB of sampled transcripts during--doctorchecks.
Licensed under the MIT License.



