Codex vs Claude Code Subagents: Limits and Config
On this page
- The short answer: Claude Code 2.1.303 vs. Codex 0.162.1 subagents
- How many subagents can Claude Code spawn?
- How many subagents can Codex spawn, and what is the config key?
- Defining custom agents in TOML vs. Markdown
- How to trigger subagents in Claude Code and Codex
- Model selection and precedence in Claude Code and Codex
- Tools, permissions, and sandbox in Claude Code and Codex
- Parallel writes and worktree isolation
- What subagents cost and which token multipliers have a vendor source
- Subagents vs. skills, agent teams, and Codex multi-agent v2
- When subagents help and when they don't
- Out-of-date config keys, commands, and limits you'll still see
- Giving one subagent an MCP server, such as a page publisher
- Frequently asked questions
- Sources
Claude Code (2.1.303) runs up to 20 subagents at once and nests them 3 layers deep, picking Markdown definitions on its own. Local Codex delegates when asked from one TOML file each; in the 0.162.1 source, it defaults to 6 at once and no nesting (max_depth 1).
This reference covers subagent limits, config keys, model settings, permissions, parallel edits, cost, how subagents compare to skills and agent teams, when they help, and older advice such as max_threads or codex mcp-server that may no longer match current releases. Every detail was checked on 2026-10-19 against Claude Code 2.1.303 (published on npm 2026-10-18), its CHANGELOG, and its official docs (subagents, agent teams, costs, memory, worktrees, environment variables, and hooks), alongside Codex CLI 0.162.1 (tagged 2026-10-09), the 0.162.1 source code on GitHub, and Codex's official docs at learn.chatgpt.com (subagents, config reference, AGENTS.md, hooks, worktrees, and import). Codex 0.163.0 was released on 2026-10-15, and its defaults were not checked. No subagent was run in either tool for this article—limits, costs, and nesting were not tested at runtime.
The short answer: Claude Code 2.1.303 vs. Codex 0.162.1 subagents
Here are the exact limits, config keys, and file paths for subagents in Claude Code and Codex.
| Item | Claude Code (2.1.303) | Codex (0.162.1) |
|---|---|---|
| How many run at once | 20 per session (v2.1.217+, CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS); no total cap (v2.1.224+) | 6 in the 0.162.1 source (agents.max_concurrent_threads_per_session; max_threads) |
| Subagents of subagents | Up to 3 layers (v2.1.219+); CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH (1 turns it off) | None (max_depth is 1 in the 0.162.1 source, not in today's docs) |
| Who starts a subagent | Claude from description, or when you ask or @-mention one (2.1.303) | When you ask, or via AGENTS.md or a skill; Ultra on its own in ChatGPT Work |
| Definition file | Markdown + YAML front matter (name, description required; body is prompt) (2.1.303) | One TOML file per agent (name, description, developer_instructions) (0.162.1) |
| Where it lives | Managed > --agents > .claude/agents/ > ~/.claude/agents/ > plugins (2.1.303) | .codex/agents/, ~/.codex/agents/, or agents.<name>.config_file (0.162.1) |
| Model per subagent | model (sonnet, opus, haiku, fable, ID, inherit), effort (v2.1.251+ order) | model, model_reasoning_effort, agents.default_subagent_model, or parent (0.162.1) |
| Permissions and sandbox | Per-agent permissionMode; parent bypassPermissions, acceptEdits, auto overrides | Always inherits the parent's sandbox and approval settings (0.162.1) |
| Parallel file edits | isolation: worktree per subagent; /batch runs 5 to 30 worktree subagents (2.1.303) | No per-subagent worktree; built-in spawn text asks for a disjoint write set (0.162.1) |
| Approvals while it runs | Background prompt appears in the main session, naming the subagent (2.1.303) | CLI shows source thread (o opens it); non-interactive new approvals fail (0.162.1) |
| What the vendor says about cost | Same limits (/usage shows share); agent teams ~7x tokens in plan mode (2.1.303) | More tokens than single-agent runs (no multiplier); CLI warns of quick usage (0.162.1) |
| Teams beyond subagents | Experimental, off by default (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1); 3-5 teammates | multi_agent_v2: stable and off by default in codex features list (0.162.1), not in the docs (4 threads with main) |
| Moving between them | Not checked | /import brings Claude Code subagents, hooks, and instructions into Codex |
| First shipped | 1.0.60, 2025-07-24 | GA 2026-03-16 (Simon Willison) |
This table reflects Claude Code 2.1.303 (published 2026-10-18) and Codex CLI 0.162.1 (tagged 2026-10-09; 0.163.0 from 2026-10-15 was not checked) from docs and source read on 2026-10-19 without runtime testing; sources are listed at the end.
How many subagents can Claude Code spawn?
In Claude Code 2.1.303, a session can run up to 20 subagents at the same time by default, controlled by CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (v2.1.217+). Spawning past that limit returns Concurrent subagent limit reached. There is no total cap per session: the 200-spawn cap added in v2.1.212 (CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION) was removed in v2.1.224 and is now a no-op. Workflows—a separate feature where a script runs many subagents—run 16 agents at once by default, configured via CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS (1 to 256).
For nesting, subagents can spawn up to 3 layers below the main conversation by default (CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH, v2.1.219+), and setting CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH to 1 turns nesting off. Earlier versions handled depth differently: v2.1.172 to v2.1.216 had a fixed limit of up to 5 layers, v2.1.217 to v2.1.218 defaulted to 1, and v2.1.219 raised the default to 3.
How many subagents can Codex spawn, and what is the config key?
Official Codex docs only state that "Codex chooses the default", while in the 0.162.1 source the default is 6 concurrent threads under multi-agent v1 (the default mode), not counting the main thread. The active config key is agents.max_concurrent_threads_per_session, and agents.max_threads is kept as a "Legacy alias"; setting the limit to 0 is rejected with "must be at least 1". Also in the 0.162.1 source, max_depth is 1, meaning a depth-1 subagent cannot spawn its own depth-2 subagent and receives "Agent depth limit reached. Solve the task yourself."
Both max_depth and job_max_runtime_seconds appear in the 0.162.1 source and binary, but because they are absent from today's docs, whether they are supported public keys is unknown. If you enable multi-agent v2 (multi_agent_v2, off by default in 0.162.1), the default in the 0.162.1 source is 4 threads including the main one, and the CLI warns to keep v2 concurrency below 8. None of these numbers or limits were tested at runtime.
Defining custom agents in TOML vs. Markdown
Both tools support custom agents, but they use different file formats and paths. Codex defines custom agents as individual TOML files in .codex/agents/<name>.toml for a project or ~/.codex/agents/<name>.toml for personal use (rather than a single agents.toml or .md file), alongside project-level [agents] settings such as max_concurrent_threads_per_session = 8 in .codex/config.toml. Claude Code uses Markdown files with YAML front matter at .claude/agents/<name>.md.
.claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Glob, Grep
model: sonnet
---
You are a code reviewer. When invoked, analyze the code and provide
specific, actionable feedback on quality, security, and best practices.
.codex/agents/reviewer.toml
name = "reviewer"
description = "PR reviewer focused on correctness, security, and missing tests."
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
developer_instructions = """
Review code like an owner.
Do not edit files.
Prioritize correctness, security, behavior regressions, and missing test coverage.
Lead with concrete findings, include reproduction steps when possible, and avoid style-only comments unless they hide a real bug.
"""
.codex/config.toml
[agents]
max_concurrent_threads_per_session = 8
[mcp_servers.openaiDeveloperDocs]
url = "https://developers.openai.com/mcp"
In Codex, each agent file requires name, description, and developer_instructions. Optional keys include model, model_reasoning_effort, model_reasoning_summary, model_verbosity, skills.config, and feature switches. Instead of standalone files in .codex/agents/, you can also declare roles in .codex/config.toml using agents.<name>.description and agents.<name>.config_file. Codex ships with three built-in roles—default, worker, and explorer—and a custom agent defined with the same name as a built-in takes precedence.
In Claude Code's .claude/agents/ directory, the YAML front matter holds metadata and settings (name and description are required), while the Markdown body becomes the system prompt. A subagent receives only this body and basic environment details like the working directory, not the main Claude Code system prompt. Optional front matter keys include tools, disallowedTools, model, permissionMode, maxTurns, skills, mcpServers, hooks, memory, background, effort, and isolation, though plugin subagents ignore hooks, mcpServers, and permissionMode for security reasons. Claude Code scans .claude/agents/ recursively and identifies agents by the name field rather than the filename. Existing files are watched and reload within seconds, though a newly created agents directory requires a restart. If all custom agents' description fields combined exceed 15,000 tokens, Claude Code prints a startup warning. Note that the /agents command now only prints a reminder; its interactive creation wizard existed through v2.1.197.
How to trigger subagents in Claude Code and Codex
Claude Code delegates on its own by matching the task against each subagent's description. As Anthropic's blog notes, adding too many specialists hurts that automatic routing. When you want to choose the subagent yourself, ask for it by name or @-mention it in the prompt.
Codex delegates only when you explicitly ask, or when your AGENTS.md or a skill instructs it to. In the 0.162.1 source, the built-in spawn instructions state not to spawn sub-agents unless the user, an applicable AGENTS.md, or skill instructions explicitly ask, and specify that "Requests for depth, thoroughness, research ... do not count as permission to spawn" (in ChatGPT Work, "Ultra" can delegate proactively). Once subagents are running in the Codex CLI, run /subagents to switch between agent threads.
Model selection and precedence in Claude Code and Codex
In Claude Code, the subagent model field accepts sonnet, opus, haiku, fable, a full model ID such as claude-opus-5-5, or inherit. You can also configure effort per agent as low, medium, high, xhigh, or max, while subagents automatically inherit the main session's extended-thinking setting (v2.1.198+). In v2.1.303, model precedence runs from the per-invocation parameter, then front matter, then CLAUDE_CODE_SUBAGENT_MODEL, and finally the main model. Before v2.1.251, the environment variable came first; if you need to override everything and force a single model across all subagents, set CLAUDE_CODE_SUBAGENT_MODEL_FORCE. You can verify which model each subagent is running with /tasks (v2.1.242+).
In Codex, a subagent with no explicit setting inherits both the parent's model and reasoning effort. When model settings are present, a value in the custom agent file wins first, followed by an explicit spawn value, then the [agents] default (agents.default_subagent_model), and finally the parent's model.
For per-agent model choices, the Codex docs name gpt-6.1-sol for demanding agents and gpt-6-luna for fast, narrowly scoped ones, paired with reasoning levels from low to ultra. Because model names changed after GA—Simon Willison's March 2026 post, for example, shows gpt-5.3-codex-spark—you should check the model list your own account shows before pasting a model name into your configuration.
Tools, permissions, and sandbox in Claude Code and Codex
In Claude Code, an agent file controls tool access through a tools allowlist (inherited if omitted) and a disallowedTools denylist, along with per-agent mcpServers, hooks, and whole MCP servers via mcp__name__*. A pattern like Bash(git push *) inside disallowedTools still removes the whole tool; to block a single command while keeping the rest of the tool available, use a permissions.deny rule, which applies to subagents too.
Claude Code also supports a per-agent permissionMode (default, acceptEdits, auto, dontAsk, bypassPermissions, or plan), but the parent session takes precedence when looser permissions are active: if the main conversation runs in bypassPermissions, acceptEdits, or auto, the subagent runs in that mode and its front matter permissionMode is ignored. For plugin subagents, Claude Code ignores hooks, mcpServers, and permissionMode for security reasons.
In Codex, subagents inherit your current sandbox policy and approval settings, including runtime changes from /permissions or --yolo. A custom agent file can't replace those settings: setting sandbox_mode, approval_policy, model_provider, or mcp_servers in an agent file will not override the parent, and MCP servers must be configured in the parent. An agent file can only narrow access by turning off features.shell_tool, features.apps, features.plugins, features.memories, features.request_permissions_tool, or individual and bundled skills, and agent instructions don't create a separate read-only sandbox. When a background subagent needs approval in the Codex CLI, prompts from inactive threads show the source thread (press o to open it), while in a non-interactive run, any action needing new approval fails.
Parallel writes and worktree isolation
In Claude Code, setting isolation: worktree gives a subagent its own temporary git worktree. By default, that worktree branches from the default branch rather than the parent's HEAD, though setting worktree.baseRef: "head" changes it, and the worktree is removed automatically if the subagent makes no changes. For larger changes, /batch splits one change across 5 to 30 worktree-isolated subagents.
In Codex, worktrees isolate whole chats, such as in the desktop app's Worktree mode and scheduled tasks, rather than individual subagents. The subagents page documents no per-subagent worktree and warns that parallel write-heavy work "can create conflicts"; instead, the built-in spawn text instructs the model to give each task "a disjoint write set".
What subagents cost and which token multipliers have a vendor source
Neither Anthropic nor OpenAI gives a token multiplier for plain subagents. In Claude Code, subagent requests "count toward the same usage limits" as the main conversation, and /usage shows the subagents' share as a percentage. To spend less in Claude Code, you can set a smaller model per subagent or set CLAUDE_CODE_SUBAGENT_MODEL.
In Codex, billing goes through ChatGPT plan limits and credits. The Codex docs state that subagent workflows "consume more tokens than comparable single-agent runs" without giving a multiplier, and the CLI warns that subagents "can increase usage quickly".
- ~7x (Claude Code agent teams): Claude Code's costs page gives no multiplier for plain subagents; the one Claude Code multiplier is for agent teams, which use "approximately 7x more tokens than standard sessions when teammates run in plan mode".
- ~4x and ~15x (Anthropic Research, 2025-06-13): Anthropic's research-system post (2025-06-13) measured about 4x chat tokens for one agent and about 15x for multi-agent on Claude's Research product, not Claude Code.
- No multiplier (Codex subagents): The Codex docs state only that subagent workflows "consume more tokens than comparable single-agent runs", and the CLI warns that subagents "can increase usage quickly".
- "Codex uses 4x fewer tokens" and "1.5M vs 6.2M tokens" (third-party): These widely repeated comparison figures have no vendor source.
Subagents vs. skills, agent teams, and Codex multi-agent v2
In both tools, skills load on demand rather than occupying the prompt from the start: the Claude Code docs state that "a skill's body loads only when it's used," and the Codex docs note that it "loads SKILL.md only when a skill is chosen." The Codex docs describe skills, MCP, and subagents as separate layers. In Claude Code, a skill can also run inside a subagent when configured with context: fork.
Claude Code agent teams are "experimental and disabled by default," enabled via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. An agent team pairs a lead with teammates running as separate Claude Code instances that share a task list and use direct messaging. The docs advise to "Start with 3-5 teammates" and note hard limits of one team per session, no nested teams, and no session resumption with in-process teammates. Token usage is "significantly more"—about 7x in plan mode.
In the 0.162.1 source, Codex multi-agent v2 is marked "stable" but off by default, with a limit of 4 threads including the main one, and fork_turns defaulting to all (which inherits the parent's history) while none starts clean. Separately, user reports on the OpenAI community forum—user reports, not OpenAI statements—say v2 changed follow-ups and model choice for subagents.
When subagents help and when they don't
Published accounts from Anthropic (2025-06-13, 2026-02-05, and 2026-04-07) and Cognition (2025-06-12 and 2026-04-22) describe where subagents and parallel sessions work and where they fall short.
- Anthropic's blog (2026-04-07) says to delegate at "ten or more files" or "three or more independent pieces", and to skip delegation for sequential work, edits to the same file, and small tasks. It notes that too many specialists hurt automatic delegation and that "Most teams use a handful".
- Anthropic's research system post (2025-06-13) reports that an Opus 4 lead with Sonnet 4 subagents scored 90.2% better than single-agent Opus 4 on Anthropic's internal eval, at about 15x the tokens of chat, while noting that the setup is a weak fit for tightly coupled coding and advising that you brief subagents with an objective, an output format, and bounds.
- Cognition's "Don't Build Multi-Agents" (2025-06-12) argues that agents should share full traces because actions carry implicit decisions, and Cognition's "Multi-Agents: What's Actually Working" (2026-04-22) states that a clean-context reviewer and read-only search subagents work while parallel-writer swarms are "mostly a distraction" for now.
- Nicholas Carlini's post on Anthropic's C compiler (2026-02-05) describes 16 parallel Claudes across about 2,000 Claude Code sessions at just under $20,000 in API cost, coordinated by lock files; these were separate sessions, not subagents.
These write-ups separate read-only search, clean-context review, and independent tasks from sequential work, edits to the same file, and tightly coupled coding, while noting the token and API costs of multi-agent runs and how to brief subagents.
Out-of-date config keys, commands, and limits you'll still see
Older guides, including pages from March 2026, still recommend keys, commands, and limits that have changed or been removed:
max_threadsin Codex is now a legacy alias foragents.max_concurrent_threads_per_sessionin the config reference.- Codex documentation URLs moved from
developers.openai.com/codextolearn.chatgpt.comvia HTTP 308 redirects. codex mcp-serverand the old Agents SDK route have been removed.- Claude Code reads
AGENTS.mdwhen noCLAUDE.mdis present, starting in v2.1.277. - The 200-subagent cap per Claude Code session was removed in v2.1.224.
- Claims that Codex has no subagents have been out of date since subagents reached GA on 2026-03-16.
- A Codex agent file cannot set
sandbox_modeormcp_servers. - Among quoted token multipliers, only 7x (agent teams in plan mode, on the Claude Code costs page) and Anthropic's 4x and 15x figures (from Claude Research in 2025, not Claude Code) have a primary source.
Giving one subagent an MCP server, such as a page publisher
Convika is a remote MCP server (https://mcp.convika.com) that saves and publishes web pages such as landing pages and HTML reports; it does not run or manage agents, and it does not host pages with logins, a database, or live data from another host. For a new page, a subagent writes the whole HTML and calls create_landing_page_preview once to create the site, save the first version, and return a private preview link with 64 random characters that expires after 1 hour. Each save adds a version without using Convika AI credits, and the live page does not change until publish_site runs. Below are the claude mcp add and codex mcp add commands (--scope user adds it to every project in Claude Code), followed by /mcp, claude mcp login convika, or codex mcp login convika to sign in via OAuth in the browser so no hosting API key goes into a file, an environment variable, or the chat:
claude mcp add --transport http convika https://mcp.convika.com
codex mcp add convika --url https://mcp.convika.com
codex mcp login convika
[mcp_servers.convika]
disabled_tools = ["publish_site"]
In Claude Code, subagents inherit the main conversation's MCP tools by default. To restrict Convika to a single subagent, set mcpServers: [convika] (the string entry shares the parent session's connection, whereas inline subagent definitions keep tool descriptions out of the main context, though Convika's OAuth sign-in with an inline definition is untested) or tools: mcp__convika__* on that subagent, and set disallowedTools: mcp__convika on the other subagents. To require confirmation before changing a live site, put the four live-page tools (mcp__convika__publish_site, mcp__convika__rollback_site, mcp__convika__unpublish_site, and mcp__convika__disable_domain_route) in permissions.ask; a background subagent's prompt appears in the main session, and the docs state that "No message from any agent counts as your approval for a pending permission prompt":
{
"permissions": {
"ask": [
"mcp__convika__publish_site",
"mcp__convika__rollback_site",
"mcp__convika__unpublish_site",
"mcp__convika__disable_domain_route"
]
}
}
In Codex, configure the server in the parent session so subagents inherit it, just as the docs' docs_researcher example does with a docs MCP server. In Codex, you can add disabled_tools = ["publish_site"] under [mcp_servers.convika] in config.toml to keep it away from every agent in that session and publish from the dashboard instead—where most people also upload a file directly rather than using MCP. For more details, see publishing a landing page from Claude Code or Codex, share an HTML report in Slack, landing page MCP servers compared, and the Convika docs.
Frequently asked questions
How many subagents can Claude Code spawn?
In Claude Code 2.1.303, you can run up to 20 concurrent subagents per session by default, controlled by CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (v2.1.217+), before hitting Concurrent subagent limit reached. There is no total spawn cap per session—the 200-spawn limit added in v2.1.212 (CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION) was removed in v2.1.224 and is now a no-op. Workflows, a separate feature where a script runs many subagents, run 16 agents at once by default via CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS (configurable from 1 to 256).
How many subagents can Codex spawn?
In the 0.162.1 source, Codex spawns up to 6 concurrent threads by default under multi-agent v1 (not counting the main thread), though the docs only state that "Codex chooses the default". You can configure this limit with agents.max_concurrent_threads_per_session in .codex/config.toml. Under multi-agent v2 (multi_agent_v2, which is off by default in the 0.162.1 source), the default is 4 threads including the main one, and the CLI warns to keep v2 concurrency below 8.
Does Codex support custom agents?
Yes, Codex supports custom agents defined in .codex/agents/<name>.toml (project) or ~/.codex/agents/<name>.toml (personal), or declared in .codex/config.toml via agents.<name>.description and agents.<name>.config_file. Each agent file requires name, description, and developer_instructions, and optionally accepts model, model_reasoning_effort, model_reasoning_summary, model_verbosity, skills.config, and feature switches. If a custom agent shares a name with one of the built-ins (default, worker, or explorer), the custom agent wins. For comparison, Claude Code defines custom agents as Markdown files with YAML front matter in .claude/agents/, requiring name and description and using the file body as the system prompt.
Is max_threads still the right Codex setting?
No, the current setting is agents.max_concurrent_threads_per_session, while agents.max_threads is kept only as a "Legacy alias". Whichever key you set in .codex/config.toml, setting it to 0 is rejected with "must be at least 1".
Can a subagent spawn its own subagents?
In Claude Code 2.1.303, subagents can nest up to 3 layers below the main conversation by default via CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH (v2.1.219+), and setting it to 1 turns nesting off (historically, v2.1.172 to v2.1.216 nested up to a fixed 5 layers, v2.1.217 to v2.1.218 defaulted to 1, and v2.1.219 made it 3). In the 0.162.1 source, Codex sets max_depth to 1, so a depth-1 subagent cannot spawn a depth-2 subagent and receives "Agent depth limit reached. Solve the task yourself." While max_depth and job_max_runtime_seconds exist in the 0.162.1 source and binary, they are not in today's docs, so whether they are supported public keys is unknown.
What model does a subagent use by default?
By default, a subagent inherits the main session's model in both Claude Code and Codex (plus the parent's reasoning effort in Codex, and the main session's extended-thinking setting in Claude Code v2.1.198+). In Claude Code 2.1.303, the precedence order is the per-invocation parameter, front matter model (sonnet, opus, haiku, fable, a full ID such as claude-opus-5-5, or inherit), CLAUDE_CODE_SUBAGENT_MODEL (which came first before v2.1.251), and finally the main model, while CLAUDE_CODE_SUBAGENT_MODEL_FORCE overrides everything and /tasks shows each subagent's model (v2.1.242+). In Codex, a custom agent file's model wins first, followed by an explicit spawn value, the [agents] default agents.default_subagent_model, and the parent's model. You can also set effort per agent in Claude Code (low, medium, high, xhigh, max) or reasoning levels (low to ultra) in Codex, where the docs name gpt-6.1-sol for demanding agents and gpt-6-luna for fast, narrowly scoped ones (check the model list your own account shows, as names like gpt-5.3-codex-spark from March 2026 changed after GA).
What's the difference between subagents and agent teams in Claude Code?
Subagents run inside a single session, whereas agent teams are separate Claude Code instances—a lead plus teammates—that share a task list and use direct messaging. Agent teams are experimental and disabled by default unless you set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, and the docs advise starting with 3–5 teammates. They are limited to one team per session, do not support nested teams or session resumption with in-process teammates, and use significantly more tokens—approximately 7x more than standard sessions when teammates run in plan mode.
Subagents vs skills: which should I use?
Use a skill for reusable instructions that load on demand, and use a subagent when you need an isolated execution worker with its own model or tool rules. In both tools, skills load only when used—Claude Code loads a skill's body only when it's used, and Codex loads SKILL.md only when a skill is chosen. Codex docs describe skills, MCP, and subagents as separate layers, while in Claude Code a skill can also run inside a subagent by setting context: fork.
Do subagents use more tokens?
Yes—both Claude Code and Codex count subagent work toward your plan usage, and multi-agent runs consume more tokens than single-agent runs. Neither vendor gives a token multiplier for plain subagents (Claude Code's ~7x figure is for agent teams in plan mode, Anthropic's 2025-06-13 ~4x single-agent and ~15x multi-agent figures are from Claude's Research product rather than Claude Code, and claims like "Codex uses 4x fewer tokens" or "1.5M vs 6.2M tokens" have no vendor source). In Claude Code, /usage shows the subagents' share as a percentage, and you can spend less by setting a smaller model per subagent or CLAUDE_CODE_SUBAGENT_MODEL. In Codex, billing goes through ChatGPT plan limits and credits, and the CLI warns that subagents can increase usage quickly.
Can a subagent publish a web page?
Yes—when you connect the Convika remote MCP server (https://mcp.convika.com), a subagent that writes an HTML report or landing page can call create_landing_page_preview to save the HTML (using no Convika AI credits) and return a private preview link with 64 random characters that expires after 1 hour. The page goes live only when you ask via publish_site. In Claude Code, put mcp__convika__publish_site, mcp__convika__rollback_site, mcp__convika__unpublish_site, and mcp__convika__disable_domain_route in permissions.ask (a background subagent's prompt shows in the main session, and no message from any agent counts as your approval for a pending permission prompt), or in Codex add disabled_tools = ["publish_site"] under [mcp_servers.convika] in config.toml and publish from the dashboard (publishing a landing page from Claude Code or Codex, share an HTML report in Slack).
Sources
- Claude Code Docs: sub-agents (checked 2026-10-19)
- Claude Code Docs: agent-teams (checked 2026-10-19)
- Claude Code Docs: costs (checked 2026-10-19)
- Claude Code Docs: memory (AGENTS.md) (checked 2026-10-19)
- Claude Code Docs: worktrees (checked 2026-10-19)
- Claude Code Docs: env-vars (checked 2026-10-19)
- Claude Code Docs: agents (checked 2026-10-19)
- Claude Code Docs: workflows (checked 2026-10-19)
- Claude Code Docs: hooks (checked 2026-10-19)
- Claude Code Docs: skills (checked 2026-10-19)
- Claude Code CHANGELOG (checked 2026-10-19)
- npm: @anthropic-ai/claude-code (checked 2026-10-19)
- Codex Docs: subagents (checked 2026-10-19)
- Codex Docs: config reference (checked 2026-10-19)
- Codex Docs: AGENTS.md (checked 2026-10-19)
- Codex Docs: hooks (checked 2026-10-19)
- Codex Docs: git worktrees (checked 2026-10-19)
- Codex Docs: import (checked 2026-10-19)
- Codex Docs: mcp-server (checked 2026-10-19)
- Codex Docs: MCP (checked 2026-10-19)
- Codex Docs: customization (checked 2026-10-19)
- Codex Docs: pricing (checked 2026-10-19)
- openai/codex rust-v0.162.1 (source) (checked 2026-10-19)
- Simon Willison (2026-03-16) (checked 2026-10-19)
- Anthropic Engineering (2025-06-13) (checked 2026-10-19)
- Anthropic Engineering (2026-02-05) (checked 2026-10-19)
- Claude Blog (2026-04-07) (checked 2026-10-19)
- Cognition (2025-06-12) (checked 2026-10-19)
- Cognition (2026-04-22) (checked 2026-10-19)
- OpenAI Community (user report) (checked 2026-10-19)
- OpenAI Community (user report) (checked 2026-10-19)
Related articles
- Claude Code hooks: how to block a command before it runsA PreToolUse hook on Bash and PowerShell that exits 2 blocks the command and hands Claude your stderr; exit 1 does not. Exit codes, matchers, a tested script.
- Codex vs Claude Code skills: SKILL.md paths, /name vs $nameClaude Code reads skills from .claude/skills and runs one with /name; Codex reads .agents/skills and runs one with $name. Folders, front matter, and triggers.
- MCP Explained: The Protocol Powering AI IntegrationsSee what the Model Context Protocol is. Learn why it matters for AI-native tools.