Codex CLI 0.128.0 Adds /goal Feature for Goal‑Driven Looping
Enable /goal in Codex CLI to loop until goal met or token budget exhausted.
Test /goal with your coding tasks and adjust the token budget as needed.
Summary
OpenAI’s Codex CLI 0.128.0 introduces a /goal command that lets users set a goal for the coding agent. Codex will loop until it evaluates that the goal is achieved or the configured token budget is exhausted. The implementation uses goal/continuation.md and goal/budget_limit.md prompts, automatically injected at the end of each turn. The feature is designed to keep the agent focused on a specific objective and prevent runaway token usage.
The /goal command works by evaluating the agent’s output against the goal condition. If the goal is not met, Codex generates another turn. The token budget limit ensures the loop stops if the budget is reached, preventing infinite loops.
Key points: - /goal sets a target for the coding agent. - Codex loops until goal met or token budget exhausted. - Goal and budget prompts are injected automatically. - The feature helps maintain focus and control over token usage. - It is part of Codex CLI’s ongoing agentic engineering efforts.
This addition enhances Codex’s ability to handle complex coding tasks with clear objectives.
The article also notes that the feature was announced via Twitter by user @fcoury.
Key changes
- /goal sets a target for the coding agent
- Codex loops until goal met or token budget reached
- Goal and budget prompts auto‑injected
- Feature limits runaway token usage
- Improves focus on specific objectives