| name | antigravity-for-claude-code |
| description | Run Antigravity CLI (Gemini) as a sub-agent in Claude Code for intelligent model routing, bulk work delegation, and cross-model verification. |
| triggers | ["delegate this to antigravity","use gemini for this bulk task","review this with antigravity","research this topic with web search","run antigravity delegate","check cloud run logs","use agy for this","cross-model verification"] |
Antigravity for Claude Code
Skill by ara.so — Claude Code Skills collection.
Overview
Antigravity for Claude Code is a plugin that enables intelligent model routing across the SDLC by delegating bulk work to the Antigravity CLI (agy/Gemini) while keeping Claude as the conductor for judgment, architecture, and verification.
Core principle: Claude owns requirements, architecture, and verification; Gemini/agy handles scaffolding, implementation, test generation, and bulk operations at lower cost.
Measured savings: −27% to −64% cost reduction on large tasks while maintaining equal quality through cross-model verification.
Installation
/plugin marketplace add yuting0624/antigravity-for-claude-code
/plugin install antigravity@antigravity-for-claude-code
/antigravity:setup
Prerequisites:
- Antigravity CLI installed and authenticated
- Claude Code running
- Verify setup:
agy models should list available models
Platform support: macOS, Linux, WSL (recommended). Native Windows has known issues with headless mode.
Key Commands
Slash Commands
/antigravity:setup
/antigravity:delegate [--tier flash|pro] <task>
/antigravity:review [--adversarial]
/antigravity:research <topic>
/antigravity:cloud-run-debug [--service <name>] [--region <region>] [--project <id>] [--since 1h] [--apply]
/antigravity:status [id]
/antigravity:result <id>
/antigravity:cancel <id>
Direct Script Usage
scripts/agy-delegate.sh --tier flash "Summarize this changelog in 3 bullets"
scripts/agy-delegate.sh --tier pro --dir ./src "List every TODO with file:line"
scripts/agy-delegate.sh --digest --dir . "Map the auth flow end to end"
scripts/agy-delegate.sh --mode accept-edits --dir ./app "Implement feature X per SPEC.md"
scripts/agy-delegate.sh --tier pro --yolo "Search latest React 19 features. Include URLs and dates."
scripts/agy-delegate.sh --tier pro --yolo "List available Vertex AI Search engines (list_engines)."
cat code-changes.diff | scripts/agy-delegate.sh -
ID=$(scripts/agy-job.sh start --tier pro --dir . "Generate comprehensive test suite")
scripts/agy-job.sh result "$ID"
Tier Configuration
| Tier | Model | Use Case |
|---|
flash (default) | Gemini 3.5 Flash (High) | Most bulk work |
flash-lo | Gemini 3.5 Flash (Low) | Trivial tasks, cheapest option |
pro | Gemini 3.1 Pro (High) | Complex reasoning, cross-checks |
Configure tiers via plugin options:
default_model: Override default model
tier_flash: Custom model for flash tier
tier_flash_lo: Custom model for flash-lo tier
tier_pro: Custom model for pro tier
Or use environment variables:
export CLAUDE_PLUGIN_OPTION_tier_pro="claude-3-5-sonnet-20241022"
Delegation Patterns
Pattern 1: Bulk Implementation
/antigravity:delegate --tier flash --dir ./src Implement the UserService class according to DESIGN.md. Include error handling and logging.
Pattern 2: Test Generation
scripts/agy-delegate.sh --tier flash --dir ./src "Generate unit tests for all functions in auth.ts. Use Jest. Cover edge cases and error paths."
Pattern 3: Cross-Model Review
/antigravity:review
/antigravity:review --adversarial
Pattern 4: Research with Citation Verification
/antigravity:research "Best practices for handling webhook retries in distributed systems"
Pattern 5: Bulk Refactoring
scripts/agy-delegate.sh --mode accept-edits --dir ./app "Migrate all class components to functional components with hooks. Preserve all functionality."
Cost Discipline Best Practices
The plugin's cost savings come from following these patterns:
1. Delegate Above Break-Even
/antigravity:delegate Generate integration tests for all API endpoints
/antigravity:delegate Fix this typo in line 42
2. Use Digests for Bulk Reads
scripts/agy-delegate.sh --digest --dir ./src "Analyze all database queries and summarize optimization opportunities"
scripts/agy-delegate.sh --dir ./src "List every database query with full context"
The wrapper warns when replies exceed digest_warn_chars (default 8000).
3. Batch Operations
/antigravity:delegate --dir ./src Analyze all components, identify performance issues, generate optimization recommendations with code examples
/antigravity:delegate List all components
/antigravity:delegate Analyze each component for performance
/antigravity:delegate Generate recommendations
4. Review Diffs, Not Full Files
/antigravity:review
/antigravity:delegate Review all files in ./src for bugs
Measure Session Cost
scripts/measure-session.py <session-id>
scripts/agy-cost-compare.sh "Generate test suite for user module"
Configuration
Plugin options (set in .claude-plugin/claude.json or via /plugin options):
{
"default_tier": "flash",
"default_model": "",
"tier_flash": "",
"tier_flash_lo": "",
"tier_pro": "",
"timeout_seconds": 120,
"job_timeout_seconds": 600,
"digest_warn_chars": 8000,
"coding_policy": "default",
"delegation_nudge": true,
"auto_inject_policy": true
}
Key options:
timeout_seconds: Sync delegation timeout (default 120)
job_timeout_seconds: Background job timeout (default 600)
digest_warn_chars: Warn when replies exceed this size
delegation_nudge: Proactive suggestions for bulk work
auto_inject_policy: Auto-inject cost-aware routing policy
Real-World Examples
Example 1: Migration Task
/antigravity:delegate --tier pro --dir ./api Review all REST endpoints in routes/ and generate equivalent GraphQL schema definitions with resolvers. Include type definitions and input validation.
Example 2: Documentation Generation
scripts/agy-delegate.sh --tier flash --dir ./src "Generate API documentation for all exported functions. Include parameter descriptions, return types, examples, and edge cases."
Example 3: Cloud Run Debugging
/antigravity:cloud-run-debug --service my-api --region us-central1 --since 2h
Example 4: Security Audit
/antigravity:review --adversarial
Example 5: Background Long-Running Task
ID=$(scripts/agy-job.sh start --tier pro --dir . "Analyze all dependencies, identify outdated packages, security vulnerabilities, and breaking changes in upgrades. Generate migration plan.")
/antigravity:status $ID
/antigravity:result $ID
Write Operations
For tasks that modify files:
scripts/agy-delegate.sh --mode accept-edits --dir ./app "Refactor authentication to use OAuth2"
scripts/agy-delegate.sh --yolo --dir ./app "Search docs and implement feature X"
git checkout -b agy-refactor
scripts/agy-delegate.sh --mode accept-edits --dir . "Task description"
git diff
git commit -m "Applied agy refactor"
Guardrails for writes:
- Run on dedicated branch/worktree
- Verify files actually changed (agy may write to scratch dir if permissions missing)
- Review diff before merging
- Long write tasks → use background jobs (avoid sync timeout)
Troubleshooting
Authentication Issues
agy models
agy auth login
Timeout Issues
export CLAUDE_PLUGIN_OPTION_timeout_seconds=300
scripts/agy-job.sh start --tier pro --dir . "long task"
WSL Performance
cd /mnt/c/Users/user/project
cd ~/project
The wrapper warns about Windows mount performance issues.
Write Tasks Not Applying
Check:
- File permissions: agy needs write access
- agy version:
--mode accept-edits requires >= 1.1.0
- Verify files changed:
git status
- Review agy log:
~/.config/agy/logs/*.log
See docs/TROUBLESHOOTING.md for detailed diagnostics.
Windows Native (Git Bash/MSYS)
Known issue: agy -p can hang without ConPTY. Solutions:
- Use WSL (recommended)
- Ensure
timeout/gtimeout on PATH for hang guard
- Wrapper returns TIMEOUT (exit 12) instead of hanging
Integration with Claude Code Workflow
Proactive Delegation
With delegation_nudge enabled, Claude receives hints for bulk-appropriate tasks:
User: "Generate tests for all components"
Claude: [recognizes bulk pattern] → suggests /antigravity:delegate
Session Policy Auto-Injection
SessionStart hook automatically injects cost-aware routing policy when auto_inject_policy: true:
- Delegate bulk/parallel/repetitive work to agy
- Keep Claude for judgment, architecture, verification
- Use digests for large reads
- Batch operations when possible
Subagent File Writing
The antigravity-delegate subagent handles file writes on Gemini side:
- Claude designs what to write
- Subagent executes on Gemini
- Claude verifies result
- Zero tokens spent on file content generation
Advanced Patterns
Multi-Stage Pipeline
RESEARCH_ID=$(scripts/agy-job.sh start --tier pro --yolo "Research best practices for rate limiting in Node.js APIs")
/antigravity:delegate --tier flash --dir ./src Implement rate limiting middleware per DESIGN.md
/antigravity:review
scripts/agy-delegate.sh --tier flash --dir ./src "Generate rate limiter tests covering edge cases"
Fan-Out Pattern
scripts/agy-delegate.sh --tier pro --dir . "Audit entire codebase: security, performance, maintainability. Use separate subagents for each concern."
Cost Measurement Loop
BEFORE=$(scripts/measure-session.py session-1 | grep "COST-WEIGHTED" | awk '{print $2}')
/antigravity:delegate [task]
AFTER=$(scripts/measure-session.py session-2 | grep "COST-WEIGHTED" | awk '{print $2}')
echo "Savings: $((BEFORE - AFTER)) tokens"
Environment Variables
export CLAUDE_PLUGIN_OPTION_default_tier="pro"
export CLAUDE_PLUGIN_OPTION_timeout_seconds=180
export CLAUDE_PLUGIN_OPTION_delegation_nudge=false
export CLAUDE_PLUGIN_OPTION_tier_flash="gemini-3.5-flash-002"
export CLAUDE_PLUGIN_OPTION_tier_pro="claude-3-5-sonnet-20241022"
Key Concepts
Conductor vs Executor: Claude conducts (judges, designs, verifies), Gemini executes (implements, searches, generates).
Break-Even Point: Delegation overhead vs savings. Bulk work above ~500 tokens is typically worth delegating.
Digest Contract: --digest appends instruction to return summary not dump. Biggest cost lever.
Cross-Model Verification: Different model provides independent check. Catches issues single model misses.
Background Jobs: Fire-and-collect pattern for interactive sessions. Use sync delegation in one-shot claude -p.
Cost Discipline: Not automatic—requires following patterns (delegate above break-even, use digests, batch operations, review diffs).
Links