{"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| `-m, --model <MODEL>` | Specify the model to use |\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. Prefer tighter output contracts over raising reasoning effort. 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.590","qualityRationale":"deterministic score 0.59 from registry signals: · indexed on github topic:agent-skills · 280 github stars · SKILL.md body (4,469 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-04-22T00:54:07.883Z","embedding":null,"createdAt":"2026-04-18T22:03:29.212Z","updatedAt":"2026-04-22T00:54:07.883Z","lastSeenAt":"2026-04-22T00:54:07.883Z","tsv":"'/dev/null':58,194 '3600':307 '3600000ms':650 '60':648 'access':95,359,364,433 'addit':177 'agent':322,326,578,581,583 'allow':421 'also':143 'alway':181,638 'analysi':342,411 'anyth':291 'api':98 'append':147 'appli':628 'argument':71 'arriv':248 'ask':16,548 'auto':372,375,397,420 'automat':76 'autonom':5,34 'background':227,266,313 'bare':169 'base':531 'bash':53,77,89,189,220,299 'block':150 'bypass':470 'call':90,221,303,570 'cat':78,198,204 'chang':630 'check':469,539 'claim':526 'clear':566 'clearer':504 '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,483,549,573 'codex-exec':1 'combin':376 'commit':643 'compact':556 'complet':278 'concis':522 'concret':507 'configur':113 'confirm':404,425 'connect':160 'context':61,72,85,155,490,511 'context.txt':79,199 'contract':560 'convent':623 'correct':546 'crash':102 'crate':114 'cross':616 'cross-refer':615 'current':251 'danger':362,431 'danger-full-access':361,430 'dangerouslydisablesandbox':92 'default':340,389 'deleg':29 'deliv':245 'descript':57,193,417 'diff':641 'document':621 'drop':265 'e.g':305 'edit':353,401,423,636 'effort':564 'emit':256 'enforc':454 'eof':166,212 'ephemer':460 'event':246,263 'evid':530 'evidence-bas':529 'exec':3,19,22,33,55,81,133,171,191,201,234,309,569,605 'execut':7,23,36,214,314,383,572 'explicit':593 'failur':544 'fals':277 'false-complet':276 'fan':588 'file':210,354,402,422,450,464,635 'file-edit':634 'final':49,257,442,446,553 'find':537 'finish':286 'fix':385 'flag':333 'foreground':219 'forev':173 'form':197 'format':517 'full':358,363,371,374,396,419,432 'full-auto':373,395,418 'generat':345 'generous':298,646 'git':467,471 'gotcha':120 'guarante':613 'hang':172 'har':157 'help':134 'idl':271 'implement':387 'increment':625 'input':178 'insid':237,240 'instal':365 'interact':44 'interpret':603 'invoc':188 'invok':321 'job':508 'json':437,438,455 'keep':554 'larg':60 'leav':158 'level':331,332,380,429,536 'limit':602 'line':439 'm':474 'main':325 'matter':547 'messag':443,447 'minut':649 'model':117,475,478,494,585 'monitor':236,243,273 'must':527 'nativ':497 'network':94 'never':165 'non':43,129,186 'non-interact':42 'non-pip':185 'non-tti':128 'none':341 'o':444 'one':565 'openai':97 'oper':105,370 'option':415,416 'order':515,543 'output':440,452,459,513,559,606 'output-schema':451 'packag':366 'pair':232 'panic':108 'parallel':571,575 'pars':495 'pass':74,224,296 'past':533 'pattern':600 'per':131,568 'permiss':330,428 'permit':107 'persist':462 'pipe':62,138,163,187,196,207 'point':610 'prefer':557 'print':174 'produc':274,290 'progress':45,441 'project':357,620 'prompt':67,141,405,426,481,499,555,592 'prose':523 'provid':144 'purpos':519 'push':532 'question':82 'rais':562 'rather':626 'read':122,176,338,344,408 'read-on':337,407 'reason':563 'redirect':182 'refer':617 'references/parallel-execution.md':597,598 'relev':510 'repo':468 'report':346 'repositori':472 'request':594 'requir':91,473,512 'research':413 'respons':505,524 'result':50,604 'return':260,281 'review':639 'run':4,20,41,118,215,225,367 'safe':203 'sandbox':86,349,360,379,391,427 'scaffold':491 'schema':453,456 'second':542 'second-ord':541 'see':596 'send':211 'session':463 'shape':482,514 'skill' 'skill-codex-exec' 'skip':466 'skip-git-repo-check':465 'slow':295 'solut':614 'source-tobihagemann' 'spawn':580 'specifi':476 'start':609 'stay':68 'stderr':48 'stdin':65,119,124,126,136,145,159,180,183 'stdout':52 'stream':46 'structur':498 'sub':577 'sub-ag':576 'subag':152,239,242,255,280,329 'subprocess':154 'suggest':618 'support':574 'surfac':535 'surface-level':534 'synchron':213,312 'system':112,369 'system-configur':111 'tag':486,502 'task':6,25,35,56,192,388,414,567,637 'test':368,624 'text':258 'tighter':558 'timeout':300,306,647 'topic-agent-skills' 'topic-claude-code' 'topic-claude-skills' 'topic-developer-tools' 'topic-skills' 'true':93,228 'tti':130 'turn':252 'unattend':382 'unless':590 'use':8,12,336,406,480,484,644 'user':15 'verifi':551 'via':37,64,579 'wait':270,282,311,582 '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':485,501","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-04-22T00:54:07.883Z"}],"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":280,"topics":["agent-skills","claude-code","claude-skills","developer-tools","skills"],"license":"mit","html_url":"https://github.com/tobihagemann/turbo","pushed_at":"2026-04-21T12:22:12Z","description":"A composable dev process for Claude Code, packaged as modular skills.","skill_md_sha":"949feb9a878d78a38c6b7dcf9295d0aa122a283e","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-04-22T00:54:07.883Z"}}