{"id":"8c538549-98c1-4872-8fad-4acd5d15141c","shortId":"xyda2a","kind":"skill","title":"codex-exec","tagline":"Run autonomous task execution using the codex CLI. Use when the user asks to \"codex exec\", \"run codex exec\", \"execute a task with codex\", or \"delegate to codex\".","description":"# Codex Exec\n\nAutonomous task execution via the codex CLI. Runs non-interactively. Progress streams to stderr; final result on stdout.\n\n```bash\ncodex exec \"task description\" < /dev/null\n```\n\nFor large context, pipe it via stdin. The prompt stays as the argument, context is passed as `<stdin>` automatically:\n\n```bash\ncat context.txt | codex exec \"question about the context\"\n```\n\n## Sandbox\n\n**All `codex` Bash calls require `dangerouslyDisableSandbox: true`** (network access to OpenAI API). Without it, codex crashes with an `Operation not permitted` panic from the `system-configuration` crate before the model runs.\n\n## Stdin Gotcha\n\nCodex reads from stdin whenever stdin is non-TTY (per `codex exec --help`: \"If stdin is piped and a prompt is also provided, stdin is appended as a `<stdin>` block\"). In subagent and subprocess contexts the harness leaves stdin connected to a pipe that never EOFs, so a bare `codex exec \"...\"` hangs forever, printing only `Reading additional input from stdin...`.\n\nAlways redirect stdin on non-piped invocations:\n\n```bash\ncodex exec \"task description\" < /dev/null\n```\n\nThe piped form (`cat context.txt | codex exec \"...\"`) is safe — `cat` closes the pipe after the file, sending EOF.\n\n## Synchronous Execution\n\nRun codex as a foreground Bash call. Do not pass `run_in_background: true`, and do not pair `codex exec` with `Monitor` inside a subagent.\n\nInside a subagent, `Monitor` only delivers events that arrive during the current turn. Once the subagent emits final text and returns, any further events are dropped. Backgrounding codex and then waiting idle on `Monitor` produces a false-complete: the subagent returns `\"Waiting for codex to finish\"` before codex has produced anything.\n\nIf codex is slow, pass a generous Bash `timeout` on the call itself (e.g., `timeout 3600 codex exec ...`) and wait synchronously. Background execution of codex only works when the invoking agent is the main agent, not a subagent.\n\n## Permission Levels\n\n| Level | Flag | When to Use |\n|-------|------|-------------|\n| Read-only (default) | *(none)* | Analysis, code reading, generating reports |\n| Workspace write | `--sandbox workspace-write` | Editing files within the project |\n| Full access | `--sandbox danger-full-access` | Installing packages, running tests, system operations |\n| Full auto | `--full-auto` | Combined with a sandbox level for unattended execution |\n\nFor fix or implementation tasks, default to `--sandbox workspace-write --full-auto` so Codex can edit files without confirmation prompts. Use read-only for analysis or research tasks.\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `--full-auto` | Allow file edits without confirmation prompts |\n| `--sandbox <level>` | Permission level: `danger-full-access`, `workspace-write` |\n| `--json` | JSON Lines output (progress + final message) |\n| `-o <path>` | Write final message to a file |\n| `--output-schema <path>` | Enforce JSON Schema on the output |\n| `--ephemeral` | No persisted session files |\n| `--skip-git-repo-check` | Bypass git repository requirement |\n\n## Prompt Shaping\n\nCodex uses XML tags in its own context scaffolding, so the model parses them natively. Structure prompts with XML tags for clearer responses:\n\n- `<task>`: The concrete job and relevant context.\n- `<structured_output_contract>`: Required output shape, ordering, and format.\n- `<compact_output_contract>`: Same purpose but for concise prose responses.\n- `<grounding_rules>`: When claims must be evidence-based.\n- `<dig_deeper_nudge>`: Push past surface-level findings to check for second-order failures.\n- `<verification_loop>`: When correctness matters — ask Codex to verify before finalizing.\n\nKeep prompts compact, with tight output contracts. One clear task per exec call.\n\n## Parallel Execution\n\nCodex supports parallel sub-agents via `spawn_agent` / `wait_agent`. The model will not fan out unless the prompt explicitly requests it. See [references/parallel-execution.md](references/parallel-execution.md) for patterns and limitations.\n\n## Interpreting Results\n\n- Exec output is a starting point, not a guaranteed solution\n- Cross-reference suggestions with project documentation and conventions\n- Test incrementally rather than applying all changes at once\n- For file-editing tasks, always review the diff before committing\n- Use a generous timeout (60 minutes / 3600000ms)","tags":["codex","exec","turbo","tobihagemann","agent-skills","claude-code","claude-skills","developer-tools","skills"],"capabilities":["skill","source-tobihagemann","skill-codex-exec","topic-agent-skills","topic-claude-code","topic-claude-skills","topic-developer-tools","topic-skills"],"categories":["turbo"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tobihagemann/turbo/codex-exec","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tobihagemann/turbo","source_repo":"https://github.com/tobihagemann/turbo","install_from":"skills.sh"}},"qualityScore":"0.597","qualityRationale":"deterministic score 0.60 from registry signals: · indexed on github topic:agent-skills · 295 github stars · SKILL.md body (4,382 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-08T06:54:07.247Z","embedding":null,"createdAt":"2026-04-18T22:03:29.212Z","updatedAt":"2026-05-08T06:54:07.247Z","lastSeenAt":"2026-05-08T06:54:07.247Z","tsv":"'/dev/null':58,194 '3600':307 '3600000ms':639 '60':637 'access':95,359,364,433 'addit':177 'agent':322,326,567,570,572 'allow':421 'also':143 'alway':181,627 'analysi':342,411 'anyth':291 'api':98 'append':147 'appli':617 'argument':71 'arriv':248 'ask':16,541 'auto':372,375,397,420 'automat':76 'autonom':5,34 'background':227,266,313 'bare':169 'base':524 'bash':53,77,89,189,220,299 'block':150 'bypass':470 'call':90,221,303,559 'cat':78,198,204 'chang':619 'check':469,532 'claim':519 'clear':555 'clearer':497 'cli':11,40 'close':205 'code':343 'codex':2,10,18,21,27,31,32,39,54,80,88,101,121,132,170,190,200,216,233,267,284,288,293,308,316,399,476,542,562 'codex-exec':1 'combin':376 'commit':632 'compact':549 'complet':278 'concis':515 'concret':500 'configur':113 'confirm':404,425 'connect':160 'context':61,72,85,155,483,504 'context.txt':79,199 'contract':553 'convent':612 'correct':539 'crash':102 'crate':114 'cross':605 'cross-refer':604 'current':251 'danger':362,431 'danger-full-access':361,430 'dangerouslydisablesandbox':92 'default':340,389 'deleg':29 'deliv':245 'descript':57,193,417 'diff':630 'document':610 'drop':265 'e.g':305 'edit':353,401,423,625 'emit':256 'enforc':454 'eof':166,212 'ephemer':460 'event':246,263 'evid':523 'evidence-bas':522 'exec':3,19,22,33,55,81,133,171,191,201,234,309,558,594 'execut':7,23,36,214,314,383,561 'explicit':582 'failur':537 'fals':277 'false-complet':276 'fan':577 'file':210,354,402,422,450,464,624 'file-edit':623 'final':49,257,442,446,546 'find':530 'finish':286 'fix':385 'flag':333 'foreground':219 'forev':173 'form':197 'format':510 'full':358,363,371,374,396,419,432 'full-auto':373,395,418 'generat':345 'generous':298,635 'git':467,471 'gotcha':120 'guarante':602 'hang':172 'har':157 'help':134 'idl':271 'implement':387 'increment':614 'input':178 'insid':237,240 'instal':365 'interact':44 'interpret':592 'invoc':188 'invok':321 'job':501 'json':437,438,455 'keep':547 'larg':60 'leav':158 'level':331,332,380,429,529 'limit':591 'line':439 'main':325 'matter':540 'messag':443,447 'minut':638 'model':117,487,574 'monitor':236,243,273 'must':520 'nativ':490 'network':94 'never':165 'non':43,129,186 'non-interact':42 'non-pip':185 'non-tti':128 'none':341 'o':444 'one':554 'openai':97 'oper':105,370 'option':415,416 'order':508,536 'output':440,452,459,506,552,595 'output-schema':451 'packag':366 'pair':232 'panic':108 'parallel':560,564 'pars':488 'pass':74,224,296 'past':526 'pattern':589 'per':131,557 'permiss':330,428 'permit':107 'persist':462 'pipe':62,138,163,187,196,207 'point':599 'print':174 'produc':274,290 'progress':45,441 'project':357,609 'prompt':67,141,405,426,474,492,548,581 'prose':516 'provid':144 'purpos':512 'push':525 'question':82 'rather':615 'read':122,176,338,344,408 'read-on':337,407 'redirect':182 'refer':606 'references/parallel-execution.md':586,587 'relev':503 'repo':468 'report':346 'repositori':472 'request':583 'requir':91,473,505 'research':413 'respons':498,517 'result':50,593 'return':260,281 'review':628 'run':4,20,41,118,215,225,367 'safe':203 'sandbox':86,349,360,379,391,427 'scaffold':484 'schema':453,456 'second':535 'second-ord':534 'see':585 'send':211 'session':463 'shape':475,507 'skill' 'skill-codex-exec' 'skip':466 'skip-git-repo-check':465 'slow':295 'solut':603 'source-tobihagemann' 'spawn':569 'start':598 'stay':68 'stderr':48 'stdin':65,119,124,126,136,145,159,180,183 'stdout':52 'stream':46 'structur':491 'sub':566 'sub-ag':565 'subag':152,239,242,255,280,329 'subprocess':154 'suggest':607 'support':563 'surfac':528 'surface-level':527 'synchron':213,312 'system':112,369 'system-configur':111 'tag':479,495 'task':6,25,35,56,192,388,414,556,626 'test':368,613 'text':258 'tight':551 'timeout':300,306,636 'topic-agent-skills' 'topic-claude-code' 'topic-claude-skills' 'topic-developer-tools' 'topic-skills' 'true':93,228 'tti':130 'turn':252 'unattend':382 'unless':579 'use':8,12,336,406,477,633 'user':15 'verifi':544 'via':37,64,568 'wait':270,282,311,571 'whenev':125 'within':355 'without':99,403,424 'work':318 'workspac':347,351,393,435 'workspace-writ':350,392,434 'write':348,352,394,436,445 'xml':478,494","prices":[{"id":"428507cf-161d-4cf5-afa4-1689c7be915b","listingId":"8c538549-98c1-4872-8fad-4acd5d15141c","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tobihagemann","category":"turbo","install_from":"skills.sh"},"createdAt":"2026-04-18T22:03:29.212Z"}],"sources":[{"listingId":"8c538549-98c1-4872-8fad-4acd5d15141c","source":"github","sourceId":"tobihagemann/turbo/codex-exec","sourceUrl":"https://github.com/tobihagemann/turbo/tree/main/skills/codex-exec","isPrimary":false,"firstSeenAt":"2026-04-18T22:03:29.212Z","lastSeenAt":"2026-05-08T06:54:07.247Z"}],"details":{"listingId":"8c538549-98c1-4872-8fad-4acd5d15141c","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tobihagemann","slug":"codex-exec","github":{"repo":"tobihagemann/turbo","stars":295,"topics":["agent-skills","claude-code","claude-skills","developer-tools","skills"],"license":"mit","html_url":"https://github.com/tobihagemann/turbo","pushed_at":"2026-05-01T15:45:15Z","description":"A composable dev process for Claude Code, packaged as modular skills.","skill_md_sha":"eab0d46fd45563ce136d2a912503ab5fd50b8092","skill_md_path":"skills/codex-exec/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tobihagemann/turbo/tree/main/skills/codex-exec"},"layout":"multi","source":"github","category":"turbo","frontmatter":{"name":"codex-exec","description":"Run autonomous task execution using the codex CLI. Use when the user asks to \"codex exec\", \"run codex exec\", \"execute a task with codex\", or \"delegate to codex\"."},"skills_sh_url":"https://skills.sh/tobihagemann/turbo/codex-exec"},"updatedAt":"2026-05-08T06:54:07.247Z"}}