Execute with Codex
codex_executeStarts or resumes a persistent Codex thread to run bounded analysis or code-changing tasks in an allowlisted workspace, reusing saved session context for follow-up calls.
Instructions
Start or resume a persistent Codex thread using Codex workspace-write at an allowlisted cwd. Effective filesystem access also follows local Codex sandbox policy.
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": {
"session_key": "<session_key>",
"prompt": "<prompt>"
},
"name": "codex_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Required on first use; later calls use the saved workspace. | |
| prompt | Yes | ||
| session_key | Yes | Stable logical session name. Reuse it to continue the same Codex thread. | |
| retry_failed | No | Explicitly start a replacement only when an earlier attempt never obtained a thread ID. |