---
title: "Stay consistent with the codebase · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/code-review/consistent-with-the-codebase
updated: 2026-10-20
licence: "All rights reserved"
---

# Stay consistent with the codebase

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Code review](https://agentwranglers.se/playbook/architecture/code-review)
- Rule: New code follows the patterns the codebase already uses for the same job. Two ways to do one thing doubles what every reader must learn.
- How: Before writing, find how the codebase already handles the same task, such as errors, data access or validation. Follow it. If the old pattern is wrong, change it everywhere in a separate change.
- Check: The review answers question 4 by naming the existing pattern and saying whether the change follows it.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/code-review/consistent-with-the-codebase`.

- Previous: [Name the principle and the fix in every finding](https://agentwranglers.se/playbook/architecture/code-review/name-principle-code-fix)
- Next: [Report problems beyond the diff](https://agentwranglers.se/playbook/architecture/code-review/look-beyond-the-diff)
- [Code review](https://agentwranglers.se/playbook/architecture/code-review)
