Gemini CLi vs. Claude Code : The better coding agent

by HarshJul 2, 20253 min read
AI Use Case

Introduction

The Gemini CLI is public, and Google, as usual, is the third entrant to the party. Claude code from Anthropic, Codex from OpenAI, and now, Gemini CLI, finally, the CLI coding agent trifecta is complete.

I have previously compared Claude Code and Codex, and Claude Code came on top, no surprise there. And, I have been a huge fan of them.

I was particularly interested in learning about the quality of the Gemini CLI and how it compares to the revered Claude Code.

So, I started with a decently complex task, building a Python-based CLI agent with tool integrations from Composio, which would require

  • Updated knowledge of the libraries (Composio)

  • Internet Search

  • The coding agent's capability to set up and work with the codebase.

Let's start by looking at the prompt (single-shot PRD).

Check this out, if you're interested in Claude Code and Codex.

TL; DR

If you've somewhere else to be, here's a summary.

  • Overview: Compared Claude Code vs Gemini CLI using the same PRD to build an agentic CLI tool. The Claude Code is hands down better in all the departments. On the other hand, Gemini CLI needs many improvements.

  • Gemini CLI in headless mode: To make the Gemini CLI work, I added instructions to CLAUDE.md to have Claude use the Gemini CLI in non-interactive mode (by passing the -p parameter with a prompt to receive a response from the CLI).

  • Speed: Claude finished faster (1h17m) with full autonomy, while Gemini needed manual nudging and retries.

  • Cost: Claude cost $4.80 with smooth execution; Gemini’s fragmented attempts pushed the cost to $7.06.

  • Token Usage: Claude used fewer tokens efficiently with auto-compaction; Gemini consumed more without optimisation.

  • Code Quality & UX: Claude delivered a cleaner structure and smoother UX; Gemini was decent but less polished overall.

Prompt

The task here is to create a Python-based CLI agent that can connect to external tools (File tools, Search tool, and Notion) via a mix of local and managed Composio MCP servers

The prompt is the same for both Claude Code & Gemini CLI. Check it out here. (basic prompt + some gemini 2.5 magic :)

The important part in a prompt is to give a clear set of instructions to the prompt, which is achieved by providing:

  • Objective - Overall goal

  • Core Technology - docs, resources & target audience

  • Project Specifications - HLL overview of the project.

  • Folder Structure (critical)

  • Toolset Definition - what all tools are required, and an explanation

  • Key Features - most important features

  • Development Milestones - break the project into parts, build separately, and merge them while being coordinated

  • Deliverables: What agents need to provide back to the user.

Here is a snapshot of the final product that has been built.

Claude Code Built

Gemini CLI Build

However, as this is a battle of wits, I would like to address a few factors so you can make a more informed choice.

H
AuthorHarsh

Share