Add --append-system-prompt for exec

Resolved 💬 4 comments Opened Feb 8, 2026 by xudesheng Closed Feb 8, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

4 Comments

xudesheng · 6 months ago

I already prepared a patch on my fork (with a PR opened) that adds --append-system-prompt to codex exec and 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.

etraut-openai contributor · 6 months ago

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.

xudesheng · 6 months ago

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.

xudesheng · 6 months ago

Closing in favor of #11122 (problem-focused request).