Skip to content

Commit eaeaa0e

Browse files
huntharoclaude
andcommitted
fix(ce-work-beta): correct Codex delegation command and document pitfalls
Replace incorrect `codex --approval-mode` example with the tested working invocation: `cat file | codex exec --skip-git-repo-check - `. Add a pitfalls table documenting all five failure modes discovered during testing: shell redirects, bare codex vs exec, wrong flags, missing git repo check skip, and missing trailing dash for stdin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc42fcb commit eaeaa0e

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

  • plugins/compound-engineering/skills/ce-work-beta

plugins/compound-engineering/skills/ce-work-beta/SKILL.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,16 +472,21 @@ When external delegation is active, follow this workflow for each tagged task. D
472472
473473
3. **Write prompt to file** — Save the assembled prompt to a unique temporary file to avoid shell quoting issues and cross-task races. Use a unique filename per task.
474474
475-
4. **Delegate** — Run the delegate CLI, piping the prompt file via stdin. Omit the model flag to use the delegate's default model, which stays current without manual updates.
476-
477-
**Use `cat ... | codex`, not shell redirects.** Codex CLI rejects `< file` with "stdin is not a terminal". Always pipe:
475+
4. **Delegate** — Run `codex exec` with the prompt piped via stdin. Use `exec` (not bare `codex`) for non-interactive delegation. Omit the model flag to use the delegate's default model, which stays current without manual updates.
478476
479477
```bash
480-
cat /tmp/codex-task-XXXXX.txt | codex --approval-mode full-auto --quiet 2>&1
478+
cat /tmp/codex-task-XXXXX.txt | codex exec --skip-git-repo-check - 2>&1
481479
```
482480
483-
Do not use `exec` subcommand with piped stdin — `codex exec` does not accept `--approval-mode`.
484-
Do not use shell redirects (`< file`) — Codex rejects them with "stdin is not a terminal".
481+
**Codex exec pitfalls (all discovered during testing):**
482+
483+
| Pitfall | Error you get | Fix |
484+
|---------|--------------|-----|
485+
| Shell redirect `< file` instead of pipe | "stdin is not a terminal" | Use `cat file \| codex exec ...` |
486+
| Bare `codex` instead of `codex exec` | Enters interactive mode, hangs | Use `codex exec` for non-interactive delegation |
487+
| `--approval-mode` flag on `exec` | "unexpected argument" | `exec` has its own flags; `--approval-mode` is for bare `codex` only |
488+
| Running outside a git repo | "Not inside a trusted directory" | Add `--skip-git-repo-check` flag |
489+
| Forgetting `-` at end | Prompt not read from stdin | Trailing `-` tells `codex exec` to read the prompt from stdin |
485490
486491
Piping also avoids `ARG_MAX` limits that would occur if passing the prompt as a CLI argument.
487492

0 commit comments

Comments
 (0)