Three existing files solve something similar. Does the newest file, the shortest file or the most relevant behavior make the best reference?
Write a brief prediction before opening the explanation.
Read the lesson
A precedent is evidence, not an order
An existing implementation can reveal how a project handles loading states, errors, validation and ownership. Find an example with the same responsibilities and constraints as the task. A polished component for a public search box may be a poor precedent for a private account lookup. Inspect its callers and tests before recommending reuse. File age, popularity or a familiar library alone does not establish fitness.
Name what should be reused
Give Codex the relevant path and explain the specific pattern that matters: the shared request client, error shape, accessibility behavior or layout. Also state the behavior that differs in the new task. This gives the agent evidence for consistency without forcing a blind copy. Repository instructions and actual usage may disagree; report the conflict and investigate instead of silently choosing the example that is easiest to imitate.
Keep the exception visible
Reuse does not justify copying a documented security defect, deprecated API or inaccessible interaction. If the closest example is unsuitable, explain the mismatch and propose the smallest alternative. Avoid turning a small feature into a project-wide cleanup unless that work is authorized. Verify the new behavior and the conventions it was meant to preserve; fewer changed lines are useful only when the result is correct.
Treating every existing pattern as desirable, or adding a new library because one old example is inconvenient.
Make the request actionable
A weak starting brief: Add an account selector using whichever component is easiest.
This example is an adaptable request, not evidence that a runtime action has executed.
A private account picker
src/PublicSearch.tsx: public endpoint, mouse-only interactions. src/MemberPicker.tsx: authenticated shared client, keyboard navigation, tested loading/error states. legacy/AccountDropdown.tsx: matching visual design, deprecated request client and a documented missing ownership check. Task: add a private account picker; no new dependency is needed.
Simulated scenario · No repository access or command execution
Loading your saved lesson progress…