π―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
π€ 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:
Key concepts
Iterative Reason + Act
Bash, Edit, Read, Web, MCP
Allow/deny/ask by tool
Harness events
π 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:
π‘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
Global β project β subdir
Everything goes into the system prompt
Specific beats generic
Watch out for inflation
π .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
. at the beginning = hidden
Right Name, Right Folder
.codex vs .agents
Commit the skill, ignore local files
π§© 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
SKILL.md β alwaysname e description in YAMLscripts/, 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-toolsin 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
Canonical file
name + description
Activation by description
Specific metadata
π₯ 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
Claude reads the description and decides
Codex requires a name
Separate context
Multiple at once
π 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
π· 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
MCP is a spec, not proprietary
Separate process
Two transports
Naming convention
π―Module summary
Next module:
1.2 β Why use both together (complementarity, redundancy, tool-agnostic)