Exercise: Your First Agent Session
Hands-on exercise comparing Claude Code and Codex
Objective
Set up both Claude Code and Codex, then use each to add a simple feature to a small CLI tool. Compare how each agent approaches the same task.
Exercise Repository: cowsay A JavaScript implementation of the classic talking cow generator.
Setup
- Clone the repository:
git clone https://github.com/piuccio/cowsay.git cd cowsay npm install - Verify the installation works:
npx cowsay "Hello, world!"
Task
Add a new command-line flag --shout that converts the input text to uppercase before displaying it.
Expected behavior:
npx cowsay --shout "hello world"Should output the cow saying "HELLO WORLD" instead of "hello world".
Part 1: Using Claude Code
- Open a terminal in the
cowsaydirectory - Start Claude Code:
claude - Ask Claude Code to add the
--shoutflag - Observe how the agent explores the codebase
- Review the changes before accepting
- Test the feature
Record which files Claude Code examined, whether it asked clarifying questions, and how it approached the implementation.
Part 2: Using Codex
- Open a new terminal in the same directory (or reset changes first see Troubleshooting)
- Start Codex:
codex - Give Codex the same task
- Observe how Codex approaches the implementation
- Review and test the changes
Note any differences in approach, file exploration, or implementation strategy.
Success Criteria
- Both tools are installed and authenticated
- The
--shoutflag works correctly with both implementations - You can articulate at least one difference in how each tool approached the task
Reflection Questions
- Exploration Which tool explored more of the codebase before making changes?
- Clarification Did either tool ask clarifying questions, or did both proceed directly?
- Implementation How did the implementations differ (if at all)?
- Workflow Which workflow felt more natural for this type of task?
Troubleshooting
Ensure installation completed with claude --version. Run curl -fsSL https://claude.ai/install.sh | bash if needed.
Install with npm install -g @openai/codex or brew install codex.
Both tools require API keys or subscription authentication. Run /status in Claude Code or check Codex configuration.
To compare implementations fairly, reset changes between tools:
git checkout .
git clean -fd