integrations/github.md +48 −9
11# Use Codex in GitHub# Codex code review in GitHub
2 2
33Use 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.Use 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
57## Set up code review## Before you start
8
9Make 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
6 16
71. Set up [Codex cloud](https://developers.openai.com/codex/cloud).171. Set up [Codex cloud](https://developers.openai.com/codex/cloud).
8182. 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.
9 20
1021
11 22
1223## Request a review## Request a Codex review
13 24
141. In a pull request comment, mention `@codex review`.251. In a pull request comment, mention `@codex review`.
152. Wait for Codex to react (👀) and post a review.262. Wait for Codex to react (👀) and post a review.
16 27
1728
18 29
1930Codex 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.
20 33
2134
22 35
23## Enable automatic reviews36## Enable automatic reviews
24 37
2538If 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.
26 42
27## Customize what Codex reviews43## Customize what Codex reviews
28 44
39 55
40Codex 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.
41 57
4258For 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:
43 59
44`@codex review for security regressions`60`@codex review for security regressions`
45 61
4662In 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.
47 76
48## Give Codex other tasks77## Give Codex other tasks
49 78
52```md81```md
53@codex fix the CI failures82@codex fix the CI failures
54```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.