OpenAI Codex prompt for reviewing and refactoring code in a local repository
An editorial example for reviewing and refactoring code in a local repository in OpenAI Codex, written for our guide and not tested against the vendor
For
OpenAI Codex
Source
AI Tool Atlas guide: OpenAI Codex
Checked
Oct 2, 2026
The prompt
Editorial example from our guide
Refactor the payment retry logic in src/billing/retry.ts to use exponential backoff with a maximum of 5 attempts, keep the public function signatures unchanged, update the unit tests, and summarise what changed.
When to use this prompt
An editorial example for reviewing and refactoring code in a local repository in OpenAI Codex, written for our guide and not tested against the vendor
Task type: Coding. Browse other prompts for the same task below.
Written for OpenAI Codex; other chat assistants usually accept it unchanged.
No variables to replace: paste it as is.
How to use this prompt: what to fill in, where to run it, what comes back
How to check the result
Run your test suite and linter yourself.
Inspect the full diff before committing.
This prompt was written as an example for our guide and has not been run against the tool. Expect to adapt it to your case. How we document tools.
By default, implement changes rather than only suggesting them. If the user's intent is
unclear, infer the most useful likely action and proceed, using tools to discover any
missing details instead of guessing. Try to infer the user's inte…
If you intend to call multiple tools and there are no dependencies between the tool
calls, make all of the independent tool calls in parallel. Prioritize calling tools
simultaneously whenever the actions can be done in parallel rather than…