CursorCursorProblem & solution
Improving Cursor’s agent for OpenAI Codex models
Summary
Cursor describes adapting its agent harness for OpenAI's latest frontier coding model, GPT-5.1-Codex-Max, by pairing model-familiar instructions with Cursor-specific tools and tuning against Cursor Bench. The Codex integration adopts a more shell-forward design, aligns tool names with commands such as rg, explicitly prefers tools over shell commands, and uses sandboxing to limit unauthorized file and network access. It also limits reasoning summaries to one or two sentences, gives literal guidance for invoking read_lints after substantive edits, removes mid-turn user-communication language, and biases the agent toward taking action unless a plan is requested. Preserving Responses API reasoning items is treated as critical: Cursor reports a 30% performance drop for GPT-5-Codex when traces were removed, compared with OpenAI's observed 3% SWE-bench degradation for GPT-5, while prompt-ordering lessons led it to remove wording that discouraged ambitious work.
Context
Each model integrated into Cursor's agent harness requires specific instructions and tools to improve output quality, tool use, robustness, and adoption. Cursor and OpenAI collaborated to align the Codex integration with the Codex CLI harness while tuning it for the Cursor environment.
Approach / What changed
Cursor updated the Codex agent harness with shell-oriented tool naming, explicit tool-use and lint-checking instructions, concise reasoning-summary guidelines, stronger action bias, preserved reasoning traces, sandboxing, and revised prompt ordering.
Takeaways
Cursor found that Codex needed explicit, literal instructions to call read_lints after substantive edits; exposing the tool definition alone did not make the model inclined to use it.
In Cursor Bench experiments, removing reasoning traces from GPT-5-Codex caused a reported 30% performance drop. Cursor added alerting to ensure those traces are preserved and forwarded.
Prompt wording about conserving tokens reduced Codex's willingness to attempt ambitious tasks, so Cursor revised harness instructions to avoid contradicting or unnecessarily constraining user requests.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.