← All articles

Comparing Claude Code, Codex CLI, Gemini CLI, and Aider

Hands-on comparison · August 2026

All four tools live in the terminal, read code, and make edits. Their differences become clearer after a week or two of real work, especially in how they gather context, handle permissions, and help you recover from a bad edit.

How they gather context

Aider asks you to add files to the session. It builds a repository map and works with the files you provide. This keeps token use predictable and relatively low, provided you already know which files matter.

Claude Code and Codex CLI explore the project themselves. They search the repository, read files, and browse directories to work out what they need. That helps in an unfamiliar codebase. The initial exploration also costs time and tokens, even when the eventual change is only one line.

Gemini CLI leans on a large context window, so it can take in more complete files at once. Once a project exceeds that window, it faces the same problem of selecting the relevant parts.

How they apply edits

How a tool records changes often matters more than how good its first draft is. Automatic commits give you a clear rollback point. With a tool that leaves commits to you, create a checkpoint before each substantial step.

Permissions and safety

All four can run shell commands. The permission models vary from manual approval for actions to prompts only for writes, network-restricted sandboxes, and allowlists that you maintain yourself.

Commit work you want to keep before granting broad permissions. The agent focuses on the task it was given and may overwrite uncommitted changes you were planning to keep.

Which one to choose

These tools change quickly. Whatever you choose, make sure you can see exactly what the agent did and recover if the edit turns out to be wrong.