Skip to main content
Glama

codex_fork

Fork an existing Codex session into a new session and optionally send a prompt to continue the conversation.

Instructions

Fork a previous Codex session (codex exec fork) into a new session and optionally send a prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for the codex process.
envNoAdditional environment variables for codex.
modelNoModel the agent should use. May be forced by the server's model-override environment variable.
promptNoOptional prompt to send after forking.
ephemeralNoSkip persisting session files to disk. Defaults to true.
extraArgsNoAdditional raw codex CLI arguments appended to the command.
sessionIdYesConversation/session id (UUID) or thread name to fork.
timeoutMsNoProcess timeout in milliseconds.
ignoreRulesNoDo not load user or project execpolicy .rules files.
outputSchemaNoPath to a JSON Schema file describing the expected final response shape.
skipGitRepoCheckNoAllow running outside a Git repository. Defaults to true.
outputLastMessageNoPath to a file where the final agent message should be written.
dangerouslyBypassApprovalsAndSandboxNoSkip all confirmation prompts and sandboxing. Only use in an already-isolated environment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states that the tool forks a session and optionally sends a prompt. It does not mention side effects (e.g., whether the original session is preserved, whether the new session is persisted), required permissions, network access, or what the response looks like. For a tool with 13 parameters and no annotations, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is a single, focused sentence that front-loads the primary action and its optional variation. It is efficient and avoids redundancy. However, given the complexity of the tool (13 parameters, no annotations, no output schema), one might argue it is too terse, but as a statement of purpose it is concise without waste.

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

Completeness2/5

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

For a tool with 13 parameters, no annotations, and no output schema, the description is far too minimal. It explains only the core function and does not cover return values, edge cases, side effects, or any operational context (e.g., when to set ephemeral, how the fork interacts with session persistence). An agent would have to rely entirely on the schema and trial-and-error to use this tool correctly, which is inadequate for a complex operation.

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?

The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds marginal value by mentioning the 'prompt' parameter ('optionally send a prompt'), which aligns with the schema. However, it does not provide additional context for other parameters (e.g., ephemeral, skipGitRepoCheck, dangerouslyBypassApprovalsAndSandbox) beyond what the schema already offers. The description neither compensates for any gaps nor enriches the schema's meaning.

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

Purpose5/5

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

The description clearly states the tool's purpose: to fork a previous Codex session into a new session, optionally sending a prompt. It uses a specific verb ('fork'), identifies the resource (a Codex session), and distinguishes itself from siblings like codex_resume and codex_run by its focus on forking rather than resuming or running fresh. The reference to `codex exec fork` also anchors the behavior precisely.

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?

The description gives no explicit guidance on when to use this tool versus its siblings (e.g., when to fork versus resume versus run). While the purpose is clear, it does not state conditions like 'use when you want a new session derived from an existing one' or contrast with codex_resume. The usage context is implied by the name and description but not spelled out.

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