gemini-advisor
Modele, kendi kendine çağırdığı bir Gemini danışmanı veren bir Claude Code Mod'u. Model ne yaptığını, ne yapmak üzere olduğunu ve sorusunu yazar; Gemini o ana kadarki tüm konuşmayı, tool çağrıları ve çıktıları dahil, okur ve ikinci bir görüşle cevap verir. Cevap tool sonucu olarak geri gelir.
Fikir, Claude API'deki advisor tool'unu izler: orada executor model, kendi transcript'ini okuyan daha güçlü bir modeli çağırır. Bu mod onun yerine Gemini'ye sorar ve model kendi mesajını da gönderir.
Ne yapar
- Session başlangıcında, açıkken, mod
mcp__gemini-advisor__advisetool'unu tek bir input ile (message) tanımlar. - Engine bir plugin'in tool'unu ToolSearch arkasında listeler; orada model yalnız adını görür (2.1.277 üzerinde ölçüldü). Bu yüzden mod, system prompt'un
env_info_simplesection'ının sonuna bir# Gemini advisornotu ekler: tool'un ne yaptığı, nasıl yükleneceği ve ne zaman çağrılacağı. Not session sırasında değişmez, yani prompt cache tutar. - Not, çağrıyı dört anda zorunlu kılar, kullanıcı istemeden: önemli bir değişiklikten ya da çok adımlı bir plandan önce, tıkandığında (aynı hata iki kere), iki yaklaşım arasında seçim yaparken ve işin bittiğini söylemeden önce. Not ayrıca modele tavsiyeyi kodla karşılaştırmasını söyler.
- Bir çağrıda mod konuşmayı
$.session.messages()ile okur (bu, çalışan turn'ü de içerir, ölçüldü), her mesajı ve her tool çağrısını input'u ve output'u ile birlikte yazar ve modelin mesajıyla birlikte tek birgenerateContentisteğinde gönderir. 2.000.000 karakterin üstünde önce en uzun çıktılar baş ve son kısmına kısaltılır. İsteği gemini-core kurar:gemini-advisoriçin tuttuğu key, model ve thinking seviyesi ile; cevabı da o okur. - Tavsiye tool sonucu olarak geri gelir. Her başarısızlık, sebebini söyleyen bir hata sonucu olarak geri gelir, yani model onu görür; hiçbir şey yutulmaz.
- Gemini arada bir HTTP 503 ("high demand") döner ve sonraki istek çoğu zaman çalışır (ölçüldü: iki flash modelde 5 istekten 2'si). gemini-core bunu okuduğu şekliyle mod 1 sn, 2 sn ve 3 sn sonra tekrar sorar, en fazla dört kere, ve 40 saniye geçtikten sonra yeni deneme başlatmaz, böylece sonuncusu 60 saniyelik tool timeout'una sığar.
2.1.277 üzerinde gemini-3.8-flash ile yapılan canlı testte model iki yaklaşım arasında seçim yaparken danışmanı kendiliğinden çağırdı, 27 mesaj (15k token) gönderdi, tavsiyeyi 7,1 saniyede aldı ve cevabında tavsiyeyi kullandı. Daha yumuşak bir notla ("call it on your own") model böyle iki turn'de onu çağırmadı ve sonrasında turn'ün notun adlandırdığı türden olduğunu söyledi.
Ne gösterir
Her tavsiyeden sonra bir toast ve /gemini-advisor içinde sonuncusu:
gemini-advisor: asked gemini-3.8-flash · 27 messages · 15k in, 2k out · sent to Gemini free tier
Transcript'teki tool satırı modelin mesajını ve tavsiyeyi tutar (ctrl+o).
Komut
/gemini-advisor on ya da off, gemini-core'un tuttuğu model, thinking seviyesi ve tier, key var mı, son tavsiye
/gemini-advisor on | off gemini-core'da key yokken on reddedilir; off: bir çağrı danışmanın kapalı olduğunu söyler
/gemini-advisor reset tekrar off, varsayılan
Danışman kurulumdan sonra kapalıdır: model tool ve not almaz ve Gemini'ye hiçbir şey gönderilmez. on tool'u hemen tanımlar. System prompt notu ayarı /clear ya da sonraki session'da izler, hemen değil; çünkü session ortasında system prompt'u değiştirmek sonraki isteğin tüm prompt cache'ini yeniden yazmasına yol açar. off sonrasında not /clear ya da sonraki session'da kalkar, tool sonraki session'da; o ana kadar bir çağrı danışmanın kapalı olduğunu söyler.
Key, tier, model (varsayılan gemini-3.8-flash) ve thinking seviyesi gemini-core'a aittir; değişiklik bir sonraki çağrıdan itibaren geçerlidir:
/gemini-core model advisor gemini-3.7-flash
/gemini-core thinking advisor high
/gemini-core paid
Free tier ya da paid tier
Her çağrı konuşmayı gönderir: prompt'larınızı, modelin çalıştırdığı komutları ve okuduğu dosyaların içeriğini. Free tier'da Google bunları kullanabilir ve insan denetçiler okuyabilir; gemini-core README'si Gemini API Additional Terms'ten alıntılar. Google'a göstermeyeceğiniz bir projede billing açık bir key kullanın ve /gemini-core paid ayarlayın.
Canlı testte kullanılan free key ile gemini-3.1-pro-preview HTTP 429 (quota exceeded) döndü, yani bir pro model paid key ister.
Kurulum
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install gemini-advisor@kilimcininkoroglu-mods
gemini-core'a bağlıdır; claude plugin install onu da ekler. Function hook'lar early access. Flag olmadan hiçbir şey yüklenmez. Flag'i kalıcı yapmak için ~/.claude/settings.json dosyasına ekleyin:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }
Kurulumdan sonra
- Gemini key'ini ve tier'ı gemini-core'da ayarlayın, onun After installing bölümünde yazdığı gibi, sonra Claude Code'u yeniden başlatın.
/gemini-advisor onçalıştırın, sonra/clearyapın ya da yeni bir session başlatın; böylece system prompt notu modele ulaşır. Key olmadanonkomutustill off: gemini-core has no Gemini keycevabını verir ve kapalı kalır./gemini-advisorçalıştırın. İlk satıron · <model> · thinking ... · <tier> tier · key setdemelidir.- Bir tavsiye çağrısı
Gemini HTTP 429ile başarısız olursa key'inizde o model için kota yok demektir./gemini-core model advisorile başka bir model seçin.
0.1.x'ten güncellemeden sonra: claude plugin update gemini-core'u eklemez (2.1.278 üzerinde ölçüldü), bu yüzden bir kere claude plugin install gemini-core@kilimcininkoroglu-mods çalıştırın. 0.2.0 sürümü key, tier ve model'i gemini-core'a taşıdı; daha önce saklanan apiKey, tier ve model option'ları ile /gemini-advisor free|paid|model ayarları artık okunmuyor, onları gemini-core'da yeniden ayarlayın. 0.3.0 sürümü danışmanı varsayılan olarak kapattı: daha eski bir sürümden güncellediyseniz, daha önce /gemini-advisor on çalıştırmadıysanız kapalıdır; bir kere /gemini-advisor on çalıştırın.
Option'lar
| Option | Varsayılan | Ne ayarlar |
|---|---|---|
maxInputChars |
2000000 |
En fazla kaç karakter konuşma gönderilir |
maxOutputTokens |
8192 |
En uzun tavsiye, thinking dahil; kesilmiş bir tavsiye hatadır |
Nereye uzanır
Claude Code 2.1.278 üzerinde claude plugin validate ile doğrulandı:
❯ ./register.ts hooks: session.start, classic.SessionStart, command.run{command=gemini-advisor}, prompt.section{name=env_info_simple}, tool.call{tool=mcp__gemini-advisor__advise}
❯ ./register.ts calls: $.clock.now (via askGemini), $.clock.sleep (via askGemini), $.command.register, $.gemini.enroll, $.gemini.read (via askGemini), $.gemini.request (via askGemini), $.gemini.settings (via runCommand, storeEnabled), $.http.fetch (via askGemini), $.session.messages (via conversation), $.store.delete (via runCommand), $.store.get (via isEnabled), $.store.set (via storeEnabled), $.tool.register (via declareTool), $.ui.toast (via advise)
Reach L3, network'e çıkar.
1. Okur: her danışman çağrısında konuşmayı (mesajlar, tool input'ları ve output'ları); kendi $.store dosyasını; gemini-core'dan key'i taşıyan isteği
2. Çalıştırır: hiçbir process; açıkken system prompt'a bir not ekler ve bir tool tanımlar
3. Gönderir: konuşmayı ve modelin mesajını, çağrı başına bir istek (503 sonrası en fazla dört, 429 ya da key hatası sonrası ek key başına bir tane daha), gemini-core'un kurduğu URL'ye (generativelanguage.googleapis.com), key x-goog-api-key header'ında, hiçbir zaman URL'de değil
4. Saklar: $.store içinde on/off ayarını; son kullanım satırı bellekte yaşar
5. Düşman girdi: tavsiye, modelin tool sonucu olarak okuduğu güvenilmez metindir; yani düşman ya da yanlış bir tavsiye, modeli okuduğu bir dosyadaki metin gibi yönlendirebilir; not modele onu doğrulamasını söyler
Sınırlar
- Modelin danışmanı çağırıp çağırmaması kendi kararıdır. Canlı test tek tür bir turn'ü kapsadı.
- Tool açıklaması hiçbir modeli adlandırmaz. Engine ilk gönderdiği açıklamayı session boyunca korur: model değişiminden sonra yeniden kaydedilen bir tool modele yine eski metinle ulaştı (2.1.278 üzerinde ölçüldü). Toast ve
/gemini-advisorbir çağrının hangi modele gittiğini adlandırır. - Engine tool'u 60 saniyelik MCP timeout'u ile sunar (debug log, 2.1.277). Daha uzun süren bir çağrı başarısız olur ve model hatayı okur.
- Not
env_info_simplesection'ına eklenir. System prompt'unda böyle bir section olmayan bir kurulum not almaz ve model yalnız tool'un adını görür. Yalnız bir kurulum kontrol edildi. - Bir subagent'ın çağrısı yalnız kendi mesajını gönderir, çünkü subagent içinde
$.session.messages()hangi transcript'i cevaplar, doğrulanmadı. $.session.messages()uzun bir transcript'in en yeni 4096 mesajını cevaplar.- Her çağrı tüm konuşmayı gönderir, yani uzun bir session her çağrıyı daha büyük ve daha yavaş yapar.
Geliştirme
make install # eslint, typescript-eslint, typescript
make lint # complexity limiti 10, üstünde build'i düşürür
make typecheck # /plugin-types ile üretilen .claude/types/ gerekir
make validate
make test # claude plugin test
gemini-advisor
A Claude Code Mod that gives the model a Gemini advisor it calls by itself. The model writes what it did, what it is about to do and its question; Gemini reads the whole conversation so far, tool calls and outputs included, and answers with a second opinion that comes back as the tool result.
The idea follows the advisor tool of the Claude API, where the executor model calls a stronger model that reads its transcript. This mod asks Gemini instead, and the model also sends a message of its own.
What it does
- At session start, while it is on, the mod declares the tool
mcp__gemini-advisor__advisewith one input,message. - The engine lists a plugin's tool behind ToolSearch, where the model sees only its name (measured on 2.1.277). So the mod adds a
# Gemini advisornote to the end of theenv_info_simplesection of the system prompt: what the tool does, how to load it, and when to call it. The note does not change during a session, so the prompt cache holds. - The note makes the call required, without the user asking, at four moments: before a substantial change or a multi-step plan, when stuck (the same error twice), when choosing between two approaches, and before saying the work is done. It also tells the model to check the advice against the code.
- At a call, the mod reads the conversation with
$.session.messages(), which includes the running turn (measured), renders every message and each tool call with its input and output, and sends it with the model's message in onegenerateContentrequest. Above 2,000,000 characters the longest outputs are cut to their head and tail first. gemini-core builds the request with the key, the model and the thinking level it holds forgemini-advisor, and reads the answer. - The advice comes back as the tool result. Any failure comes back as an error result that says why, so the model sees it; nothing is swallowed.
- Gemini answers HTTP 503 ("high demand") now and then, and the next request often works (measured: 2 of 5 requests on two flash models). As gemini-core reads it, the mod asks again after 1 s, 2 s and 3 s, at most four times, and starts no attempt once 40 s have passed, so the last one fits the 60-second tool timeout.
In a live check on 2.1.277 with gemini-3.8-flash, the model called the advisor on its own while choosing between two approaches, sent 27 messages (15k tokens), got the advice in 7.1 seconds, and its answer used the advice. With a softer note ("call it on your own") the model did not call it in two such turns, and said afterwards that the turn was one the note named.
What it shows
A toast after each advice, and the last one in /gemini-advisor:
gemini-advisor: asked gemini-3.8-flash · 27 messages · 15k in, 2k out · sent to Gemini free tier
The tool row in the transcript holds the model's message and the advice (ctrl+o).
Command
/gemini-advisor on or off, the model, thinking level and tier gemini-core holds, whether a key is set, the last advice
/gemini-advisor on | off on is refused while gemini-core has no key; off: a call answers that the advisor is off
/gemini-advisor reset off again, the default
The advisor is off after an install: the model gets no tool and no note, and nothing is sent to Gemini. on declares the tool at once. The system prompt note follows the setting at /clear or the next session, not at once, because a change of the system prompt in the middle of a session makes the next request write the whole prompt cache again. After off the note leaves at /clear or the next session and the tool at the next session; until then a call answers that the advisor is off.
The key, the tier, the model (default gemini-3.8-flash) and the thinking level are gemini-core's, and a change applies from the next call:
/gemini-core model advisor gemini-3.7-flash
/gemini-core thinking advisor high
/gemini-core paid
Free tier or paid tier
Every call sends the conversation: your prompts, the commands the model ran and the contents of the files it read. On the free tier Google may use them and human reviewers may read them; the gemini-core README quotes the Gemini API Additional Terms. On a project you would not show to Google, use a key with billing enabled and set /gemini-core paid.
With the free key used in the live check, gemini-3.1-pro-preview answered HTTP 429 (quota exceeded), so a pro model needs a paid key.
Install
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install gemini-advisor@kilimcininkoroglu-mods
It depends on gemini-core, which claude plugin install adds. Function hooks are early access. Nothing loads without the flag. To keep it on, add this to ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1" } }
After installing
- Set the Gemini key and the tier in gemini-core, as its After installing section says, then restart Claude Code.
- Run
/gemini-advisor on, then/clearor start a new session, so the system prompt note reaches the model. Without a keyonanswersstill off: gemini-core has no Gemini keyand stays off. - Run
/gemini-advisor. The first line readson · <model> · thinking ... · <tier> tier · key set. - When an advice call fails with
Gemini HTTP 429, the model has no quota on your key. Pick another with/gemini-core model advisor.
After an update from 0.1.x: claude plugin update does not add gemini-core (measured on 2.1.278), so run claude plugin install gemini-core@kilimcininkoroglu-mods once. Version 0.2.0 moved the key, tier and model to gemini-core; the apiKey, tier and model options and the settings /gemini-advisor free|paid|model stored before are no longer read, so set them again in gemini-core. Version 0.3.0 made the advisor off by default: after an update from an earlier version it is off unless you ran /gemini-advisor on before, so run /gemini-advisor on once.
Options
| Option | Default | What it sets |
|---|---|---|
maxInputChars |
2000000 |
Characters of conversation sent at most |
maxOutputTokens |
8192 |
The longest advice, thinking included; a cut advice is an error |
What it can reach
Validated with claude plugin validate on Claude Code 2.1.278:
❯ ./register.ts hooks: session.start, classic.SessionStart, command.run{command=gemini-advisor}, prompt.section{name=env_info_simple}, tool.call{tool=mcp__gemini-advisor__advise}
❯ ./register.ts calls: $.clock.now (via askGemini), $.clock.sleep (via askGemini), $.command.register, $.gemini.enroll, $.gemini.read (via askGemini), $.gemini.request (via askGemini), $.gemini.settings (via runCommand, storeEnabled), $.http.fetch (via askGemini), $.session.messages (via conversation), $.store.delete (via runCommand), $.store.get (via isEnabled), $.store.set (via storeEnabled), $.tool.register (via declareTool), $.ui.toast (via advise)
Reach L3, reaches the network.
1. Reads: the conversation at each advisor call (messages, tool inputs and outputs); its own $.store; from gemini-core, the request with the key
2. Runs: no process; while on, it adds one note to the system prompt and declares one tool
3. Sends: the conversation and the model's message, one request per call (up to four after a 503, and once more per extra key after a 429 or a key error), to the URL gemini-core builds (generativelanguage.googleapis.com) with the key in the x-goog-api-key header, never in the URL
4. Persists: in $.store, the on/off setting; the last usage line lives in memory
5. Hostile input: the advice is untrusted text the model reads as a tool result, so a hostile or wrong advice can steer the model as text in a file it reads can; the note tells the model to check it
Limits
- Whether the model calls the advisor is its own decision. The live check covered one kind of turn.
- The tool description names no model. The engine keeps the description it first sent for the whole session: a tool registered again after a model change still reached the model with the old text (measured on 2.1.278). The toast and
/gemini-advisorname the model a call went to. - The engine serves the tool with a 60-second MCP timeout (debug log, 2.1.277). A call that takes longer fails, and the model reads the error.
- The note is added to the
env_info_simplesection. A setup whose system prompt has no such section gets no note, and the model sees the tool's name only. Only one setup was checked. - A subagent's call sends only its message, because which transcript
$.session.messages()answers inside a subagent was not verified. $.session.messages()answers the newest 4096 messages of a long transcript.- Every call sends the whole conversation, so a long session makes each call larger and slower.
Development
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, fails the build above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test