Codex Learning Roadmap: From CLI Fundamentals to Skills, MCP, and Subagents in Engineering Practice

This article lays out an efficient learning path for Codex, with a strong focus on stable usage, configuration constraints, capability expansion, and building a durable working system. It addresses the common pain point of “being able to chat, but not collaborate on engineering work,” and provides a practical progression from the CLI to Skills, MCP, and Subagents. Keywords: Codex, MCP, Subagents.

Technical Specifications Snapshot

Parameter Details
Topic Codex Learning Roadmap
Primary Interfaces CLI, IDE Extension, Cloud
Key Protocol MCP (Model Context Protocol)
Core Capabilities Prompting, AGENTS.md, Rules, Hooks, Skills, Subagents
Language Environment Primarily Shell, Markdown, and configuration files
Core Dependencies Codex CLI, config.toml, AGENTS.md, MCP Server
Reference Sources OpenAI Developers, Cookbook, community repositories
Community Activity The original article did not provide a star count; active maintenance exists in community-maintained repositories

This roadmap emphasizes mastering stable usage before combining advanced capabilities

The value of this roadmap is not that it lists documents. Its real value is that it provides a learning sequence. The core principle is simple: first understand Codex as a development agent with tools, then gradually learn constraints, reuse, external context integration, and parallel collaboration.

Many developers get stuck because they study advanced features too early without first developing a stable way to express tasks. The result is prompt drift, context contamination, and non-reproducible execution.

The recommended primary progression is straightforward

Usage -> Prompting/Workflow -> Configuration -> AGENTS/Rules/Hooks -> Skill -> MCP -> Subagents -> Automation/SDK

The purpose of this sequence is to ensure that each layer builds on the stability of the previous one.

The first stage should complete the basic operational loop

In the first stage, do only three things: start sessions, read and modify code, and run commands. You need to become familiar with the CLI, slash commands, session resume, and branching a task from the current context, rather than treating Codex like a general-purpose chatbot.

Practice three kinds of tasks directly in a small repository you already know well: explain a piece of code, fix a small bug, and add a test. This is the fastest way to build the right mental model of agent-driven execution.

codex /init        # Initialize a session
codex /resume      # Resume a previous session
codex /fork        # Fork a task from the current context

The purpose of these commands is to help you understand the session lifecycle, instead of re-describing the problem from scratch every time.

The second stage requires writing engineering tasks instead of natural-language wishes

The focus of the prompting stage is not becoming better at phrasing requests. It is becoming better at defining tasks. A qualified task description should include the goal, boundaries, constraints, acceptance criteria, and whether research should happen before any changes are made.

The essence of a high-quality prompt is turning vague intent into an executable work item. Only then can Codex consistently produce verifiable results.

A more reliable task template improves execution quality

Goal: Fix the 401 retry issue in the login API after token expiration
Constraints: Do not modify the database schema; do not introduce new dependencies
Acceptance Criteria: Add 2 tests; all local tests must pass
Execution Requirements: First read the auth module, then provide a modification plan, and finally implement and validate it

The purpose of this template is to upgrade a task from a chat request into an engineering execution ticket.

The third stage should establish a persistent constraint system

Once you start using Codex frequently, you need to upgrade temporary prompts into long-term constraints. The most important concept here is understanding the layered relationship between ~/.codex/config.toml, project-level .codex/config.toml, global AGENTS.md, and repository-level AGENTS.md.

Among them, AGENTS.md serves as persistent instruction storage and works well for style, conventions, and collaboration rules. config.toml is more oriented toward runtime configuration. Rules and Hooks handle constraint enforcement and trigger logic.

# ~/.codex/config.toml
approval_policy = "on-request"   # Request approval when needed
sandbox_mode = "workspace-write" # Allow writes only inside the workspace
profile = "default"              # Default profile

The purpose of this configuration is to provide Codex with reusable execution boundaries and safety policies.

The fourth and fifth stages solve reuse and external-context integration respectively

