dwgx@blog:~$dwgx
> cd ../posts

claude-gemini-subagent: let gemini do the grunt work, claude just calls the shots

// created

claude-gemini-subagent is a claude code skill that forwards token-heavy grunt work to the local gemini cli. Once you use claude code for a while, you notice what it’s actually worth is orchestration and making the calls, while the token burn comes from grunt work like searching for material, reading long files, and scanning a repo for TODOs. By the time that work is done, your context is stuffed too. This skill’s approach: let claude handle planning and sign-off only, throw the heavy lifting to another gemini with its own independent context and its own token budget, and get back a one-line conclusion when it’s done. Two brains stacked, and claude’s context stays clean throughout.

The core is thin forwarding. gemini’s stdout is the authoritative return value; claude isn’t allowed to fill in gaps or rewrite it. The moment the middle layer starts embellishing, the answer drifts.

Permissions are adaptive. By default auto_edit can only write to the workspace; the moment a task needs network access or reaches across workspaces, it auto-upgrades to full access. No approval dialog pops up, claude states in one line which mode it picked and why, then runs.

stderr doesn’t go to /dev/null, and the thinking stream is dumped into a /tmp log. When things go smoothly the terminal stays clean; when something breaks the log is all there, ready to page through directly.

filename=$(openssl rand -hex 4)
gemini ... 2>>"/tmp/gemini-${filename}.log"

Tasks are graded by type: audits and security reviews get high effort, ordinary changes take the default. Follow-ups reuse the previous session with gemini –resume latest instead of re-feeding the context; independent subtasks get thrown into the background to run in parallel, and long tasks use run_in_background paired with TaskOutput polling and TaskStop for cancellation. Results are split into success / partial / error, with no silent retries. There are also five pre-written personas: reviewer, debugger, auditor, researcher, refactorer, each carrying its own sandbox and effort defaults, all markdown with a {{TASK}} placeholder. Want to add one? Drop it in following the same format.

Setup has no barrier: no node dependency, no config, no MCP server. Just copy it into ~/.claude/skills and you’re done.

git clone https://github.com/dwgx/claude-gemini-subagent.git
cp -r claude-gemini-subagent/skills/gemini-subagent ~/.claude/skills/

After that just talk to claude normally, a line like “hand this off to gemini to scan the repo’s TODOs” triggers it on its own. It doesn’t replace Read/Edit on small files, since for that kind of small job calling the tool directly is cheaper. This skill is only worth it when it saves 3k+ tokens. It’s also not for outsourcing your thinking. gemini is a worker, not a copilot; calling the shots is still claude’s job.

Repo https://github.com/dwgx/claude-gemini-subagent