integrations/github.md +47 −10
11# Use Codex in GitHub# Codex code review in GitHub
2 2
33Run Codex code review in pull requestsUse Codex code review to get another high-signal review pass on GitHub pull
4requests. Codex reviews the pull request diff, follows your repository guidance,
5and posts a standard GitHub code review focused on serious issues.
4 6
57Use Codex to review pull requests without leaving GitHub. Add a pull request comment with `@codex review`, and Codex replies with a standard GitHub code review.## Before you start
6 8
79## Set up code reviewMake sure you have:
10
11- [Codex cloud](https://developers.openai.com/codex/cloud) set up for the repository you want to review.
12- Access to [Codex code review settings](https://chatgpt.com/codex/settings/code-review).
13- An `AGENTS.md` file if you want Codex to follow repository-specific review guidance.
14
15## Set up Codex code review
8 16
91. Set up [Codex cloud](https://developers.openai.com/codex/cloud).171. Set up [Codex cloud](https://developers.openai.com/codex/cloud).
10182. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review) and turn on **Code review** for your repository.2. Go to [Codex settings](https://chatgpt.com/codex/settings/code-review).
193. Turn on **Code review** for your repository.
11 20
1221
13 22
1423## Request a review## Request a Codex review
15 24
161. In a pull request comment, mention `@codex review`.251. In a pull request comment, mention `@codex review`.
172. Wait for Codex to react (👀) and post a review.262. Wait for Codex to react (👀) and post a review.
18 27
1928
20 29
2130Codex posts a review on the pull request, just like a teammate would.Codex posts a review on the pull request, just like a teammate would. In
31GitHub, Codex flags only P0 and P1 issues so review comments stay focused on
32high-priority risks.
22 33
2334
24 35
25## Enable automatic reviews36## Enable automatic reviews
26 37
2738If you want Codex to review every pull request automatically, turn on **Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review). Codex will post a review whenever a new PR is opened for review, without needing an `@codex review` comment.If you want Codex to review every pull request automatically, turn on
39**Automatic reviews** in [Codex settings](https://chatgpt.com/codex/settings/code-review).
40Codex will post a review whenever someone opens a new PR for review, without
41needing an `@codex review` comment.
28 42
29## Customize what Codex reviews43## Customize what Codex reviews
30 44
41 55
42Codex applies guidance from the closest `AGENTS.md` to each changed file. You can place more specific instructions deeper in the tree when particular packages need extra scrutiny.56Codex applies guidance from the closest `AGENTS.md` to each changed file. You can place more specific instructions deeper in the tree when particular packages need extra scrutiny.
43 57
4458For a one-off focus, add it to your pull request comment, for example:For a one-off focus, add it to your pull request comment:
45 59
46`@codex review for security regressions`60`@codex review for security regressions`
47 61
4862In GitHub, Codex flags only P0 and P1 issues. If you want Codex to flag typos in documentation, add guidance in `AGENTS.md` (for example, “Treat typos in docs as P1.”).If you want Codex to flag typos in documentation, add guidance in `AGENTS.md`
63(for example, “Treat typos in docs as P1.”).
64
65## Act on review findings
66
67After Codex posts a review, you can ask it to fix issues in the same pull
68request by leaving another comment:
69
70```md
71@codex fix the P1 issue
72```
73
74Codex starts a cloud task with the pull request as context and can push a fix
75back to the branch when it has permission to do so.
49 76
50## Give Codex other tasks77## Give Codex other tasks
51 78
54```md81```md
55@codex fix the CI failures82@codex fix the CI failures
56```83```
84
85## Troubleshoot code review
86
87If Codex doesn't react or post a review:
88
89- Confirm you turned on **Code review** for the repository in [Codex settings](https://chatgpt.com/codex/settings/code-review).
90- Confirm the pull request belongs to a repository with [Codex cloud](https://developers.openai.com/codex/cloud) set up.
91- Use the exact trigger `@codex review` in a pull request comment.
92- For automatic reviews, check that you turned on **Automatic reviews** and that
93 the pull request event matches your review trigger settings.