Add --append-system-prompt for exec
Problem & Context
In my CI pipeline I run two agents (Claude + Codex). The prompt has two parts: (1) the implementation requirements and (2) a strict output document format after implementation. Codex produces excellent code quality (often better than Claude), but it frequently fails the document requirements. The root cause appears to be prompt priority: Claude supports --append-system-prompt, so the output-format rules can live in the system prompt and are not diluted by the long implementation request. Codex lacks an equivalent mechanism, so format rules get mixed into the main prompt and are often ignored or drifted.
We discovered this after multiple failures and independent post‑mortems by both Claude and Codex converged on the same root cause. This issue is asking for a Codex‑side fix.
Request
Add a CLI flag (e.g., --append-system-prompt) that appends text to the resolved base/system instructions (does not replace them), so high‑priority constraints can survive long prompts.
Why it matters
This directly improves compliance with strict output formats in CI workflows without sacrificing Codex’s strong implementation quality.
4 Comments
I already prepared a patch on my fork (with a PR opened) that adds
--append-system-prompttocodex execand appends the text to resolved base/system instructions (without replacing existing base instructions). If maintainers want to review the diff, I can provide it or re-open/update the PR when invited.I'm not sure this is the best approach to solving this problem. You might want to open a new feature request that focuses on the problem rather than a specific solution. We can then see if it's a problem that other Codex users are facing as well. We generally prioritize feature requests based on community upvotes. If a feature request's title or description doesn't resonate with other users, it won't receive upvotes, and we'll close it after a while.
Thanks for the guidance. I opened a new, problem-focused feature request here:
https://github.com/openai/codex/issues/11122
I’ll close this issue to avoid duplication and keep the discussion in the new thread.
Closing in favor of #11122 (problem-focused request).