What Works, What Doesn't, and How to Master Them
Claude Code
Gemini CLI
OpenAI Codex
A Comprehensive Guide to CLI-Based AI Coding Assistants
The mental shift is crucial. These tools:
Think of them as very fast assistants:
Key insight: You're not treating it like magic — you're delegating to a capable but imperfect assistant.
Before running any CLI command, make sure you're already inside your project folder.
This helps the agent:
This is the single most common mistake new users make. Running from the wrong directory means the agent can't see your code properly!
Each tool has its own convention for project-specific instructions:
| Tool | File Name | Location | Recommended Size |
|---|---|---|---|
| Claude Code | CLAUDE.md | Project root or .claude/ directory | < 200 lines per file |
| Gemini CLI | GEMINI.md | .gemini/ folder | No strict limit |
| Codex CLI | AGENTS.md | Project root | No strict limit |
Pro tip for monorepos: Use multiple CLAUDE.md files with ancestor + descendant loading pattern.
Two Types of Memory:
Key Differences:
This applies to all CLI tools - they all have both global settings and project-specific configurations.
Vague prompts fail across all tools.
All three tools can modify your codebase directly. Git becomes your safety net:
If you're worried about token usage or unintended changes:
Every time you start something new, clear the chat. You don't need all that history eating your tokens.
Do manual /compact at max 50% context usage. Use /clear to reset context mid-session if switching tasks.
Always use:
thinking_mode: trueOutput Style: Explanatoryin /config for better understanding
Use /permissions to allowlist safe commands or /sandbox for OS-level isolation. This reduces interruptions while keeping you in control.
Tell Claude Code to use CLI tools like gh, aws, gcloud, and sentry-cli when interacting with external services. CLI tools are the most context-efficient way to interact with external services.
/rewind was recently enhanced to allow rewinding conversation and code separately — so you can undo a bad refactoring without losing the conversation history.
The claim: "Just send voice messages. It's faster for most people."
But HOW from a computer?
Note: This converts speech to text in your terminal - it's not a literal voice call, but voice-to-text input that Claude Code processes as regular text.
Use @ for explicit context injection rather than relying on memory:
More precise and prevents hallucination
Captures state of working directory. Like time-traveling back before a wrong turn. Keep it on for non-trivial tasks.
Press ! to toggle shell mode. Executes commands locally and feeds output back into conversation context.
Gemini's agent mode is less reliable on complex refactors or deeper reasoning compared to Claude. It excels at speed and iteration, not necessarily deep architectural reasoning.
For most tasks, gpt-5.4 is recommended — combines strong coding, reasoning, native computer use, and broader professional workflows.
| Mode | Command | Use Case |
|---|---|---|
| Read Only | -s read-only |
Audits and analysis |
| Auto | Default | Daily development |
| Full Auto | --full-auto |
Complete automation |
Note: Sandbox blocks network by default — explicitly enable for package installs or API calls.
codex resume launches a picker of recent sessions. Keeps original transcript, plan history, and approvals.
Supports parallel agents on same repository using isolated worktrees — useful for dividing frontend and backend work.
When you need to describe a UI bug, reference a design mockup, or understand web page layout, terminal interfaces don't have the tools to see the change like an IDE does. (Though Codex and Claude Code can accept image input now.)
Checkpointing won't undo external side effects — for example, if the AI ran a database migration, it can't undo that.
You need to know how to navigate directories, set environment variables, and manage API keys. If you aren't comfortable with cd, ls, or chmod, you cannot use these tools effectively.
Cost is the loudest topic on every developer forum.
| Tool | Model | Hourly Cost (Heavy Use) | Monthly Cost (Heavy Users) |
|---|---|---|---|
| Claude Code | Claude Sonnet 4.6 | $3-8/hour | $150-200/month |
| Gemini CLI | Gemini 3 | Free tier available | $0 (within limits) |
| Codex CLI | GPT-5.4 | Varies by model | $100-300/month |
/clear frequently to reset contextMultiple independent benchmarks show that the same model in different agent scaffolding produces very different results.
Break complex refactors into smaller, testable chunks. Use git branches liberally. Review and test each stage before proceeding.
Several experienced users are now running multiple CLI agents simultaneously for different strengths:
Have your local Claude Code control another Claude Code instance running inside a Docker container — fully autonomous, sandboxed, and pulling results back when done.
Perfect for:
Manage your context window actively. Clear often, use project memory files, and work from the right directory.
Always work in version-controlled directories. Review changes before committing.
Vague prompts waste tokens and time. Be precise about what you want.
These tools can't see UI, can't undo external effects, and struggle with complex refactors.
Different tools have different strengths. Use them together for best results.
API usage can add up quickly. Set limits and track spending.
The main bottleneck is learning to think in terms of delegation and context management rather than direct coding. Master these patterns, and you'll multiply your productivity.
Especially powerful for orchestrating taxonomy annotation pipelines, running parallel corpus classification passes, and automating repetitive research tasks.