Skip to main content
Glama

codex_fork_session

Destructive

Fork an existing Codex session into a new branch and run a prompt against it, preserving the original session unchanged.

Instructions

Fork an existing Codex session into a new branch (codex fork <ID|--last>) and run a prompt against the fork without mutating the original.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel name or alias (e.g. gpt-5.5, latest)
promptYesPrompt text for the forked Codex session
forkLastNoFork from the most recent Codex session. Mutually exclusive with `sessionId`.
sessionIdNoCodex session UUID to fork from. Mutually exclusive with `forkLast`.
workspaceNoRegistered workspace alias for remote HTTP/OAuth provider calls. Do not use this field, workspace_list, or workspace_register_existing_repo as a fallback for stdio/local provider path access; pass workingDir/addDir/includeDirs directly instead.
sandboxModeNoCodex --sandbox. Omit = Codex exec built-in default (read-only; cannot write files). Pass workspace-write to let Codex edit files in the working dir, or danger-full-access for unrestricted access.
correlationIdNoRequest trace ID (auto if omitted)
idleTimeoutMsNoIdle timeout in ms (min 30s, max 1h, omit=CLI default)
askForApprovalNoDEPRECATED compatibility input: accepted but ignored because current Codex no longer accepts --ask-for-approval.
Behavior3/5

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

Annotations indicate destructiveHint=true, and description adds 'without mutating the original', but fails to disclose fork lifecycle, whether it persists, or what happens to the fork. The deprecated askForApproval note is helpful but not fully transparent.

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?

Single, front-loaded sentence efficiently conveys the core action and effect without wasted words.

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?

Despite 9 parameters and destructiveHint=true, the description omits fork lifecycle, return value, and important safety context about sandboxMode. No output schema means agent has no idea what to expect.

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

Parameters4/5

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

Schema coverage 100% gives baseline 3; description adds value with the command syntax hint and the workspace parameter usage note, plus the deprecated askForApproval disclosure.

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 verb 'fork' and the resource 'Codex session', and distinguishes from siblings like codex_request by noting it runs against a fork without mutating the original.

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

Usage Guidelines4/5

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

The description implies when to use (to test a prompt on a fork without altering the original), but does not explicitly state when not to use or mention alternatives like codex_request for direct prompts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/verivus-oss/llm-cli-gateway'

If you have feedback or need assistance with the MCP directory API, please join our Discord server