PTENES
MODULE 1.1

🧭 Mind map β€” Claude Code vs Codex

Same race, different track rules. Before installing anything, align the vocabulary and anatomy of the two agents.

6
Topics
30
Minutes
Basic
Level
Theory
Type

🎯What you get in this module

Leave knowing what each piece (CLAUDE.md, AGENTS.md, skills, sub-agents, MCP) means in each runtime. You’ll never be lost reading the docs for one without a mental reference for the other.

Detailed content

1

πŸ€– What a coding agent is (and what it ISN'T)

A coding agent is a LLM that runs an autonomous loop: reads code, plans an action, edits files, runs commands in the terminal, observes the result, and decides the next step β€” all without you dictating every move. It's not autocomplete or a chatbot. It's an iterative collaborator.

βœ“ Is a coding agent

  • βœ“Carries out a task end to end (read, plan, act, review)
  • βœ“Has access to tools (shell, file edit, web, MCP)
  • βœ“Maintains session context and iterates
  • βœ“You can delegate to specialized sub-agents
  • βœ“Runs event hooks (PreToolUse, Stop, etc.)

βœ— Is not a coding agent

  • βœ—Autocomplete (Copilot inline) β€” suggests a line
  • βœ—Pure chatbot (standard ChatGPT) β€” no tools
  • βœ—Linter/formatter β€” static rule
  • βœ—Snippet expander β€” fixed template
  • βœ—Code search β€” queries only, takes no action

πŸ”¬The ReAct loop (Reason + Act)

It’s the engine behind any coding agent. It runs in short cycles:

1. Observe β€” read the message, available tools, and context
2. Think β€” what’s the next action that will bring you closer to the goal?
3. Act β€” execute the action (read file, run bash, edit, etc.)
4. Observe β€” action result. Return to step 2 or stop.

Key concepts

ReAct loop
Iterative Reason + Act
Tool use
Bash, Edit, Read, Web, MCP
Permissions
Allow/deny/ask by tool
Hooks
Harness events
2

πŸ“˜ CLAUDE.md vs AGENTS.md β€” the β€œproject system prompt”

Both agents read a Markdown file at the project root in start of every session and inject into the system prompt. Same function, two names:

Aspect
Claude Code
Codex
File in the root
CLAUDE.md
AGENTS.md
Global version
~/.claude/CLAUDE.md
~/.codex/AGENTS.md
Per-folder version
βœ“ Yes, concatenated
βœ“ Yes, similar
Dynamic injection (backtick-bang)
βœ“ Supports
βœ— Does not support
Ideal size
~2-3 KB
~1-2 KB (more conservative)

πŸ’‘Practical tip

Keep CLAUDE.md/AGENTS.md focused on 3 things:

  • Build/test/lint commands at the top (literal format for copying)
  • Non-obvious code conventions (don’t repeat what the linter already enforces)
  • Links to in-depth internal docs (ADRs, runbooks)

Key concepts

Hierarchy
Global β†’ project β†’ subdir
Concatenation
Everything goes into the system prompt
Precedence
Specific beats generic
Size
Watch out for inflation
3

πŸ“ .claude/ vs .codex/ vs .agents/ β€” the anatomy

Hidden folder in the project where the agent customization lives. Claude uses a single folder. Codex uses two folders with separate responsibilities. This is the most important structural difference:

Claude Code β€” a single folder

.claude/
β”œβ”€β”€ CLAUDE.md            ← tambΓ©m pode ficar na raiz
β”œβ”€β”€ settings.json        ← permissΓ΅es, modelo, env, hooks
β”œβ”€β”€ settings.local.json  ← override local (.gitignore)
β”œβ”€β”€ agents/              ← sub-agents em Markdown
β”‚   β”œβ”€β”€ code-reviewer.md
β”‚   └── doc-writer.md
β”œβ”€β”€ skills/              ← skills auto-invocΓ‘veis
β”‚   └── my-skill/
β”‚       β”œβ”€β”€ SKILL.md
β”‚       β”œβ”€β”€ scripts/
β”‚       └── references/
β”œβ”€β”€ commands/            ← slash commands
β”‚   └── review.md
└── hooks/               ← scripts de evento

Codex β€” two folders, distinct responsibilities

.codex/                  ← config especΓ­fica do Codex
β”œβ”€β”€ config.toml          ← settings em TOML
β”œβ”€β”€ agents/              ← sub-agents em TOML
β”‚   β”œβ”€β”€ code-reviewer.toml
β”‚   └── doc-writer.toml
└── commands/            ← slash commands especΓ­ficos

.agents/                 ← spec ABERTA (compartilhada)
└── skills/
    └── my-skill/
        β”œβ”€β”€ SKILL.md
        β”œβ”€β”€ agents/openai.yaml  ← sidecar Codex
        β”œβ”€β”€ scripts/
        └── references/

AGENTS.md                ← na raiz, system prompt do projeto

⚠️Migration pitfall #1

People coming from Claude put the skill in .codex/skills/ thinking it’s the direct equivalent of .claude/skills/. Wrong. Codex skill lives in .agents/skills/ β€” because .agents/ is the convention used by the open Agent Skills spec, and Codex follows it.

Key concepts

Hidden folder
. at the beginning = hidden
Convention
Right Name, Right Folder
Config Γ— extension separation
.codex vs .agents
Partial gitignore
Commit the skill, ignore local files
4

🧩 Skills β€” the shared concept, with small differences

A skill is a "packaged expertise": folder with SKILL.md + YAML frontmatter + Markdown body + conventional folders. Both runtimes implement the Agent Skills standard (agentskills.io), so the core is portable. Where they differ:

The 4 pillars that ALWAYS match

1
File Name SKILL.md β€” always
2
Frontmatter fields name e description in YAML
3
Body in standard Markdown
4
Folder conventions scripts/, references/, assets/

Minimal SKILL.md

---
name: minha-skill
description: Use when you need to process X. Common triggers: "process X", "clean up Y".
---

# My Skill

Markdown instructions explaining how to perform the task.

You can reference relative files: see `references/exemplo.md` for more details.

πŸ”· Claude Code adds

  • β€’ allowed-tools in frontmatter
  • β€’ disable-model-invocation (explicit opt-in)
  • β€’ Dynamic injection with `!comando` (backtick-bang)
  • β€’ Automatic invocation by description
  • β€’ Slash: /nome-skill

🟣 Codex adds

  • β€’ Sidecar agents/openai.yaml (branding, MCP)
  • β€’ Hidden ~8K-character limit on description
  • β€’ No native dynamic injection (use fallback prose)
  • β€’ Automatic invocation by description (also)
  • β€’ Dollar: $nome-skill

🦜This is exactly where polyskill comes in

You write ONE skill in the portable format. polyskill generates two versions: one with Claude’s conventions, the other with Codex’s conventions (including the sidecar and description adjustment). See the Track 5 for details.

Key concepts

SKILL.md
Canonical file
YAML frontmatter
name + description
Semantic match
Activation by description
Sidecar
Specific metadata
5

πŸ‘₯ Sub-agents β€” two opposing philosophies

A sub-agent is a "specialized persona" that the main agent can delegate tasks. This is where the trickiest difference between Claude Code and Codex lies β€” it catches almost everyone who migrates:

πŸ”·

Claude Code β€” automatic invocation

Markdown format in .claude/agents/. The main agent READS the description and decides whether to delegate, on its own.

You write a description rich in triggers ("Use proactively when..."), and the main Claude agent discovers the sub-agent when the context matches. You can run several in parallel via the Task tool.

🟣

Codex β€” explicit invocation

TOML format in .codex/agents/. You HAVE to call it by name in the prompt.

Description helps you remember, but it doesn’t trigger automatically. β€œUse the agent code-reviewer to review X” β€” without that, it won’t run. Trade-off: more predictable, less ergonomic.

🚨The #1 mistake people make when migrating from Claude β†’ Codex

Copy the sub-agent, translate it to TOML, and expect it to run on its own like it does in Claude. Doesn't trigger. You spend hours thinking "it’s broken"β€”it isn’t. Codex requires explicit invocation by design.

Key concepts

Auto-dispatch
Claude reads the description and decides
Explicit call
Codex requires a name
Isolation
Separate context
Parallelism
Multiple at once
6

πŸ”Œ MCP β€” the protocol they both speak

Model Context Protocol (MCP) is the common denominator of the stack. An open standard for connecting LLMs to external tools (Slack, Gmail, GitHub, databases). An MCP server runs as an independent process β€” Claude and Codex speak the same protocol.

The MCP architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Code │────┐ β”‚ MCP Server β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ (slack-api) β”‚
β”œβ”€β”€β†’ β”‚ β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ Exposes tools β”‚
β”‚ Codex CLI β”‚β”€β”€β”€β”€β”˜ β”‚ via stdio β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Both clients use the SAME server.
Server is independent, declared in the client config.

πŸ”· Declaration in Claude Code

// .mcp.json
{
  "mcpServers": {
    "slack": {
      "command": "npx",
      "args": ["-y", "@mcp/slack"],
      "env": { "TOKEN": "$SLACK_TOKEN" }
    }
  }
}

🟣 Declaration in Codex

# config.toml
[mcp_servers.slack]
command = "npx"
args = ["-y", "@mcp/slack"]

[mcp_servers.slack.env]
TOKEN = "${SLACK_TOKEN}"

πŸ’‘The good news

Configured an MCP server once? Both runtimes can use it. Only the declaration format changes (JSONΓ—TOML). Server, env, exposed tools β€” all the same. This is the part of the stack that survives the MOST across runtimes.

Key concepts

Open standard
MCP is a spec, not proprietary
Independent server
Separate process
stdio vs HTTP
Two transports
mcp__server__tool
Naming convention

🎯Module summary

βœ“
Coding agent = ReAct loop β€” it's not autocomplete, it's not a chatbot. It's an iterative collaborator.
βœ“
CLAUDE.md ≑ AGENTS.md β€” same function, two names. Global β†’ project β†’ subdirectory hierarchy.
βœ“
.claude/ one folder; .codex/ + .agents/ two β€” Codex separates proprietary config from the open spec.
βœ“
Skills = SKILL.md + YAML + body β€” 4 shared pillars; the rest is runtime-specific.
βœ“
Sub-agents: Claude invokes automatically, Codex requires a name β€” migration mistake #1.
βœ“
MCP is the common denominator β€” the server is independent; only the declaration changes.

Next module:

1.2 β€” Why use both together (complementarity, redundancy, tool-agnostic)