Two years ago, AI help meant copying code out of a chat window. Today you can type one sentence in a terminal and watch an agent read your project, edit a dozen files, run the tests, read the failures and fix them. This article explains how that works, then compares the main tools side by side.
Checked on 30 September 2026 against each tool's documentation. Commands and features change fast, so use the linked docs for the latest.
What is "agent mode"?
A chatbot answers. An agent acts in a loop:
- Observe: read the goal and the current state (your files, test output).
- Decide: the model chooses an action, such as "open this file" or "run the tests".
- Act: the tool carries it out on your machine.
- Check: the result goes back to the model, which decides the next step.
- Stop when the goal is met, or when it needs your approval.
The model is the brain. The harness (the program around it) provides the hands: file reading and editing, a shell, search, web access, and connections to other tools. Agent mode is simply the harness running this loop for you.
Why the command line?
A CLI (command-line interface) is a program you run by typing. It turns out to be an excellent home for agents:
- Scriptable. You can pipe output into it and chain it with other programs.
tail -200 app.log | claude -p "flag any anomalies"is one line. - Headless. The same agent can run on a server or in a CI pipeline with no screen, reviewing every pull request automatically.
- Universal. It works over SSH, inside containers, and alongside any editor.
- Transparent. You see each command it runs.
An IDE agent is better for reviewing diffs visually. A CLI agent is better for automation and for people who already live in the terminal. Most tools now offer both.
The five compared
| Claude Code | Codex CLI | Gemini CLI | Cursor | Antigravity | |
|---|---|---|---|---|---|
| By | Anthropic | OpenAI | Cursor | ||
| Open source | no (proprietary) | yes (Apache 2.0) | yes (Apache 2.0) | no (proprietary) | not stated |
| Models | Claude family | OpenAI models | Gemini | many companies, plus Composer | Gemini, see note |
| Surfaces | terminal, VS Code, JetBrains, desktop, web | terminal, IDE extension, desktop, cloud | terminal | editor, CLI, cloud agents, Agents Window | command center, IDE, CLI, SDK |
| Sign in | Claude plan or API key | ChatGPT plan or API key | Google login, API key or Vertex | Cursor plan | Google account |
| Project memory file | CLAUDE.md | AGENTS.md | GEMINI.md | rules files | configuration in the app |
| Install | curl -fsSL https://claude.ai/install.sh | bash | npm install -g @openai/codex | npx @google/gemini-cli | curl https://cursor.com/install -fsS | bash | download the app |
Note on Antigravity: its official page lists Gemini models, while other coverage reports that the model menu has included models from other companies at times. Check its current page.
What they all share
Project memory. A plain text file in your repository tells the agent your conventions: how to run tests, which style to follow, what never to touch. Claude Code reads CLAUDE.md, Gemini CLI reads GEMINI.md, and Codex and several others read AGENTS.md, an increasingly common shared convention. Writing a good one is the best investment you can make in any agent.
Permissions. Agents can do real damage, so they ask before risky steps. Typical controls are read-only or plan modes (propose, but do not change anything), ask-before-running modes, and broader automatic modes for trusted tasks. Start conservative and loosen only when you trust the pattern.
Plan first. Asking the agent to write a plan and waiting for your approval before it edits anything catches most misunderstandings cheaply.
MCP, the Model Context Protocol. An open standard for plugging tools into agents: your issue tracker, a database, design files, chat. It is supported by Claude Code, Gemini CLI, Cursor and others.
Headless mode. Every tool can run without a human: Claude Code with claude -p, Cursor's headless CLI in GitHub Actions, and so on. This is how teams automate reviews, triage and migrations.
Parallel agents. The newest idea: run several agents at once on separate tasks. Claude Code has subagents and background agents, Cursor has its Agents Window and cloud agents, and Antigravity's whole design is a manager that supervises multiple agents.
What makes each one distinctive
- Claude Code: the deepest toolbox around a single model family: skills, hooks, subagents, routines that run on a schedule in the cloud, and a web and mobile version you can start from anywhere.
- Codex CLI: open source, with a strong link to ChatGPT, so your plan usage follows you from chat to terminal to cloud.
- Gemini CLI: the lowest barrier to try, since a Google login gives a free allowance, plus a very long context window.
- Cursor: the most polished visual experience and the freedom to switch models in one place.
- Antigravity: the clearest "manager of agents" interface, free for individuals.
Safety habits for any agent
- Use version control. Commit before you let an agent loose so you can undo anything.
- Work in a branch or a sandbox for big changes.
- Read every diff before accepting.
- Keep secrets out of reach. Do not give an agent broad access to files containing keys, and never commit an API key.
- Tell it how to verify. "Run the tests and make them pass" turns a guess into a checked result.
- Watch the bill. Agents can make many model calls. On subscriptions you hit a usage window. On API keys you pay per token, so set a spending cap.
What can you do with them?
- Fix a bug from a pasted error, with a proof that the tests now pass.
- Write tests for old untested code.
- Migrate a codebase to a new library version.
- Review every pull request in CI and leave comments.
- Summarise logs each morning and alert you on anomalies.
- Learn an unfamiliar project: "explain how requests flow through this codebase".
Try it yourself
Pick one, and give it a small, real task in a throwaway project. The fastest way to understand an agent is to watch one fail and recover. Then read the pricing article, API versus subscription, so you know what that experiment costs.
Links
- Claude Code: code.claude.com/docs/en/overview
- Codex: developers.openai.com/codex and github.com/openai/codex
- Gemini CLI: github.com/google-gemini/gemini-cli
- Cursor CLI: cursor.com/cli
- Antigravity: antigravity.google