Skip to main content
Glama

Continue a Codex session

codex_continue

Resume an existing Codex session by session ID with a follow-up prompt so Codex can address review feedback while keeping prior context.

Instructions

Resume an existing Codex session by sessionId with a follow-up prompt — typically review feedback that Codex should address. Preserves Codex context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionId": "<sessionId>",
      "prompt": "<prompt>",
      "cwd": "<cwd>"
    },
    "name": "codex_continue"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesAbsolute path of the workspace Codex should work in
modelNoCodex model override
promptYesFollow-up instruction, e.g. review findings to fix
sandboxNoCodex sandbox policy (default: workspace-write)workspace-write
terminalNoOpen a Terminal window streaming live progress (default: env CODEX_MCP_TERMINAL=1)
sessionIdYesSession/thread id returned by a previous codex_execute call
timeoutMsNoMax execution time per attempt in ms; auto-resume may add attempts (default: 60 minutes)
writeNotesNoPersist a markdown summary of this run to <cwd>/.codex-flow/notes/<sessionId>.md (default false).
verifyCommandNoAcceptance command the server runs in cwd AFTER the Codex run settles (e.g. the test suite). Its exit code and output tail are returned in `verification` — deterministic evidence, not Codex's claim.
reasoningEffortNoReasoning effort override for the selected model
verifyTimeoutMsNoMax time for verifyCommand in ms (default 10 minutes, cap 30).

Output Schema

