Ravindra BagaleCourses & study guides Track your progress

Guides · Generative AI

OpenAI Codex vs Claude Code for Beginners: Plans, Install and First Task

Both are coding agents that read your project, edit files and run commands after you approve. As of 25 October 2026, OpenAI says Codex is included with ChatGPT plans, with limited use on Free and Go. Claude Code needs a paid Claude plan (Pro or higher) or API billing. Install Codex CLI with npm i -g @openai/codex and Claude Code with Anthropic’s official installer. Start in a practice folder under git so you can undo anything.

Suppose Arjun, a BCA student in Indore, has ChatGPT Go, and Emma, a developer in Leeds, has Claude Pro. Each makes a tiny practice project, asks the agent to add one function with a test, reads the diff, and only then commits.

Related pages

See also AGENTS.md vs CLAUDE.md vs Cursor Rules, and Claude Code Hooks Examples.

What you will learn in this guide

  • What a coding agent does
  • Plans each one needs
  • Install both CLIs
  • A safe first task
  • Review with git diff

1. Why: agents do more than autocomplete

Chat answers give you code to paste. Agents edit files and run tests for you. That saves time but can also break things, so you need a safe habit from day one.

2. What: side-by-side

Point Codex vs Claude Code
Maker OpenAI vs Anthropic
Plan Codex: ChatGPT plans, limited on Free/Go. Claude Code: Pro or higher
Where Both: terminal CLI, IDE extensions, web/app
Project notes file Codex reads AGENTS.md; Claude Code reads CLAUDE.md
Safety Both ask before risky actions; use git
First agent task in five steps Steps from top to bottom: 1 Make a practice folder, git init; 2 Install the CLI, Official command; 3 Ask one small task, Function plus test; 4 Read the diff, git diff; 5 Commit or undo, git restore. 1Make a practice foldergit init 2Install the CLIOfficial command 3Ask one small taskFunction plus test 4Read the diffgit diff 5Commit or undogit restore

Figure 1. First coding-agent task in five steps: practice folder, install, one small task, read the diff, commit or undo.

3. How: install and try

  1. Install Node.js LTS (for Codex) and git.
  2. Codex: run npm i -g @openai/codex, then codex, and sign in with ChatGPT.
  3. Claude Code: follow the install command on code.claude.com docs, then run claude and log in.
  4. In a practice folder, give one small task.
  5. Run git diff, run the tests, then commit or undo.

4. Plan facts (25 Oct 2026)

  • OpenAI Help: Codex is included in ChatGPT plans; Free and Go have limited access.
  • Anthropic: Claude Code is included with Pro, Max, Team and Enterprise, or via API (Console) billing.
  • Limits change; check each pricing page.

5. Worked example 1: practice project (start here)

Create a tiny Python project:

mkdir agent-practice && cd agent-practice
git init
printf "def add(a, b):\n    return a + b\n" > calc.py
git add . && git commit -m "start"

Expected output (yours will be similar, not the same):

Initialized empty Git repository in .../agent-practice/.git/
[main (root-commit) 1a2b3c4] start
 1 file changed, 2 insertions(+)

6. Worked example 2: one small task

Start codex or claude in the folder and type:

Add a function multiply(a, b) to calc.py and a file test_calc.py
with pytest tests for add and multiply. Do not change anything else.
Then run the tests.

Expected output (yours will be similar, not the same):

The agent shows the new code, asks to run pytest, and reports "2 passed".

7. Worked example 3: review and undo

Before you commit:

git status
git diff
# keep it:
git add . && git commit -m "multiply + tests"
# or throw it away:
# git restore . && git clean -fd

Expected output (yours will be similar, not the same):

modified:   calc.py
Untracked files: test_calc.py
(then the diff lines starting with + )

Names, amounts and companies in the examples are made up for practice.

8. Common mistakes

Mistake Risk Fix
Running in your home folder Wrong files edited Use a project folder
No git Cannot undo git init first
Approving every command blindly Data loss Read before approving
Pasting API keys into chat Leak Use env vars
Huge first task Messy changes One small task

9. Try at home

Try at home

  1. Create the practice repo.
  2. Ask for multiply with tests.
  3. Read git diff before committing.

Recap

In short

  1. Both are coding agents that edit and run.
  2. Codex: ChatGPT plans, limited on Free/Go.
  3. Claude Code: Pro or higher, or API.
  4. Always work under git.
  5. Read the diff, then commit.

Small task, read the diff, then commit.

Frequently asked questions

Is Codex free?

OpenAI lists limited Codex access on ChatGPT Free and Go; paid plans get more. Check OpenAI Help.

Is Claude Code free?

No. It needs Pro or higher, or API billing.

Which is better?

Both are strong. Pick the one your plan already includes and learn safe habits.

Does it work on Windows?

Both support Windows; WSL can make tooling smoother. Check the official docs.

Related: Set Up ChatGPT Codex in VS Code