The role of a Skill is to capture a reusable workflow, not to archive knowledge. If a task occurs frequently, follows stable steps, and has fixed inputs and outputs, it is a good candidate for abstraction into a Skill. Examples include a code-reading report, a pull request review checklist, or a log-troubleshooting process.

MCP is fundamentally different. It solves external live data access and external capability integration, such as documentation systems, browsers, design tools, and internal platforms. A Skill is a workflow. MCP is a tool and context integration layer. You must keep that boundary clear.

The division of responsibilities between Skill and MCP should be explicit

def choose_capability(task):
    if task["is_repetitive"]:
        return "Skill"  # Repetitive process, suitable for workflow abstraction
    if task["needs_external_context"]:
        return "MCP"    # Depends on external real-time data or external system capabilities
    return "Prompt"     # One-off task, start with a prompt

The purpose of this code is to help you quickly decide which capability layer a task belongs to.

The sixth stage should treat Subagents as a context-isolation mechanism

Subagents are not simply a way to make AI stronger by opening multiple instances. They exist to isolate context, reduce contamination, and split complex tasks into parallel tracks. Typical scenarios include explore + review, trace + fix, and design analysis + code implementation.

The tradeoff is higher token consumption and more complex orchestration, so Subagents are not suitable for every task. For simple work, single-threaded execution is often more stable.

These task characteristics are well suited for Subagents

  • The task contains clearly parallelizable subproblems.
  • Different subproblems require different perspectives or rule sets.
  • The main context can easily be polluted by large amounts of exploratory information.
  • The work requires exploration before review, or tracing before fixing.

The ultimate goal is not to learn features but to build a personal working system

The final stage of the roadmap emphasizes methodological accumulation. You should consolidate your commonly used configurations, frequently used Skills, MCP inventory, Subagent role templates, and automation candidates into a repeatable team practice.

The entire methodology can be summarized in one sentence: use prompts for one-off tasks, put long-term preferences into AGENTS and config, turn repetitive processes into Skills, connect external live data through MCP, use Subagents for parallel collaboration, and only then connect stable execution to automation.

# Example: connect a stable process to automated execution
codex exec "Scan src/auth, output risk points, and generate remediation suggestions"  # Batch-execute a fixed task

The purpose of this command is to further distill an interactive manual workflow into an automation entry point.

The practical value of this roadmap lies in avoiding capability misuse

The problem in many teams is not that the tool is insufficiently powerful. The real issue is that every problem gets pushed into a prompt. The result is that conventions cannot be inherited, context cannot be reused, and workflows cannot be institutionalized.

The real answer provided by this roadmap is layered governance: prompts handle immediate task expression, AGENTS and configuration handle long-term constraints, Skills handle workflow reuse, MCP handles external connectivity, and Subagents handle complex division of labor.

WeChat sharing prompt AI Visual Insight: This image is an animated sharing prompt from a blogging platform. It is mainly used to guide users through UI-based sharing actions and does not contain technical information related to the Codex architecture, CLI, MCP, or Subagents.

FAQ

1. What should beginners learn first when starting with Codex?

Start with basic CLI operations, session management, and how to make Codex read code, modify code, and execute commands. Only after you build the right mental model of a development agent do Skills, MCP, and Subagents become meaningful.

2. What is the easiest-to-confuse difference between Skill and MCP?

A Skill is a reusable workflow that emphasizes steps and method. MCP is external system integration that emphasizes real-time context and tool access. The former answers how to do the work. The latter answers where to get the data and which capabilities to invoke.

3. When should you actually use Subagents?

Use them only when the task is naturally parallelizable, requires role-based division of labor, or when the main context can easily be polluted by exploratory information. For a single-point fix or a small scoped change, single-threaded execution is usually more stable and more token-efficient.

Core Summary: This article reconstructs the original roadmap into a developer-oriented Codex learning framework that covers the CLI, prompting, layered configuration, AGENTS.md, Skills, MCP, Subagents, and automation. Its goal is to help you move from simply using Codex to building a personal AI coding work system.