From gemini-router
Smart Gemini CLI delegation skill. Activate this skill at the START of processing any user request — before reading files or starting work — to evaluate whether the task should be routed to Gemini. Always check experience.md first for auto-approve patterns. If unsure, use AskUserQuestion to let the user decide. Do NOT activate for casual conversation or tiny tasks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gemini-router:geminiThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Route tasks to Google's Gemini CLI (1M token context window) intelligently. The key behavior:
Route tasks to Google's Gemini CLI (1M token context window) intelligently. The key behavior: always evaluate FIRST, then decide — never start a big task without checking.
Before doing anything else, read the experience log:
cat ~/.claude/skills/gemini/experience.md
The log contains:
[AUTO_APPROVE] entries — task types to always send to Gemini, no prompt needed[AVOID] entries — task types where Gemini underperformed, handle with Claude instead[AUTO_APPROVE] pattern in experience.md[AVOID] pattern in experience.md → handle with Claude, mention why→ Go straight to Gemini — skip the question → Briefly note: "Routing to Gemini (auto-approved: [pattern name])"
→ Use AskUserQuestion with this exact structure:
Question: "This task looks like a good fit for Gemini (large context / token savings). How should I handle it?"
Header: "Route to Gemini?"
Options:
1. label: "Use Gemini & remember this task type"
description: "Delegate to Gemini now, and auto-route similar tasks in the future without asking"
2. label: "Use Gemini, just this once"
description: "Delegate to Gemini now, but ask again next time"
3. label: "Claude handles it"
description: "Skip Gemini for this task"
→ Handle with Claude normally, no question needed
[AUTO_APPROVE] entry to experience.md (format below)[Gemini Response][Gemini Response]gemini -p "COMPLETE SELF-CONTAINED PROMPT" --output-format text --yolo 2>&1
cat /path/to/large/file | gemini -p "YOUR INSTRUCTION" --output-format text --yolo 2>&1
gemini -p "$(printf 'Analyze these files:\n\n=== file1 ===\n'; cat file1; printf '\n\n=== file2 ===\n'; cat file2; printf '\n\nTask: YOUR INSTRUCTION')" --output-format text --yolo 2>&1
Important: Gemini headless is single-shot — craft a complete, self-contained prompt with all needed context included.
After presenting Gemini output, watch the user's next message for dissatisfaction signals:
Signals: "wrong", "not good", "that's off", "redo this", user corrects the output, user asks Claude to redo the same task
When detected:
Question: "Should I mark this task type as a poor fit for Gemini and handle it with Claude going forward?"
Options:
- "Yes, log it" — description: "Record this as an [AVOID] pattern"
- "No, just this once" — description: "Don't log anything"
[AVOID] entry to experience.md[AUTO_APPROVE] entry, update it to [AVOID]---
### [AUTO_APPROVE] YYYY-MM-DD
**Pattern**: one-line description of the task type (e.g., "Full Go codebase read-only analysis")
**Trigger keywords**: keywords that identify this pattern
**Reason**: why Gemini is well-suited for this
---
### [AVOID] YYYY-MM-DD
**Pattern**: one-line description of the task type
**What went wrong**: brief failure description from user feedback
**Lesson**: what to do instead next time
| Condition | Action |
|---|---|
| Matches [AUTO_APPROVE] | Go straight to Gemini, no question |
| Matches [AVOID] | Use Claude, explain why |
| Large/complex, no prior record | AskUserQuestion (3 options) |
| Small/simple task | Claude handles, no question |
| User picks "remember this type" | Write AUTO_APPROVE + run Gemini |
| User flags poor result | AskUserQuestion → write AVOID |
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub audi0417/claude-gemini-router --plugin gemini-router