AI × Tools & Tips

Tools · Setup guide

Claude Code & Codex

Two terminal coding agents that read your repo, write code, run commands, and open PRs. Claude Code (Anthropic) and Codex CLI (OpenAI) do broadly the same job — most people install both and switch depending on which model they want on a task.

Claude Code & Codex

Before you start

Set it up

Claude Code

  1. Install it. The native installer is the recommended path and auto-updates in the background.

    macOS, Linux, WSL:

    bash
    curl -fsSL https://claude.ai/install.sh | bash

    Windows PowerShell:

    powershell
    irm https://claude.ai/install.ps1 | iex

    Homebrew (does not auto-update — you run brew upgrade yourself):

    bash
    brew install --cask claude-code
  2. Confirm it installed.

    bash
    claude --version

    Verified output on this machine:

    terminal
    2.1.220 (Claude Code)
  3. Start a session from inside the project you want to work on.

    bash
    cd ~/your-project
    claude
  4. Log in. On first run it opens a browser prompt — follow it. If you already have ANTHROPIC_API_KEY set in your shell, Claude Code asks once to approve that key instead of opening a browser.

  5. If anything looks off, run the diagnostics. It prints read-only install/settings health without starting a session.

    bash
    claude doctor

Codex CLI

  1. Install it. Pick one:

    bash
    npm install -g @openai/codex
    bash
    brew install --cask codex

    macOS/Linux standalone:

    bash
    curl -fsSL https://chatgpt.com/codex/install.sh | sh

    Windows standalone:

    powershell
    powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
  2. Confirm it installed.

    bash
    codex --version

    Verified output on this machine:

    terminal
    codex-cli 0.145.0
  3. Start a session from your project directory.

    bash
    cd ~/your-project
    codex
  4. Sign in. On first launch choose Sign in with ChatGPT to use your existing plan. (API-key auth is the alternative and needs extra config.)

  5. Config lives at ~/.codex/config.toml. You don't need to touch it to get started.

Useful once you're running

Claude Code Codex CLI What it does
claude --version codex --version Version check
claude doctor codex doctor Diagnose install/auth/config
claude update codex update Update now instead of waiting
claude -p "…" codex exec "…" Run non-interactively (scripts, CI)
/model /model Switch model / reasoning effort
codex resume --last Reopen your previous session
codex review Non-interactive code review
claude mcp add … codex mcp add … Attach an MCP server

What success looks like

Verified vs not

Verified: claude --version2.1.220 (Claude Code); codex --versioncodex-cli 0.145.0; codex --help (subcommand list above is copied from real output); ~/.codex/config.toml exists on disk. Install commands are quoted verbatim from the official setup pages, not run — both tools were already installed and reinstalling would have been destructive.

Not simulated: the login/auth flows for either tool (they're interactive browser handoffs tied to a personal account, and the machine was already authenticated). Windows and Linux install paths are quoted from official docs, not executed — this was macOS.

Go deeper