INK-Q/agy-fast
Sobre
Plugin acelerador não invasivo de MCP para o Google Antigravity (CLI/Desktop/IDE): reduz as interações com o LLM em 34%, a cota de tokens em 31% e o tráfego de uploads em 40%, sem afetar a interface nativa nem os diffs.
IA e aprendizado de máquinaO que você pode fazer
- No 4x custom-agent multiplier: agy-fast ships zero custom agents (agents 0)—only 5 MCP tools, a zero-check SessionStart hook, and routing rules.
- Small vs. multi-file tasks: On tiny 1–2 file tasks (5–6 tool calls), the rules intentionally stay on zero-check read_file and single native tools so gains come from the SessionStart snapshot and parallel reads; MCP batching activates automatically on multi-file, multi-query, or multi-hunk sessions.
Crescimento medido de estrelas
- em 24 h
- +349
- em 7 dias
- +2.009
- em 15 dias
- Coletando histórico
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Originalagy-fast
Latency, Token-Quota & Tool-Call Accelerator Plugin for Google Antigravity
English · 简体中文 · 繁體中文 · 日本語 · Quick Start · Benchmarks · MCP Tools · Analysis Report · Safety Review Analysis · Changelog
agy-fast is a zero-dependency, policy-compliant local MCP plugin for Google Antigravity (CLI agy, Desktop 2.0, and IDE). It cuts agent wall-clock latency, billable token quota, and upload traffic by consolidating high-frequency searches, multi-language symbol outlines, atomic multi-file edits, and build/test checks into batched local calls—and injecting a sub-50 ms workspace snapshot once per session—without patching client binaries or bypassing Antigravity's built-in safety evaluations.
| LLM Turns / 10 Actions | Est. Billable Quota | Tool-Return Upload | Spills & Client Intrusion |
|---|---|---|---|
-33.7%-38.2% ≥150k ctx · -58.8% subagents |
-31.5%-36.5% ≥150k ctx · -54.0% subagents |
-39.7%-53.7% uncached fresh input |
0≤8.8 KB inline cap · Zero client patching |
Quick Start
Requirements: Node.js >= 20 (no npm install needed — pre-built, unminified zero-dependency ESM bundles are included in dist/). Optional: ripgrep (rg) for faster code search (automatically falls back to pure Node.js when absent).
One-Command Install (Recommended)
Installs runtime files to ~/.gemini/config/plugins/agy-fast, runs agy plugin validate --strict and agy plugin enable agy-fast when agy is installed, and verifies both the MCP server and SessionStart hook live:
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/INK-Q/agy-fast/main/install.sh | sh
Windows (PowerShell):
irm https://raw.githubusercontent.com/INK-Q/agy-fast/main/install.ps1 | iex
Any OS (via npm / npx):
npx -y agy-fast install
[!TIP] Activating in Desktop 2.0 / IDE: Open Customizations → Installed in Antigravity, confirm
agy-fastis enabled, and start a new session to load theSessionStarthook and MCP tools.Launching
agyCLI without approval prompts (optional): To auto-approveagy-fastMCP calls and tool permissions without prompting on every step, start the CLI with:agy --dangerously-skip-permissions(Official
agyflag that auto-approves all tool permission requests without prompting — use only in trusted repositories, or pair with--sandbox.)
More installation options (standalone MCP via npx, local clone, direct git clone, agy CLI, per-repo team install, or ask Antigravity)
Standalone Pure MCP Server (Any Standard MCP Host)
agy-fast is built Antigravity-first (full plugin with SessionStart hook, rules/AGENTS.md, and auto-updater). Standard third-party MCP hosts can also mount the pure MCP stdio server directly via npx (zero host-specific setup):
{
"mcpServers": {
"agy-fast": {
"command": "npx",
"args": ["-y", "agy-fast", "mcp"]
}
}
}
Optional flags: pass "--tools", "batch_search,quick_outline,run_checks" to expose a subset, "--schema-compat=minimal" for strict JSON Schema subset hosts, or run npx -y agy-fast mcp-config --rules to print host-agnostic routing rules.
Local Clone (Any OS)
git clone https://github.com/INK-Q/agy-fast.git
cd agy-fast
node scripts/install.mjs install
Direct Clone into Antigravity Plugins Directory (No Script Needed)
Antigravity automatically discovers plugins placed in ~/.gemini/config/plugins/:
# macOS / Linux
git clone https://github.com/INK-Q/agy-fast.git ~/.gemini/config/plugins/agy-fast
# Windows (PowerShell)
git clone https://github.com/INK-Q/agy-fast.git "$env:USERPROFILE\.gemini\config\plugins\agy-fast"
Native Antigravity CLI (agy)
agy plugin install /path/to/agy-fast
agy plugin enable agy-fast
Per-Repository Installation (Team Sharing)
Install only for a single repository (writes to <repo>/.agents/plugins/agy-fast):
node scripts/install.mjs install --project /path/to/your-repo
Ask Antigravity Directly
Paste this prompt into Antigravity:
Clone https://github.com/INK-Q/agy-fast.git to ~/.gemini/config/plugins/agy-fast, run `node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs doctor`, and enable the agy-fast plugin.
How It Works
Empirical analysis of 55 real Antigravity sessions (8,446 LLM turns, 17,302 tool calls, 55.25 hours of single-agent active time; see docs/ANALYSIS_REPORT.md) revealed that slow tasks are rarely limited by token generation speed. Instead, four structural bottlenecks dominate wall-clock time:
| Measured Bottleneck | Empirical Cost | How agy-fast Eliminates It |
|---|---|---|
| Per-turn TTFT floor | ~6.1 s median TTFT (79% of a median turn; 68.1% of turns emit <700 tokens) |
Batches an average of 4.89 logical actions per MCP call (5.95× in subagents), cutting unnecessary round-trip turns (~6–8 s each) |
| Serial checks & fragmented ops | 52.5% of edit_file calls are same-file splits; 46.3% of run_command calls are read-only searches (~2.0 s median vs 2.1 ms local rg) |
Consolidates up to 20 searches, 50 file edits + verify, or 12 build/test commands inside one persistent local Stdio MCP server |
| Cold-start exploration | First 3 turns average 49.2 seconds inspecting directory layout, git state, and scripts | SessionStart hook injects a ≤1.5 KB snapshot (git state, 2-level tree, multi-module scripts) once in ~35–50 ms |
| Context bloat & cache decay | read_file accounts for 81.9% of tool-returned bytes; >60 s gaps spike cache misses from 1.4% to 15.9%–93.8% |
Symbol outlines first + parallel targeted read_file, hard ≤8.8 KB UTF-8 inline cap (zero output.txt disk spills), and multimodal isolation rules |
Hybrid Execution Architecture
agy-fast never replaces fast native reads. It combines batched local MCP tools with Antigravity's locally allowlisted read_file (~7 ms, 46 KB/call inline, zero remote check):
Plugin Components
| Component | Path | Role |
|---|---|---|
| Plugin Manifest | plugin.json |
Standard Antigravity manifest; passes agy plugin validate --strict |
| Local Stdio MCP Server | mcp_config.json → dist/mcp-server.mjs |
Persistent local process exposing 5 eagerly loaded composite tools ("eager": true) under agy-fast_fast |
| Startup Snapshot Hook | hooks.json → dist/session-start.mjs |
Runs once on SessionStart (~35–50 ms, 250 ms scan circuit-breaker + OS/home-dir skip list), emitting a ≤1.5 KB workspace snapshot |
| Routing & Hygiene Rules | rules/AGENTS.md |
Compact (~6.3 KB) routing guide with inlined schemas (supports user-owned rules/AGENTS.local.md with trigger: always_on frontmatter, preserved across updates) |
| Background Update Checker | dist/updater.mjs |
Detached 4 h release checker (notify-only by default; optional opt-in auto with staged MCP smoke verification) |
| Offline Benchmark CLI | dist/benchmark.mjs |
Local transcript.jsonl analyzer and before/after A/B comparator |
Real-World Benchmarks
Across 10 days of sanitized real coding transcripts (14 baseline main sessions / 5,771 turns vs. 7 agy-fast main sessions / 901 turns, plus 104 baseline vs. 4 agy-fast subagent sessions; all repository names, paths, and identifiers stripped), each agy-fast call batched an average of 4.89 logical operations (5.95× in subagents):
| Metric (normalized per logical action) | Main Sessions (Baseline) | Main Sessions (agy-fast) |
Delta | ≥150k Long Context |
Subagents |
|---|---|---|---|---|---|
| LLM turns / 10 actions | 5.23 | 3.47 | -33.7% | -38.2% | -58.8% |
| Upstream requests / 10 actions (LLM + remote checks) | 9.82 | 6.05 | -38.4% | -42.6% | -62.0% |
| Prompt Cache hit rate (miss spikes) | 89.6% (7.5%) | 94.0% (4.8%) | +4.4 pp | 95.0% (3.3%) | 92.4% (2.8%) |
| Uncached fresh input / action | 10,413 tok | 4,822 tok | -53.7% | -61.5% | -51.3% |
| Est. billable quota / action (1 : 0.1 : 5) | 22,458 eq | 15,387 eq | -31.5% | -36.5% | -54.0% |
| Tool-return upload / action (actual local bytes) | 5.06 KB | 3.05 KB | -39.7% | -42.6% | -13.3% |
| Incremental text upload / action (fresh input est.) | 35.6 KB | 16.5 KB | -53.7% | -61.6% | -51.3% |
| Full-context text upload / action (stateless resend est.) | 342.2 KB | 276.2 KB | -19.3% | -21.9% | -58.9% |
Production hardening highlights (v0.2.x):
- 0 disk spills across 134 consecutive
v0.2.xMCP calls — strict≤8.8 KBUTF-8 inline cap prevents Antigravity'soutput.txtspill-to-disk extra turns. - +75% effective throughput (
35.1 → 61.5 tok/s) and>60sstall turns reduced from31.2% → 7.4%in a same-session before/afterv0.2.1comparison (99 vs. 374 turns) once multimodal screenshots were isolated out of>180k-token main sessions (0screenshots loaded in main coding sessions post-upgrade). - 0 lazy-load schema-read turns — compact schemas are inlined directly in
rules/AGENTS.md.
Methodology, quota sensitivity & fixed prompt overhead
- Logical action normalization: One
batch_searchwith 5 queries counts as 5 actions, oneapply_editstouching 6 hunks +verifycounts as 7 actions, and one built-inread_file/edit_file/run_commandcounts as 1 action—ensuring apples-to-apples comparison per unit of work rather than raw tool-call counts. - Quota weighting sensitivity: Standard weighting (
1.0×uncached input,0.1×cache read,5.0×output) yields -31.5% on main sessions (-36.5% on≥150ksessions). Results hold under conservative cache discounts (1 : 0.25 : 4→ -25.8%) and high-output weighting (1 : 0.1 : 8→ -29.4%). - Fixed prompt overhead:
rules/AGENTS.md(~6.3 KB) + 5 eager MCP schemas (~5.2 KB) +SessionStartsnapshot (≤1.5 KB) add ~3k tokens once per session (cached from turn 2 onward,~300eq tokens/turn). Avoiding a single redundant turn (~44keq tokens) or blind full-file read pays back this overhead >10×.
Prompt Cache prefix alignment audit (628 sessions / 27,423 continuous turns, incl. parallel image + text)
Measured across 628 sanitized local sessions (27,423 continuous turns with same model, non-compacted, gap ≤ 60 s, prior context ≥ 10k; Prefix Align = sum(cache_read_tokens) / sum(prev_total_ctx)):
Scenario (gap ≤ 60 s, non-compacted) |
Turns (n) |
Prefix Align | Cache Hit | ≥95% Aligned |
Partial Break (<90%) |
Zero-Cache Miss | Resp. P50 / P90 |
|---|---|---|---|---|---|---|---|
With agy-fast · All continuous |
7,247 | 99.1% | 96.8% | 95.7% | 0.4% | 0.5% | 14.0s / 65.0s |
Without agy-fast · All continuous |
20,176 | 97.9% | 95.2% | 73.8% | 5.1% | 1.1% | 10.0s / 34.0s |
With agy-fast · Pure text |
6,227 | 99.1% | 96.8% | 98.4% | 0.4% | 0.6% | 14.0s / 64.0s |
Without agy-fast · Pure text |
14,739 | 98.2% | 95.3% | 82.8% | 6.5% | 0.9% | 9.0s / 30.0s |
With agy-fast · Parallel image + text |
74 | 100.0% | 91.1% | 100.0% | 0.0% | 0.0% | 17.0s / 125.0s |
Without agy-fast · Parallel image + text |
190 | 97.6% | 93.9% | 96.3% | 0.5% | 2.1% | 23.0s / 64.0s |
With agy-fast · Post-image (<150k / ≥150k) |
258 / 528 | 99.4% / 99.5% | 92.3% / 98.3% | 91.9% / 99.6% | 1.6% / 0.0% | 0.0% / 0.4% | 19.0s / 20.0s (P50) |
Without agy-fast · Post-image (<150k / ≥150k) |
2,083 / 2,953 | 97.3% / 97.2% | 92.1% / 95.7% | 93.6% / 97.0% | 2.0% / 0.8% | 1.5% / 1.8% | 12.0s / 15.0s (P50) |
- No MCP-induced misalignment: Static
tools/listordering + once-onlySessionStartinjection afterUSER_INPUTkeep intra-session prefix alignment at 99.1%–100.0%, even whenread_file(image)runs in parallel with text tools. - Why Rule 3 still tiers images at
150k: Parallel image + text turns raise tail latency (P50 19–26 s,P90 74–125 s), which increases downstream>60 sTTL misses (6.0%zero-cache across all≥150kpost-image turns vs.3.2%pure text) and risks multi-turn cache collapse on bulk>180kmedia sessions. In<150ksessions, avoid pairingread_file(image)with slowrun_checksin the same turn and run/compactbefore transitioning into long coding. Seedocs/ANALYSIS_REPORT.mdfor the fullT+1&<150k / ≥150kbreakdown.
Verify on Your Own Transcripts (100% Offline)
Measure your own Antigravity sessions locally — nothing ever leaves your machine:
# Summarize all local Antigravity transcripts
node dist/benchmark.mjs analyze --local
# Analyze only the 10 most recently modified local transcripts
node dist/benchmark.mjs analyze --local --recent 10
# Slice sessions since install time and compare With vs. Without agy-fast
node dist/benchmark.mjs analyze --local --since 2026-11-19T12:51:00+08:00 --split-usage
# Compare two task runs (before vs. after)
node dist/benchmark.mjs compare --before ./run-before/transcript.jsonl --after ./run-after/transcript.jsonl
The 5 MCP Tools
| Scenario | Preferred Tool | Why |
|---|---|---|
| Run ≥2 text, regex, glob, fuzzy, or read-only git queries | batch_search |
1 call for up to 20 concurrent queries (<70 ms local) |
Map unknown large files (>800 lines, or ≥3 >300-line files) |
quick_outline *(or read_slices)* |
Flat paths-only symbol outlines across up to 40 files without full-file dumps |
Read 1–2 files (<=800 lines) or known line ranges |
Built-in read_file |
Locally allowlisted (~7 ms, 46 KB / 800 lines, 0 safety check) |
| Edit ≥2 hunks/files in one turn, or edit + verify | apply_edits |
Atomic or bestEffort multi-file edits + optional inline verify |
| Run ≥2 independent build, lint, test, or diagnostic commands | run_checks |
Concurrent execution with head-tail folded error-focused output |
[!NOTE] Antigravity eager loading: Antigravity is the first-class plugin target —
agy-fastships itshooks.jsonhooks,rules/AGENTS.mdrules, installer, and zero-latency auto-updater for it. Under eager loading, the host injects a requiredtoolSummaryargument into everymcp_agy-fast_fast_*call (seerules/AGENTS.mdRule 1); this injection is an Antigravity eager-loading behavior — it does not apply to lazycall_mcp_toolcalls or standalone MCP hosts. Include it (a short summary of what the call does) or the first call fails withmissing property 'toolSummary'.Standard MCP hosts (Codex, Claude Code, etc.): mount the same server via
npx -y agy-fast mcp(ornode <plugin-dir>/scripts/install.mjs mcp) and print host-agnostic routing rules withnpx -y agy-fast mcp-config --rules(or see the standalone MCP section of Quick Start) — no manual wiring ofdist/mcp-server.mjs— optionally passing--tools(tool subset) and/or--schema-compat=minimal(strict JSON Schema subset hosts; runtime validation stays unchanged).
1. batch_search — Concurrent Code, Path & Read-Only Git Search
- Up to 20 mixed queries per call:
text,regex,glob,fuzzy, and read-onlygit(status,diff,log,show,branch,rev-parse,ls-files,blame,shortlog,describe,tag --list,remote -v), including cross-repo lookups via per-querypath. - Precision controls: Filter by
fileType(e.g.,typescript,python,gdscript) orglob, switchoutputMode(content|files_with_matches|count), enable cross-linemultiline: true(wherecountreports occurrences per file), usetype: "fuzzy"for case-insensitive path matching, or passsortBy: "mtime"onglobqueries for newest-first results. - Resilient & inline-safe: Uses
rgwhen installed with automatic Node.js fallback, auto-recovers common LLMglobmistakes (|alternation and bare keywords), and enforces the≤8.8 KBUTF-8 cap.
2. apply_edits — Atomic Multi-Hunk & Multi-File Edits + Verify
- Up to 50 files per call: Validates every hunk and overlap in memory before touching disk (
0files modified on error), or passbestEffort: trueon larger batches so valid files commit atomically per file while failed files return closest-line / drifted-line snippets for targeted retry. - Faithful file handling & workspace boundary: Enforces writes and
verify.cwdinside workspacecwdby default (blocking../, out-of-workspace absolute paths, symlink escapes, and.gitinternals; opt out viaAGY_FAST_ALLOW_OUTSIDE_CWD=1); preserves CRLF/mixed line endings, UTF-8 BOM, file permissions, and in-workspace symlinks; supportsstartLine/endLine(with automatic recovery for globally unique drifts<=50lines),replaceAll,create/overwrite,dryRun, and optional compact+-2-linediff: trueoutput. - Inline
verify: Optionally runs a build/typecheck/test command right after writing, stripping noisy logs (e.g., Pino/Bunyan info JSON, Maven footers) so root causes stay within budget.
3. quick_outline — Flat Multi-Language Symbol Outlines
- Up to 40 files per call (10–20 recommended per batch): Takes a flat
paths: string[]array to extract exact[startLine, endLine]symbol/section maps for TypeScript / JavaScript (incl. Fastify/Express routes & test blocks), HTML / Vue / Svelte, CSS / SCSS / Less, Python, Godot GDScript (.gd), Go, Rust, Java / Kotlin / C# / Swift / C / C++, Shell, Markdown, and JSON / YAML—making outline-first exploration effortless before parallel built-inread_file. (Zero-dependency regex/lexical heuristic index—not a full AST/LSP; complex macros or dynamic syntax may omit symbols, so use it as a fast map alongsideread_filefor full context.)
4. read_slices — Symbol Outlines + Targeted Line Slices
- Outlines + piggybacked slices: Supports the same 15-format outlines (with breadth-first water-filling per file) plus optional tiny
[startLine, endLine]slices in one call under the≤8.8 KBUTF-8 budget, while steering bulk range reads (>150lines) to parallel built-inread_file.
5. run_checks — Concurrent Build, Lint, Test & Diagnostic Runner
- Up to 12 commands per call: Executes independent non-interactive shell commands in a bounded worker pool (
concurrency: 1..8) with per-command timeouts (1..150 s, sharing a150 scall budget under Antigravity's180 sMCP limit), ANSI escape stripping, and transparent Windows unwrapping of trivialpowershell -Command "..."wrappers around allowlisted binaries (git,npm,node,rg,pytest,cargo, etc.) to skip PowerShell cold-start overhead while leaving PowerShell cmdlets/aliases untouched. - Head-Tail adaptive output modes:
compact(default) collapses passing commands to 1-line summaries and uses Head-Tail folding on large failures so both initial root-cause errors and final summary/stack tails survive the≤8.8 KBinline cap;fullpreserves stdout for diagnostic or audit scripts with Head-Tail folding when capped.
Example batched MCP calls (JSON payloads)
batch_search — 3 heterogeneous queries in one call:
{
"queries": [
{ "type": "regex", "pattern": "export (async )?function", "fileType": "typescript", "outputMode": "files_with_matches" },
{ "type": "fuzzy", "pattern": "mcp server" },
{ "type": "git", "pattern": "status --short" }
]
}
apply_edits — Multi-file edit + inline typecheck in one call:
{
"edits": [
{ "path": "src/a.ts", "hunks": [{ "target": "oldCall()", "replacement": "newCall()" }] },
{ "path": "src/b.ts", "hunks": [{ "target": "v1", "replacement": "v2", "startLine": 10, "endLine": 25 }] }
],
"bestEffort": true,
"verify": "npm run typecheck"
}
Updates, Diagnostics, and Uninstall
Day-to-Day CLI Reference
| Task | Command |
|---|---|
Health check (Node, rg, live MCP handshake, SessionStart latency, manifest validation, read-only local storage health) |
node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs doctor |
| Check for updates (read-only) | node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs update --check |
| Update now (stages & runs MCP smoke test before swapping) | node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs update |
Interactive update / skip a version ([y]es/[n]o/[s]kip, or none to clear) |
node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs update --prompt (or update --skip-version <ver|none>) |
Configure auto-update (auto | notify | off) |
node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs config --auto-update notify --interval 24 |
Switch MCP tool loading / edits format (--tool-loading eager|lazy, --edits-format auto|array|string; preserved across updates) |
node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs config --tool-loading lazy (or config --edits-format array) |
| Direct CLI mode (for Swarm workers & non-MCP scripts) | node ~/.gemini/config/plugins/agy-fast/dist/mcp-server.mjs --cli <search|outline|slice|edit|check> |
Standalone MCP stdio server (standard MCP hosts; forwards --tools, --schema-compat=minimal, --cli) |
npx -y agy-fast mcp (or node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs mcp) |
Generate MCP config / generic rules (--host mcp-only|json|generic|antigravity, --tools, --rules) |
npx -y agy-fast mcp-config --rules (or node .../scripts/install.mjs mcp-config) |
| Uninstall cleanly | node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs uninstall |
From a local repository clone,
./install.sh <command>(macOS/Linux) and.\install.ps1 <command>(Windows) accept the same subcommands (doctor,update,config,uninstall).
Zero-Latency Background Update Checker (Notify-by-Default)
- 0 ms session startup cost & no silent code replacement by default: Every 4 hours,
SessionStartspawns a detached background checker (dist/updater.mjs) after emitting the workspace snapshot. By default (notifymode), it only checks GitHub release tags and displays a one-time notice in the next new session—it never silently overwrites localdist/*.mjsorrules/AGENTS.mdunless you explicitly runupdate/update --promptor opt in viaconfig --auto-update auto. - Verified before swap (when updating): Peels annotated tags (
^{}) to real commit SHAs, pinsknownTagCommitsto hard-refuse force re-tagged / hijacked releases (even under--force), clones with LF normalization into an isolated staging directory, verifies clonedHEADfail-closed and GitHub ReleaseSHA256SUMS.txtdigests, runs a live MCP smoke test, and atomically replaces runtime files—automatically rejecting broken or tampered releases while preserving any user-createdrules/AGENTS.local.md(add---\ntrigger: always_on\n---YAML frontmatter so Antigravity loads it; gitignored forgit cloneinstalls). - Safe by design:
--linkdev symlinks and dirty git repos are never overwritten even ifautois enabled. You can disable all update checks permanently viaconfig --auto-update offorAGY_FAST_AUTO_UPDATE=off.
Environment variable overrides & applying updates
| Environment Variable | Values / Default | Purpose |
|---|---|---|
AGY_FAST_AUTO_UPDATE |
notify (default) | auto | off |
Overrides saved update mode (notify checks & alerts only; auto opts in to background atomic updates; off disables checks) |
AGY_FAST_REQUIRE_CHECKSUMS |
0 (default) | 1 |
When 1, update fails closed unless the target GitHub Release publishes a matching SHA256SUMS.txt asset (whenever SHA256SUMS.txt is present, checksums and commit pinning are always enforced) |
AGY_FAST_UPDATE_INTERVAL_HOURS |
4 (default; 0.01..720; CLI --interval: 1..720) |
Background check interval in hours |
AGY_FAST_UPDATE_CHANNEL |
release (default) | main |
Track stable semver release tags or main |
AGY_FAST_REPO |
Git URL | Use a custom mirror or fork |
AGY_FAST_TOOL_LOADING |
eager (default) | lazy |
Overrides the MCP tool loading mode written to mcp_config.json during install/update (also config --tool-loading) |
AGY_FAST_CACHE_DIR |
Directory path (default: ~/.gemini/cache/agy-fast) |
Overrides the local cache directory for config.json, update state, lock files, and overflow spills/ |
AGY_FAST_SPILL |
1 (default) | 0 | off |
Enables/disables zero-dep spill-on-overflow saving full output of truncated run_checks / apply_edits(verify) / batch_search calls under <cache>/spills/ (capped at 2 MiB/file, 20-file FIFO rotation) |
AGY_FAST_ALLOW_OUTSIDE_CWD |
0 (default) | 1 |
By default apply_edits blocks file writes and verify.cwd outside workspace cwd (including symlink escapes); set to 1 only if cross-workspace writes are intentional |
AGY_FAST_EDITS_FORMAT |
auto (default) | array | string |
Controls apply_edits.edits schema (auto uses token-saving native arrays on eager-capable CLI ≥1.5.8, Desktop 2.0, IDE, and third-party hosts, and switches to JSON array strings on pre-eager CLI 1.5.0–1.5.7; server always accepts both) |
AGY_FAST_HOST |
e.g. [email protected], [email protected], [email protected] |
Overrides auto-detected Antigravity host surface & version |
AGY_FAST_TOOLS |
Comma-separated tool names (default: all 5) | Exposes only the specified MCP tool subset (also --tools <list>; e.g. batch_search,quick_outline,read_slices for read-only mode) |
AGY_FAST_SCHEMA_COMPAT |
standard (default) | minimal |
Strips numeric/array range keywords (minimum/maximum/minItems/maxItems) from tools/list for strict JSON Schema subset hosts (also --schema-compat=minimal; runtime validation stays unchanged) |
Applying updates: Updated rules/AGENTS.md and dist/session-start.mjs take effect automatically on the next new session. In Antigravity Desktop 2.0 / IDE, reload or restart the window once to refresh the resident MCP server process.
Policy Compliance and Safety
- Official interfaces only: Built exclusively on documented Antigravity extension APIs (
plugin.json,mcp_config.json,hooks.json,rules/AGENTS.md). - Workspace write boundary,
.gitguard & safe atomic commits:apply_editsenforces writes andverify.cwdinside workspacecwdby default (blocking../, outside absolute paths, symlink/directory-symlink escapes, and.gitinternal metadata; opt out explicitly viaAGY_FAST_ALLOW_OUTSIDE_CWD=1), serializes in-process commits, rejects stale pre-write edits or symlink swaps before touching disk, andrules/AGENTS.mdprohibits calling write tools in read-only Plan Mode. - Anti-tag-hijacking,
SHA256SUMS.txt& SLSA build provenance (v0.3.4+): Background update checks default tonotify-only (autois opt-in;offdisables all network checks) and display target commit SHAs + GitHub compare diff URLs. Updates peel annotated tags (^{}) and pinknownTagCommitsto hard-refuse force re-tagged / hijacked releases (even under--force), verify clonedHEADfail-closed, and validate ReleaseSHA256SUMS.txtdigests via constant-timetimingSafeEqual(with LF-enforced checkouts on Windows; strict opt-in viaAGY_FAST_REQUIRE_CHECKSUMS=1). CI/Release workflows pin all GitHub Actions to 40-char commit SHAs and publish SLSA build provenance attestations (actions/attest-build-provenance). - Least-privilege read-only & per-project isolation: Restrict the MCP server to read-only tools anytime with
--tools batch_search,quick_outline,read_slices(orAGY_FAST_TOOLS), or scope installation to a single repo via--project. - No safety or binary tampering: Does not patch client binaries, alter authentication, or bypass Antigravity's built-in safety evaluations.
- Zero per-step blocking hooks & fail-open startup: Registers no
PreToolUse,PostToolUse,PreInvocation,PostInvocation, orStophooks; on unreadable directories or malformed stdin,SessionStartreturns{}and exits cleanly—never blocking a session. - Local-first, zero runtime deps & 2-minute independent audit: All 5 MCP tools and the benchmark CLI run 100% locally with zero code or transcript uploads and zero runtime
dependencies; shippeddist/*.mjsbundles are unminified ESM reproducible byte-for-byte fromsrc/. SeeSECURITY.mdfor the 2-minute verification guide (npm run build && git diff --exit-code -- dist/,SHA256SUMS.txt, andgh attestation verify).
FAQ
Does agy-fast affect Antigravity's native UI, diff viewer, modified-files list, or checkpoints?
- Native UI, Git diff viewer & modified-files list:
agy-fastnever patches Antigravity binaries or UI. Because edits are written cleanly to disk, Antigravity's Git/filesystem-backed modified-files list and Git diff viewer reflect all changes normally. - Per-step
edit_fileinline diff & tool-level checkpoints (trade-off): Becauseapply_editswrites inside the standard external MCP Node process (fs.writeFile+ atomicfs.rename), it does not attach to built-inedit_fileper-step inline diff cards, per-hunk accept/reject UI, or tool-step checkpoints at the same granularity. If you prefer native per-hunk review or read-only MCP only, pass--tools batch_search,quick_outline,read_slices(orbatch_search,quick_outline,read_slices,run_checks) so all edits stay on nativeedit_file.
Known trade-offs & security boundaries — who should use (or customize) agy-fast?
agy-fast is designed for multi-file coding sessions and intentionally makes explicit engineering trade-offs:
- Always-on prompt overhead (
~11.5 KB/ ~3k tokens):rules/AGENTS.md(~6.3 KB) + 5 eager MCP schemas (~5.2 KB) stay in system context. If you use Antigravity mainly for casual Q&A or writing rather than coding, install per-project (--project /path/to/repo) instead of globally, or switch to--tool-loading lazy/--toolssubset. - Read-only least-privilege option: Don't want an MCP server that writes files or runs shell commands? Expose only read-only tools with
--tools batch_search,quick_outline,read_slices(viaAGY_FAST_TOOLSormcp-config --tools). - Heuristic outlines vs. AST/LSP & log folding:
quick_outlineis a fast 0-dep regex/lexical index (not a full AST/LSP—pair withread_filefor complex macros/coupling); whenrun_checks/verify/batch_searchexceeds the8.8 KBinline cap, full untruncated output is automatically saved to<cache>/spills/(Full output saved:) so mid-log errors are never lost. - No silent auto-updates: Updates default to
notify-only; nothing remote replaces local code unless you runupdateor explicitly opt in withconfig --auto-update auto.
Does agy-fast save token quota and upload bandwidth in addition to reducing latency?
Yes. Across 10 days of sanitized real coding transcripts, batching ~4.9 operations per MCP call reduced LLM turns by 33.7%, estimated billable token quota by 31.5% (36.5% in ≥150k-token sessions; 54.0% in subagents), tool-return upload bytes by 39.7%, and >60s stall turns from 31.2% → 7.4%.
Does agy-fast replace Antigravity's built-in read_file or edit_file tools?
No — it complements them in a hybrid workflow. Built-in read_file is locally allowlisted (~7 ms, 46 KB / 800 lines/call, zero remote/safety check), so agy-fast routes single files <=800 lines and known line ranges straight to parallel built-in read_file, while handling multi-query searches, large-file outlines, multi-hunk/multi-file edits with inline verify, and concurrent checks via MCP.
Does agy-fast trigger custom-agent 4x quota billing or extra safety-review overhead (and why weren't MCP tools used on a tiny task)?
- No 4x custom-agent multiplier:
agy-fastships zero custom agents (agents 0)—only 5 MCP tools, a zero-checkSessionStarthook, and routing rules. - Cuts serial safety reviews to
1/N(Desktopv2.35–v2.36/ CLIv1.5.x): Antigravity runs a 3-tier safety pipeline (agy_tool_safetylocal microsecond allowlist →sir_flash_litecloud review~1.1–1.5 s→severe_internal_risks_agydeep review~5–6 son flagged high-risk actions). Built-inread_filehits the local allowlist (0cloud calls), whereas both first-party mutating tools (edit_file,write_file,webview_browser,invoke_subagent) and MCP tools reportunsupported_toolat Tier 1 and are fully understood and reviewed at Tier 2 (sir_flash_lite). Merging N edits/checks into oneapply_editsorrun_checkscall cuts latency, cloud review count, and Tier-3 escalation exposure to1/N. Seedocs/SAFETY_MONITOR_ANALYSIS.mdfor the sanitized empirical audit. - Small vs. multi-file tasks: On tiny 1–2 file tasks (5–6 tool calls), the rules intentionally stay on zero-check
read_fileand single native tools so gains come from theSessionStartsnapshot and parallel reads; MCP batching activates automatically on multi-file, multi-query, or multi-hunk sessions.
Note for frontend & UI developers: does agy-fast stop the main agent from viewing screenshots or design specs?
No — Rule 3 uses tiered image hygiene rather than a blanket ban:
- Short/medium sessions (
<150ktokens) & pixel-level UI work: Direct image reads in the main session are allowed for 1–2 UI screenshots or design mockups where exact spacing, alignment, visual hierarchy, or styling fidelity matters. Once the visual polish step is done and before moving into long multi-file coding, run/compact(or start a fresh session) so old image payloads do not carry into a long session. - Long sessions (
>150ktokens) & bulk screenshot/QA/OCR audits: Loading.png/.jpg/.webpdirectly into a>150k-token session invalidates prompt cache and triggers a 3–7× TTFT cliff (40–97 s/turn); in those cases, Rule 3 delegates visual checks to a subagent returning structured text-only findings (selectors, pixel values, layout issues). - Custom override for design-heavy workflows: If you want the main agent to always view images directly without restriction, add a personal override in
<plugin-dir>/rules/AGENTS.local.md(gitignored and preserved automatically acrossagy-fastupdates):
---
trigger: always_on
---
Override Rule 3: Always allow direct image reads in the main session for UI/design review.
Which Antigravity editions and operating systems are supported?
agy-fast supports Antigravity CLI (agy), Antigravity Desktop 2.0, and Antigravity IDE across macOS, Linux, and Windows. It requires Node.js >= 20 with zero runtime dependencies (optional ripgrep/rg with automatic pure-Node.js fallback).
Does agy-fast send any code or transcript data to external servers?
No. All MCP tools, the SessionStart snapshot hook, and the transcript benchmark CLI operate 100% locally. The only optional network request is the notify-only background update checker checking public GitHub release tags once every 4 hours (never modifying local files unless you run update or opt in via config --auto-update auto), which can be disabled completely via config --auto-update off or AGY_FAST_AUTO_UPDATE=off.
How do I verify the speedup or uninstall agy-fast cleanly?
Run node dist/benchmark.mjs analyze --local --split-usage to benchmark your own local transcripts completely offline. To remove agy-fast at any time, run node ~/.gemini/config/plugins/agy-fast/scripts/install.mjs uninstall.
Why do long turns (>60s–120s) hit unexpected EOF / broken pipe / stream interrupted behind a proxy?
Long thinking or multi-file coding turns keep a single SSE stream open for 1–5 minutes. Auto-switching proxy groups (url-test / fallback), UDP/QUIC idle drops, or short proxy read timeouts frequently cut those streams mid-flight (benchmark.mjs surfaces these under Network/SSE disconnect errors). agy-fast never reads or modifies third-party proxy configs; instead, pin the Antigravity API domains to a static, low-loss TCP node (not url-test) and enable TCP KeepAlive in your proxy client:
Copyable proxy routing templates (Clash / Mihomo Merge Override, Surge, sing-box)
Clash / Mihomo (GUI YAML Merge Override such as Clash Verge Rev / Mihomo Party — use prepend-rules: so you do NOT overwrite existing subscription rules; for standalone mihomo core config.yaml, place these 4 lines at the top of rules: because native mihomo ignores prepend-rules:; replace Static-TCP-Node with your manual TCP node or group name):
keep-alive-idle: 15
keep-alive-interval: 15
prepend-rules:
- DOMAIN,daily-cloudcode-pa.googleapis.com,Static-TCP-Node
- DOMAIN,cloudcode-pa.googleapis.com,Static-TCP-Node
- DOMAIN,oauth2.googleapis.com,Static-TCP-Node
- DOMAIN,aicode.googleapis.com,Static-TCP-Node
Surge ([Rule] — place above generic Google / FINAL rules):
DOMAIN,daily-cloudcode-pa.googleapis.com,Static-TCP-Node
DOMAIN,cloudcode-pa.googleapis.com,Static-TCP-Node
DOMAIN,oauth2.googleapis.com,Static-TCP-Node
DOMAIN,aicode.googleapis.com,Static-TCP-Node
sing-box (route.rules — place before generic Google / final rules):
{
"domain": [
"daily-cloudcode-pa.googleapis.com",
"cloudcode-pa.googleapis.com",
"oauth2.googleapis.com",
"aicode.googleapis.com"
],
"outbound": "Static-TCP-Node"
}
Tip: For self-hosted proxies/reverse proxies, raise
read_timeout/idle_timeoutto>= 300s–600sand use stable DNS (DoH/DoT) so OAuth refreshes do not fail mid-session.
Development
npm install
npm run typecheck # Strict TypeScript check
npm run build # Bundle src/*.ts -> dist/*.mjs with esbuild
npm test # Run unit, MCP protocol, hook, benchmark, and installer tests
npm run bench:stress # Run 11-scenario end-to-end stress & performance benchmark (+ optional --real-repo=<path> scenario 12)
npm run validate # Run `agy plugin validate --strict .`
MCP Directory
Star History
License
Acknowledgments
Thanks to the community-curated lists that feature agy-fast:
Explore projetos relacionados
Carregando…