AI Coding Tool Selection
This course uses Claude Code as the primary recommended tool, but most labs can also be completed with the alternative tools listed below.
Tool Comparison
Section titled “Tool Comparison”| Item | Claude Code | Gemini CLI | Codex CLI | OpenCode |
|---|---|---|---|---|
| Vendor | Anthropic | OpenAI | Community (open-source) | |
| Install | pnpm add -g @anthropic-ai/claude-code | pnpm add -g @google/gemini-cli | pnpm add -g @openai/codex | brew install opencode |
| Run | claude "prompt" | gemini (interactive) | codex "prompt" | opencode (TUI) |
| Headless | claude --print --no-color | pipe support | codex --approval-mode full-auto | opencode serve (API) |
| MCP Support | Full | Supported | Not supported | Limited |
| Project Instruction File | CLAUDE.md | GEMINI.md | AGENTS.md | — |
| Context Window | 200K | 1M | 192K | Model-dependent |
| Cost | API key required | Free (1,000 req/day) | ChatGPT Plus or API key | Free (local models available) |
| Sandbox | None | None | Yes (safest) | None |
Installation
Section titled “Installation”pnpm add -g @anthropic-ai/claude-codeclaude --versionpnpm add -g @google/gemini-cligemini --versionpnpm add -g @openai/codexcodex --version# macOSbrew install opencode
# or go installgo install github.com/opencode-ai/opencode@latestAPI Key Setup
Section titled “API Key Setup”# Anthropic API key (https://console.anthropic.com)export ANTHROPIC_API_KEY="sk-ant-..."# Issued from Google AI Studio (https://aistudio.google.com)# On first run, browser OAuth login, or:export GEMINI_API_KEY="..."# OpenAI API key (https://platform.openai.com)export OPENAI_API_KEY="sk-..."# Set based on your chosen model provider# For OpenAI models:export OPENAI_API_KEY="sk-..."# For local models (Ollama, etc.) no key is neededHeadless Mode (for Ralph Loop)
Section titled “Headless Mode (for Ralph Loop)”When running a CLI non-interactively inside a Ralph Loop, the commands differ by tool.
claude --print --no-color --dangerously-skip-permissions "$(cat PROMPT.md)"cat PROMPT.md | geminicodex --approval-mode full-auto "$(cat PROMPT.md)"# Start in API server mode, then call via curlopencode serve &curl -X POST http://localhost:3000/api/chat \ -d "{\"message\": \"$(cat PROMPT.md)\"}"Project Instruction Files
Section titled “Project Instruction Files”Each tool reads a specific file in the project root to pass project-specific instructions to the agent.
| Tool | File | Location |
|---|---|---|
| Claude Code | CLAUDE.md | Project root |
| Gemini CLI | GEMINI.md | Project root |
| Codex CLI | AGENTS.md | Project root |
| OpenCode | — | No dedicated file |
Tool Abstraction via Environment Variables
Section titled “Tool Abstraction via Environment Variables”When writing scripts that need to support multiple tools, you can use an environment variable pattern.
# Select tool via environment variableexport AI_CLI="${AI_CLI:-claude}" # default: claude
# Example usage in harness.shcase "$AI_CLI" in claude) claude --print --no-color --dangerously-skip-permissions "$(cat PROMPT.md)" ;; gemini) cat PROMPT.md | gemini ;; codex) codex --approval-mode full-auto "$(cat PROMPT.md)" ;; *) echo "Unsupported tool: $AI_CLI" && exit 1 ;;esac