NameRequiredDescriptionDefault
diffYes
runIdYes
usageYes
errorsYes
statusYes
stderrYes
abortedYes
liveLogYes
acceptedYes
attemptsNo
commandsYes
exitCodeYes
timedOutYes
warningsYes
notesPathYes
sessionIdYes
turnCountYes
redactionsNo
attributionYes
fileChangesYes
parseErrorsYes
agentMessageYes
verificationNo
resumeReasonsNo
sawCompletionYes
schemaVersionYes
unknownEventsYes
reviewFindingsNo
outputTruncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.38.0
    • changedOutput schema / properties / attribution / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "files": {
      -        "items": {
      -          "additionalProperties": {},
      -          "properties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "untracked": {
      -        "items": {
      -          "additionalProperties": {},
      -          "properties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "files",
      -      "untracked"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "files": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "unavailable": {
      +        "type": "boolean"
      +      },
      +      "untracked": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "files",
      +      "untracked"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / diff / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "patch": {
      -        "type": "string"
      -      },
      -      "status": {
      -        "type": "string"
      -      },
      -      "statusTruncated": {
      -        "type": "boolean"
      -      },
      -      "truncated": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "status",
      -      "statusTruncated",
      -      "patch",
      -      "truncated"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "patch": {
      +        "type": "string"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "statusTruncated": {
      +        "type": "boolean"
      +      },
      +      "truncated": {
      +        "type": "boolean"
      +      },
      +      "unavailable": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "status",
      +      "statusTruncated",
      +      "patch",
      +      "truncated"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed19 schema fields changedv0.25.0
    • addedInput schema / properties / verifyCommand
      Added value: +{
      +  "description": "Acceptance command the server runs in cwd AFTER the Codex run settles (e.g. the test suite). Its exit code and output tail are returned in `verification` — deterministic evidence, not Codex's claim.",
      +  "type": "string"
      +}
    • addedInput schema / properties / verifyTimeoutMs
      Added value: +{
      +  "description": "Max time for verifyCommand in ms (default 10 minutes, cap 30).",
      +  "exclusiveMinimum": 0,
      +  "maximum": 1800000,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / accepted
      Added value: +{
      +  "type": "boolean"
      +}
    • removedOutput schema / properties / agentMessage / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / agentMessage / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / commands / items / properties / exitCode / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / commands / items / properties / exitCode / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / exitCode / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / exitCode / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / liveLog / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / liveLog / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / notesPath / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / notesPath / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / redactions
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / reviewFindings
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "dropped": {
      +      "type": "number"
      +    },
      +    "droppedReasons": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "findings": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "expected": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "file": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "inScope": {
      +            "type": "boolean"
      +          },
      +          "line": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "observed": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "severity": {
      +            "enum": [
      +              "CRITICAL",
      +              "HIGH",
      +              "MEDIUM",
      +              "LOW"
      +            ],
      +            "type": "string"
      +          },
      +          "summary": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "severity",
      +          "file",
      +          "line",
      +          "summary",
      +          "expected",
      +          "observed"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "improvements": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "file": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "summary": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "summary"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "outOfScopeCount": {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "parseError": {
      +      "type": "string"
      +    },
      +    "parsed": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "parsed",
      +    "findings",
      +    "improvements",
      +    "dropped",
      +    "droppedReasons"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / properties / sessionId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / sessionId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / verification
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "command": {
      +          "type": "string"
      +        },
      +        "durationMs": {
      +          "type": "number"
      +        },
      +        "exitCode": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "outputTail": {
      +          "type": "string"
      +        },
      +        "passed": {
      +          "type": "boolean"
      +        },
      +        "redactions": {
      +          "type": "number"
      +        },
      +        "skipped": {
      +          "enum": [
      +            "aborted",
      +            "run-failed"
      +          ],
      +          "type": "string"
      +        },
      +        "timedOut": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "command",
      +        "exitCode",
      +        "timedOut",
      +        "durationMs",
      +        "outputTail",
      +        "passed"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "sessionId",
      -  "agentMessage",
      -  "fileChanges",
      -  "commands",
      -  "usage",
      -  "errors",
      -  "parseErrors",
      -  "unknownEvents",
      -  "sawCompletion",
      -  "warnings",
      -  "turnCount",
      -  "schemaVersion",
      -  "status",
      -  "runId",
      -  "diff",
      -  "attribution",
      -  "exitCode",
      -  "timedOut",
      -  "aborted",
      -  "outputTruncated",
      -  "stderr",
      -  "liveLog",
      -  "notesPath"
      -]New value: +[
      +  "sessionId",
      +  "agentMessage",
      +  "fileChanges",
      +  "commands",
      +  "usage",
      +  "errors",
      +  "parseErrors",
      +  "unknownEvents",
      +  "sawCompletion",
      +  "warnings",
      +  "turnCount",
      +  "schemaVersion",
      +  "status",
      +  "accepted",
      +  "runId",
      +  "diff",
      +  "attribution",
      +  "exitCode",
      +  "timedOut",
      +  "aborted",
      +  "outputTruncated",
      +  "stderr",
      +  "liveLog",
      +  "notesPath"
      +]
  3. Changed3 schema fields changedv0.13.0
    • addedInput schema / properties / reasoningEffort
      Added value: +{
      +  "description": "Reasoning effort override for the selected model",
      +  "enum": [
      +    "minimal",
      +    "low",
      +    "medium",
      +    "high",
      +    "xhigh"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / timeoutMs / description
      Previous value: -"Max execution time in ms (default: 30 minutes)"New value: +"Max execution time per attempt in ms; auto-resume may add attempts (default: 60 minutes)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "aborted": {
      +      "type": "boolean"
      +    },
      +    "agentMessage": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "attempts": {
      +      "type": "number"
      +    },
      +    "attribution": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "files": {
      +              "items": {
      +                "additionalProperties": {},
      +                "properties": {},
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "untracked": {
      +              "items": {
      +                "additionalProperties": {},
      +                "properties": {},
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "files",
      +            "untracked"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "commands": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "command": {
      +            "type": "string"
      +          },
      +          "exitCode": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          }
      +        },
      +        "required": [
      +          "command",
      +          "exitCode"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "diff": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "patch": {
      +              "type": "string"
      +            },
      +            "status": {
      +              "type": "string"
      +            },
      +            "statusTruncated": {
      +              "type": "boolean"
      +            },
      +            "truncated": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "status",
      +            "statusTruncated",
      +            "patch",
      +            "truncated"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "errors": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "exitCode": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "fileChanges": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "kind": {
      +            "type": "string"
      +          },
      +          "path": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "path",
      +          "kind"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "liveLog": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "notesPath": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "outputTruncated": {
      +      "type": "boolean"
      +    },
      +    "parseErrors": {
      +      "type": "number"
      +    },
      +    "resumeReasons": {
      +      "items": {
      +        "enum": [
      +          "timeout",
      +          "transient-turn-failure",
      +          "no-completion-marker"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "runId": {
      +      "type": "string"
      +    },
      +    "sawCompletion": {
      +      "type": "boolean"
      +    },
      +    "schemaVersion": {
      +      "type": "number"
      +    },
      +    "sessionId": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "status": {
      +      "enum": [
      +        "success",
      +        "partial",
      +        "failed",
      +        "aborted"
      +      ],
      +      "type": "string"
      +    },
      +    "stderr": {
      +      "type": "string"
      +    },
      +    "timedOut": {
      +      "type": "boolean"
      +    },
      +    "turnCount": {
      +      "type": "number"
      +    },
      +    "unknownEvents": {
      +      "type": "number"
      +    },
      +    "usage": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "cachedInputTokens": {
      +              "type": "number"
      +            },
      +            "inputTokens": {
      +              "type": "number"
      +            },
      +            "outputTokens": {
      +              "type": "number"
      +            },
      +            "reasoningOutputTokens": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "inputTokens",
      +            "cachedInputTokens",
      +            "outputTokens",
      +            "reasoningOutputTokens"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "sessionId",
      +    "agentMessage",
      +    "fileChanges",
      +    "commands",
      +    "usage",
      +    "errors",
      +    "parseErrors",
      +    "unknownEvents",
      +    "sawCompletion",
      +    "warnings",
      +    "turnCount",
      +    "schemaVersion",
      +    "status",
      +    "runId",
      +    "diff",
      +    "attribution",
      +    "exitCode",
      +    "timedOut",
      +    "aborted",
      +    "outputTruncated",
      +    "stderr",
      +    "liveLog",
      +    "notesPath"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changedv0.8.0
    • addedInput schema / properties / writeNotes
      Added value: +{
      +  "description": "Persist a markdown summary of this run to <cwd>/.codex-flow/notes/<sessionId>.md (default false).",
      +  "type": "boolean"
      +}
  5. First observedv0.2.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 behavioral burden. It adds one useful trait ('Preserves Codex context'), but never discloses that this launches a coding agent that can modify the workspace by default (sandbox defaults to workspace-write), that auto-resume may add attempts, or that notes/verification artifacts are produced — details that live only in the parameter descriptions, not in the description itself.

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?

A single tight sentence, front-loaded with the resume action and the identifying key (sessionId), with no filler. Nothing needs trimming.

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?

The output schema excuses it from explaining return values, and the schema covers all 11 parameters, which lightens the load. But for a side-effectful agent-invocation tool with no annotations, the description says nothing about workspace mutation, verification behavior, or resumption limits, leaving meaningful gaps.

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 every parameter (cwd, sandbox, verifyCommand, writeNotes, timeoutMs, etc.) is already documented in the schema. The description's mention of a follow-up prompt adds no semantics beyond what sessionId and prompt already carry in the schema, so the baseline 3 applies.

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 gives a specific verb and resource ('Resume an existing Codex session by sessionId with a follow-up prompt'), which distinguishes it from a fresh run. It does not name codex_execute explicitly, so the contrast with creating a new session is only implied by 'existing' rather than stated.

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?

It offers one usage cue ('typically review feedback that Codex should address'), which tells the agent the typical scenario. There is no explicit when-not guidance and no named alternative for starting a new session, so the routing decision is left partly to inference.

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