Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Use Gemini CLI from Claude Code as part of Sub ...

Use Gemini CLI from Claude Code as part of Sub Agent

This slide shows a 5-minute explanation of how to call Gemini CLI from Claude Code Sub Agent.

Avatar for Shingo Tamaki

Shingo Tamaki

August 10, 2025
Tweet

More Decks by Shingo Tamaki

Other Decks in Technology

Transcript

  1. Agenda • What are ... • Claude / Gemini •

    Claude Code / Gemini CLI • Claude Code Sub Agents, Slash Commands
  2. What are Claude, Gemini AI Assistant Name Maintained By Models

    Desktop App Use Case Claude Anthropic Sonnet 4, Opus 4.1 Claude Desktop Software Development Google Gemini Google Gemini 2.5 (Pro, Flash, Flash-Lite) - Research & Analysis ChatGPT OpenAI GPT-5, gpt-5-mini, gpt-5-nano ChatGPT Creative Writing, etc Others are Cursor, Github Copilot Agent, etc
  3. What are Claude Code / Gemini CLI AI Assistant available

    from Command Line Interface(CLI) • Claude Code • Gemini CLI • Codex CLI • Cursor CLI
  4. What's Sub Agents of Claude Code Create and use specialized

    AI subagents in Claude Code for task-specific workflows and improved context management. • Context preservation • Specialized expertise • Reusability • Flexible permissions
  5. File format path: .claude/agents/foo.md --- name: your-sub-agent-name description: Description of

    when this subagent should be invoked tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted --- Your subagent's system prompt goes here. This can be multiple paragraphs and should clearly define the subagent's role, capabilities, and approach to solving problems. Include specific instructions, best practices, and any constraints the subagent should follow.
  6. Use Gemini CLI from Sub Agent use mcp-gemini-cli https://github.com/choplin/mcp-gemini-cli //

    Add MCP Server claude mcp add -s project gemini-cli -- npx mcp-gemini-cli --allow-npx // Edit sub agent definition Please ask gemini-cli to do the investigation work but the report should be prepared by this agent.
  7. How it work ⏺ market-researcher(ࢢ৔෼ੳͱϨϙʔτ࡞੒) 㽾 Here's a summary of

    the web search results on mobile app monetization for climbing sports apps: The dominant monetization model for climbing apps is a **freemium approach with a premium subscription**. This strategy allows apps to attract a large user base with free core features while generating revenue from dedicated users who subscribe for advanced funct … +19 lines (ctrl+r to expand) gemini-cli - googleSearch (MCP)(query: "\"climbing wall route reading\" \"bouldering problem\" AR augmented reality mobile app", limit: 8) +5 more tool uses
  8. Custome slash commands path: .claude/commands/start-project.md --- name: start-project description: Launch

    new projects efficiently with a 2-phase parallel workflow. Execute requirement analysis → strategic analysis (parallel) → MVP definition in sequence tools: Read, Write, Grep, Glob, Bash, Task --- # Project Launch Master Command You are a master orchestrator for efficiently launching new projects. Execute the following 4-phase workflow strictly. ## Execution Phases ### Phase 1: Requirement Analysis & Definition (Sequential Execution) 1. Read request.md as request if it exists there. 2. Use **product-manager** subagent 3. Use **requirements-definition** slash command ### Phase 2: Strategic Analysis Phase (4 Parallel Subagents) Task 1: market-researcher subagent for market analysis ... Task 2: business-strategist subagent for business strategy ...
  9. Example (Phase1 P1) > /start-project is running… ⏺ ϓϩδΣΫτͷ্ཱͪ͛Λ։࢝͠·͢ɻ4ϑΣʔζͷϫʔΫϑϩʔΛ࣮ߦ͍͖ͯ͠·͢ɻ ϑΣʔζ1:

    ཁ݅෼ੳͱఆٛ ·ͣɺrequest.mdϑΝΠϧͷଘࡏΛ֬ೝ͠·͢ɻ ⏺ Read(request.md) 㽾 Read 3 lines (ctrl+r to expand) ⏺ ཁ݅Λ֬ೝ͠·ͨ͠ɻϘϧμϦϯά࿅शࢧԉΞϓϦͷ։ൃͰ͢Ͷɻ࣍ʹproduct-managerΤʔδΣϯτΛ࢖༻ͯ͠ৄࡉͳཁ݅෼ੳΛߦ͍·͢ɻ ⏺ Update Todos 㽾 ☐ ϑΣʔζ1: product-managerΤʔδΣϯτͰཁ݅෼ੳ ☐ ϑΣʔζ1: requirements-definitionίϚϯυͰཁ݅ఆٛॻ࡞੒ ☐ ϑΣʔζ2: 4ͭͷΤʔδΣϯτΛฒྻ࣮ߦʢࢢ৔ௐࠪɾϏδωεઓུɾ๏຿ɾMVPఆٛʣ ☐ ౷߹ϓϩδΣΫταϚϦʔͷ࡞੒ ⏺ product-manager(ཁ݅෼ੳͱػೳ༏ઌॱҐ෇͚) 㽾 Done (3 tool uses · 19.6k tokens · 2m 11.2s) ⏺ Update Todos 㽾 ☒ ϑΣʔζ1: product-managerΤʔδΣϯτͰཁ݅෼ੳ ☐ ϑΣʔζ1: requirements-definitionίϚϯυͰཁ݅ఆٛॻ࡞੒ ☐ ϑΣʔζ2: 4ͭͷΤʔδΣϯτΛฒྻ࣮ߦʢࢢ৔ௐࠪɾϏδωεઓུɾ๏຿ɾMVPఆٛʣ ☐ ౷߹ϓϩδΣΫταϚϦʔͷ࡞੒
  10. Example (Phase1 P2) ⏺ ཁ݅ఆٛॻΛ࡞੒͠·͢ɻ ⏺ Write(requirements.md) 㽾 Wrote 200

    lines to requirements.md # ϘϧμϦϯά࿅शࢧԉΞϓϦ ཁ݅ఆٛॻ ## 1. ϓϩδΣΫτ֓ཁ ### 1.1 Ϗδϣϯ ϘϧμϦϯάѪ޷Ո͕ޮ཰తָ͔ͭ͘͠࿅शͰ͖ΔϞόΠϧΞϓϦέʔγϣϯΛఏڙ͠ɺεΩϧ޲্ͱ࿅शମݧͷվળΛ࣮ݱ͢Δɻ ### 1.2 ϛογϣϯ - ϘϧμϦϯά΢Υʔϧͷը૾Λ׆༻ͨ͠௚ײతͳίʔεೝࣝࢧԉ - ελʔτϙδγϣϯͱϗʔϧυͷ໌֬ͳՄࢹԽ … +190 lines (ctrl+r to expand) ⏺ Update Todos 㽾 ☒ ϑΣʔζ1: product-managerΤʔδΣϯτͰཁ݅෼ੳ ☒ ϑΣʔζ1: requirements-definitionίϚϯυͰཁ݅ఆٛॻ࡞੒ ☐ ϑΣʔζ2: 4ͭͷΤʔδΣϯτΛฒྻ࣮ߦʢࢢ৔ௐࠪɾϏδωεઓུɾ๏຿ɾMVPఆٛʣ ☐ ౷߹ϓϩδΣΫταϚϦʔͷ࡞੒
  11. Example (Phase 2 P1) ⏺ ϑΣʔζ2: ઓུత෼ੳϑΣʔζ ࣍ʹɺ4ͭͷઐ໳ΤʔδΣϯτΛฒྻ࣮ߦͯ͠ɺଟ֯తͳ෼ੳΛߦ͍·͢ɻ ⏺ market-researcher(ࢢ৔෼ੳͱϨϙʔτ࡞੒)

    㽾 Done (8 tool uses · 18.7k tokens · 18m 15.2s) ⏺ business-strategist(Ϗδωεઓུࡦఆ) 㽾 Done (4 tool uses · 42.9k tokens · 5m 57.0s) ⏺ legal-expert(๏຿ίϯϓϥΠΞϯεධՁ) 㽾 Done (1 tool use · 18.0k tokens · 1m 40.6s) ⏺ product-designer(MVPఆٛͱઃܭ) 㽾 Done (15 tool uses · 39.8k tokens · 10m 23.7s) ⏺ Update Todos 㽾 ☒ ϑΣʔζ1: product-managerΤʔδΣϯτͰཁ݅෼ੳ ☒ ϑΣʔζ1: requirements-definitionίϚϯυͰཁ݅ఆٛॻ࡞੒ ☒ ϑΣʔζ2: 4ͭͷΤʔδΣϯτΛฒྻ࣮ߦʢࢢ৔ௐࠪɾϏδωεઓུɾ๏຿ɾMVPఆٛʣ ☐ ౷߹ϓϩδΣΫταϚϦʔͷ࡞੒
  12. Example (Project Summary P1) ⏺ ࠷ޙʹɺ͢΂ͯͷ෼ੳ݁ՌΛ౷߹ͨ͠ϓϩδΣΫταϚϦʔΛ࡞੒͠·͢ɻ ⏺ Write(project-summary.md) 㽾 Wrote

    123 lines to project-summary.md # ϘϧμϦϯά࿅शࢧԉΞϓϦ ϓϩδΣΫταϚϦʔ ## ΤάθΫςΟϒαϚϦʔ ຊϓϩδΣΫτ͸ɺϘϧμϦϯάѪ޷Ո޲͚ͷϞόΠϧΞϓϦέʔγϣϯ։ൃΛ໨తͱ͍ͯ͠·͢ɻʮ**δϜͷนΛࡱӨ͢Δ͚ͩͰɺ Ͳͷϗʔϧυ͕՝୊ͳͷ͔ͻͱ໨Ͱ෼͔Δ**ʯͱ͍͏໌֬ͳՁ஋ఏҊʹΑΓɺॳ৺ऀ͔Βதڃऀ·Ͱͷ෯޿͍ΫϥΠϚʔͷ࿅शମݧΛֵ৽͠·͢ɻ ### ! Ϗδϣϯ **ࣨ಺ϘϧμϦϯάʹ͓͚ΔੈքॳͷAI׆༻ܕϧʔτՄࢹԽΞϓϦ**ͱͯ͠ɺ೔ຊࢢ৔ͰͷϦʔμʔϙδγϣϯཱ֬Λ໨ࢦ͠·͢ɻ ### " ࢢ৔ػձ … +113 lines (ctrl+r to expand) ⏺ Update Todos 㽾 ☒ ϑΣʔζ1: product-managerΤʔδΣϯτͰཁ݅෼ੳ ☒ ϑΣʔζ1: requirements-definitionίϚϯυͰཁ݅ఆٛॻ࡞੒ ☒ ϑΣʔζ2: 4ͭͷΤʔδΣϯτΛฒྻ࣮ߦʢࢢ৔ௐࠪɾϏδωεઓུɾ๏຿ɾMVPఆٛʣ ☒ ౷߹ϓϩδΣΫταϚϦʔͷ࡞੒
  13. Example (Project Summary P2) ⏺ ! ϓϩδΣΫτ্ཱͪ͛׬ྃ ϘϧμϦϯά࿅शࢧԉΞϓϦͷϓϩδΣΫτ্ཱ͕ͪ͛׬ྃ͠·ͨ͠ʂ " ࡞੒͞Εͨ੒Ռ෺

    1. ཁ݅෼ੳɾఆٛ - ϘϧμϦϯά࿅शࢧԉΞϓϦཁ݅෼ੳॻ.md - requirements.md 2. ઓུ෼ੳϨϙʔτ - market-analysis.md - ࢢ৔෼ੳʢڝ߹ɺࢢ৔ن໛ɺλʔήοτʣ - business-strategy.md - ϏδωεઓུʢऩӹϞσϧɺ3೥ܭըʣ - legal-requirements.md - ๏తཁ݅ʢίϯϓϥΠΞϯεɺϦεΫʣ - mvp-specification.md - MVP࢓༷ʢ12िؒ։ൃܭըʣ 3. ౷߹จॻ - project-summary.md - ϓϩδΣΫτ૯ׅ
  14. Example (Project Summary P3) ! ओཁϙΠϯτ - Ձ஋ఏҊ: ʮࡱӨ͢Δ͚ͩͰϧʔτ͕෼͔ΔʯγϯϓϧͳUX -

    ࢢ৔ن໛: $98.46M → $169.27Mʢ೥཰9.4%੒௕ʣ - ऩӹ༧ଌ: 3೥ؒͰ¥193,884,820 - ։ൃظؒ: 12िؒͰMVPϦϦʔε - ٕज़બ୒: FlutterʢΫϩεϓϥοτϑΥʔϜ։ൃʣ ⏭ ࣍ͷεςοϓ 1. ։ൃνʔϜฤ੒ʢFlutter։ൃऀ2໊ɺσβΠφʔ1໊ʣ 2. ύʔτφʔδϜબఆʢ3-5δϜʣ 3. ϓϩτλΠϓ։ൃ։࢝ 4. ๏຿४උʢར༻ن໿ࡦఆʣ ϓϩδΣΫτͷৄࡉ͸project-summary.mdΛ֬͝ೝ͍ͩ͘͞ɻ
  15. Next • Use Codex CLI (GPT-5) from sub agent •

    Improve subsequent processes and overall quality • Organize your operational flow by actually using it
  16. EOF