From delegate-to-agents
Use when delegating a coding or research task to the Google Gemini CLI (`gemini`) from Claude Code. Covers non-interactive `-p`, approval modes, output formats, sessions, worktrees, and tmux interactive driving. Load delegate-to-agents first for the shared mechanism.
How this skill is triggered — by the user, by Claude, or both
Slash command
/delegate-to-agents:drive-geminiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Delegate to the [Gemini CLI](https://github.com/google-gemini/gemini-cli),
Delegate to the Gemini CLI,
Google's provider-agnostic-ish coding agent. Read delegate-to-agents first for
the shared Claude Code mechanism.
Flags verified against gemini 0.43.0 (gemini --help).
Coding, research, large-context analysis, or when you want Gemini's model specifically. Strong for big-context reads.
command -v gemini && gemini --version
GEMINI_API_KEY or GOOGLE_API_KEY, or run gemini once
interactively to complete Google OAuth. If neither is present and there's no
cached OAuth, a headless -p run will fail — fall back accordingly.-pGemini defaults to interactive mode; a bare positional prompt opens the TUI.
For automation you MUST pass -p/--prompt.
If the working directory isn't trusted (a fresh dir, /tmp, etc.), even a
headless -p run is blocked by the trust gate. Add --skip-trust (or set
GEMINI_CLI_TRUST_WORKSPACE=true). Already-trusted project dirs don't need it.
# headless, capture stdout
Bash(command="cd /repo && gemini -p 'Explain what src/server.ts does and list its exports'", timeout=300000)
# headless write task with auto-approved edits
Bash(command="cd /repo && gemini -p 'Add retry logic to the HTTP client and update tests' --approval-mode auto_edit", timeout=600000)
# stdin is appended to the -p prompt
Bash(command="git -C /repo diff | gemini -p 'Review this diff for bugs and security issues'", timeout=300000)
# long task: detach + log
Bash(command="cd /repo && gemini -p 'Refactor the data layer' --approval-mode auto_edit > /tmp/agent-gemini.log 2>&1", run_in_background=true)
| Flag | Effect |
|---|---|
-p, --prompt <text> | Headless (non-interactive) run |
-i, --prompt-interactive <text> | Run the prompt, then stay interactive |
-m, --model <name> | Model override |
--approval-mode <mode> | default (prompt), auto_edit (auto-approve edits), yolo (auto-approve all), plan (read-only) |
-y, --yolo | Shorthand for approve-all |
-o, --output-format <fmt> | text (default), json, stream-json |
-s, --sandbox | Run tools in a sandbox |
--skip-trust | Trust the workspace for this session (avoids the trust prompt) |
-w, --worktree [name] | Start in a fresh git worktree |
--include-directories <dirs> | Add directories to the workspace (monorepos) |
-e, --extensions <list> | Restrict to specific extensions |
gemini --list-sessions # see sessions for this project
gemini -r latest -p 'Continue: now add tests' # resume most recent
gemini -r 5 -p '...' # resume by index
gemini --session-id <uuid> -p '...' # pin a session id
Bash(command="tmux new-session -d -s gem -x 200 -y 50")
Bash(command="tmux send-keys -t gem 'cd /repo && gemini --skip-trust' Enter")
Bash(command="sleep 6 && tmux capture-pane -t gem -p -S -40")
Bash(command="tmux send-keys -t gem 'Add a CLI subcommand for export' Enter")
Bash(command="sleep 25 && tmux capture-pane -t gem -p -S -80")
Bash(command="tmux kill-session -t gem")
--skip-trust avoids the workspace-trust prompt. Without it, answer the trust
dialog by capturing the pane and sending the right key.
-p for automation — without it, Gemini opens the TUI and hangs a
non-interactive Bash call.auto_edit for building, plan for read-only
review, default when you want it to ask.--output-format json when you need to parse the result.--skip-trust (or pre-trust) in automation to avoid the trust prompt.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub josephyaduvanshi/delegate-to-agents --plugin delegate-to-agents