/nexus-agents:gemini-delegatorfrom nexus-agents
Delegates large-context tasks (100K+ tokens) to Gemini models via the agy CLI. Useful for bulk codebase analysis, speed/cost-sensitive operations, and Google Cloud integration.
Ships in nexus-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The standalone
geminiCLI is retired (#4389). It exits 55 withIneligibleTierErroron every invocation. Thegeminirouting arm keeps its name but spawnsagy(Google's Antigravity CLI), which serves the Gemini models. Every command below usesagy; do not shell out togemini.
Full documentation:
| Metric | Value | Notes |
|---|---|---|
| Max files analyzed | 978 files in single query | ~280k LOC processed successfully |
| Latency (simple) | 10-15 seconds | Single directory analysis |
| Latency (complex) | 58-73 seconds | Full codebase analysis |
| Cache efficiency | 94k tokens cached | Significant cost savings |
| Tool calls/session | Up to 20 | File reads auto-executed |
| Model routing | flash-lite → pro | Two-model approach for optimization |
| Condition | Threshold/Criteria | Reason |
|---|---|---|
| Context size | > 100K tokens | Gemini: 1M context window |
| Large codebase analysis | Multiple files, > 50 files | Fast bulk processing |
| Speed-critical tasks | Latency sensitive | Flash models optimized |
| Cost-sensitive operations | Budget constraints | Flash models are cheaper |
| Google Cloud integration | BigQuery, Cloud Functions | Native integration |
Use the nexus-agents MCP tool for intelligent routing:
# The tool analyzes task and recommends optimal model
nexus-agents delegate_to_model --task "Analyze this 500K token codebase"
agy# Run one prompt non-interactively (print mode); prompt as the flag value
agy --print "Analyze this codebase"
# Or pipe the prompt on stdin — keeps large prompts out of argv
cat prompt.md | agy --output-format json
# JSON output for parsing
agy --print "Analyze this codebase" --output-format json
# Specify a model — slugs come from `agy models`, not the registry ids
agy --model gemini-3.8-flash-medium --print "Quick analysis task"
agy --model gemini-3.1-pro-high --print "Complex reasoning task"
# Name the workspace: agy defaults to its STORED project, not the cwd (#6254)
agy --add-dir "$PWD" --print "Review all files in src/" --output-format json
JSON output: --output-format json returns
{conversation_id, status, response, duration_seconds, num_turns, usage}.
agy exits 0 even when the run failed, so the verdict is the status field,
never the exit code:
const result = JSON.parse(output);
if (result.status !== 'SUCCESS') throw new Error(result.error ?? `agy status ${result.status}`);
const response = result.response;
In TypeScript inside this repo, reuse AgyResponseParser
(packages/nexus-agents/src/cli-adapters/parsers/agy-parser.ts) instead of
re-parsing by hand.
Not read-only. agy cannot enforce read-only analysis (#6962): --mode plan
writes a plan and then executes it in print mode, and --sandbox restricts the
terminal, not file edits. Run it in a scratch checkout when it must not write.
No image or file input. agy has no flag for attaching images, audio or
video, and the nexus-agents agy path sends text only. The multimodal examples
that piped files into the retired gemini CLI no longer apply.
| Model | Context Window | Best For |
|---|---|---|
| Claude | ~200K tokens | Quality reasoning |
| Gemini Pro | 1M tokens | Large context |
| Gemini Flash | 200K-1M tokens | Speed, high volume |
The 1M token context window enables:
# Human readable (default)
agy --print "task"
# JSON for parsing (check `status`, see above)
agy --print "task" --output-format json
# Streaming JSON
agy --print "task" --output-format stream-json
Evaluate task requirements:
Choose delegation method:
delegate_to_model for intelligent routingagy for explicit controlConfigure execution:
agy models (Pro vs Flash)--output-format json for parsing--add-dir for the tree agy should work inProcess results:
status === 'SUCCESS' before reading response# Large context analysis
agy --add-dir "$PWD" --print "Analyze this entire codebase structure"
# Fast iteration
agy --model gemini-3.8-flash-medium --print "Quick review" --output-format json
# Cost-sensitive batch
for f in *.ts; do agy --print "Review: $(cat "$f")" >> reviews.txt; done
| Excuse | Counter |
|---|---|
| "Gemini for everything, it has a big context" | Big context isn't free — output quality varies by task. Use Gemini for >100k context or research-shaped tasks. |
| "I'll use Gemini even for short code-gen" | Codex is faster on code. Use Gemini when context size forces the choice. |
gemini binary instead of agystatus fieldWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
34 skills in this plugin
/api-and-interface-designDesign stable, hard-to-misuse interfaces — REST endpoints, MCP tool
schemas, module boundaries, type contracts. Apply when defining new
surfaces or evolving public ones. Triggers on "API design", "interface",
"schema", "contract", "module boundary", "type design".
/browser-testing-with-devtoolsTest UI in real browsers via Chrome DevTools MCP. Apply when debugging
rendering issues, console errors, network behavior, performance, or
accessibility — anywhere static code analysis can't see runtime state.
Triggers on "browser test", "DOM inspect", "console errors",
"network trace", "core web vitals in browser", "ui bug repro".
/bug-fixFix a bug following project standards.
Use when fixing defects, debugging issues, or resolving reported problems.
Triggers on "fix bug", "debug", "fix issue", "resolve bug".
/code-simplificationReduce nesting, extract names, eliminate redundancy without changing
behavior. Apply after features work and tests pass — never as a
drive-by during feature work. Triggers on "simplify", "refactor for clarity",
"this is hard to read", "code review flagged complexity".
/codex-delegatorDelegate code generation tasks to Codex CLI for optimal performance.
Use when implementing features, generating tests, refactoring code, or
making bulk code changes. Triggers on "delegate to codex", "route to codex",
"use codex", "code generation".
/context-engineeringCurate what the agent sees, when, and how it's structured. Apply when
starting a session, when output quality drifts, when fanning out
subagents, or when configuring rules files. Triggers on
"context engineering", "rules file", "agent context",
"subagent fan-out", "context budget".
Other plugins' skills for the same job