Skip to main content
Glama

Fork a Codex session

codex_fork
Destructive

Branch an existing Codex session into a separate new session without altering the original, enabling alternative approaches from a shared starting point.

Instructions

Branch an existing Codex session into a new one, leaving the original untouched. Useful for trying a different approach from a shared starting point.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for the run. Must sit inside the server allowlist. Defaults to the first allowed root.
modelNoModel slug, e.g. "gpt-5.5". Defaults to the Codex configuration.
configNoRaw Codex config overrides as key=value, TOML-parsed, e.g. 'model_reasoning_effort="high"'.
enableNoCodex feature flags to enable for this run.
imagesNoImage files to attach to the prompt. Each must be inside the allowlist.
promptNoMessage to send in the forked session.
disableNoCodex feature flags to disable for this run.
sandboxNoSandbox for commands Codex runs. "read-only" forbids writes, "workspace-write" (default) allows writes inside the workspace, "danger-full-access" removes all limits and is refused unless the server was started with CODEX_MCP_ALLOW_DANGEROUS=1.
worktreeNoRun in a fresh managed git worktree instead of the working directory.
ephemeralNoDo not persist the session to disk. It cannot be resumed afterwards.
thread_idNoAlias for session_id, matching the thread_id returned by codex_exec.
session_idNoSession UUID or thread name to branch from. The original is left untouched.
output_schemaNoPath to a JSON Schema file constraining the shape of the agent final response.
timeout_secondsNoHow long to wait inline before handing back a job_id and continuing in the background. 0 means return immediately. Defaults to the server setting (120s).
skip_git_repo_checkNoAllow running outside a git repository.
dangerously_bypass_approvals_and_sandboxNoRemove every approval and sandbox check. Refused unless CODEX_MCP_ALLOW_DANGEROUS=1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.4

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description usefully adds the key behavioral detail that the original session is left untouched, which is valuable and goes beyond the annotations. It does not disclose approval requirements, background execution, or the lifecycle of the new session, though the annotations already signal a non-read-only, potentially destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no filler. The primary action is stated immediately, and the important safety trait 'leaving the original untouched' is front-loaded. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 16-parameter mutation tool with no output schema and destructive annotations, the description is thin. It does not explain what is returned, how the forked session runs, or how the tool relates to codex_exec and codex_resume, though the rich schema and sibling list partially compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema fully documents all 16 parameters. The tool description adds no parameter-level meaning beyond what the schema already provides, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action and resource: branch an existing Codex session into a new one while leaving the original untouched. This distinguishes it from related operations like resume or exec, though it never names or contrasts with any sibling tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Useful for trying a different approach from a shared starting point' gives a clear use case but no explicit when-to-use versus alternatives. The agent must infer that codex_fork is the right choice over codex_exec or codex_resume from context rather than being told.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.