> For the complete documentation index, see [llms.txt](https://pharaoh.so/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pharaoh.so/docs/guides/review-pull-requests.md).

# Review Pull Requests

Code review from a diff alone misses the structural questions: Is the new code wired up? What does it break downstream? Does it duplicate something that already exists? Pharaoh turns PR review into a structural analysis - not just "does this code look right" but "does this code fit the architecture."

## The workflow

### 1. Get full context on the changed modules

Ask your AI tool:

```
Review this PR - check the auth and api modules, search for any existing validation functions, and check blast radius on the UserService class.
```

This triggers `pharaoh_recon`, which runs codebase map + module context + function search + blast radius in one batched call. You get the full architectural context for the PR in a single response.

### 2. Check for duplication

Ask your AI tool:

```
Does similar validation logic already exist anywhere in the codebase?
```

This triggers `search_functions`. If the PR adds a `validateEmailFormat` and the codebase already has `isValidEmail` in a shared utils module, that's a merge-blocking finding.

## What to look for

* **Unreachable exports** - the most common structural defect in PRs. Code that compiles and passes tests but is never called from any production path. This happens when someone adds a function and forgets to register it with a router, export it from a barrel file, or call it from a handler.
* **Duplicate functions** - the PR adds something that already exists. This isn't just style - duplicate logic means duplicate bugs and divergent behavior over time.
* **Missing blast radius awareness** - the PR modifies a shared function but only updates one caller. If `get_blast_radius` shows 8 callers and the PR touches 2, ask what happens to the other 6.

## Tips

* Start every PR review with `pharaoh_recon`. It gives you the same context the PR author had (or should have had) when writing the code.
