1# Review – Codex app1# Code review
2 2
3The review pane helps you understand what Codex changed, give targeted feedback, and decide what to keep.3Use ChatGPT or Codex to inspect code changes before you commit or push them.
4 4
5It only works for projects that live inside a Git repository. If your project5## Start a review
6isn’t a Git repository yet, the review pane will prompt you to create one.
7 6
8## What changes it shows7
8
9
10
11### Review in the app
12
13Open the review pane to understand what changed, give line-specific feedback,
14and decide what to stage, revert, commit, or push.
15
16To ask Codex to review the changes, type `/review` in the composer. Choose
17**Review against a base branch** or **Review uncommitted changes**. Codex reports
18prioritized findings without changing your working tree.
19
20The review pane requires a project inside a Git repository. If your project
21isn't a Git repository yet, the app prompts you to create one.
22
23
24
25
26
27
28
29## Choose a review scope
30
31
32
33
34
35### What changes it shows
9 36
10The review pane reflects the state of your Git repository, not just what Codex37The review pane reflects the state of your Git repository, not just what Codex
11edited. That means it will show:38edited. It includes changes made by Codex, changes you made yourself, and any
39other uncommitted changes in the repository.
40
41By default, the review pane shows **Unstaged** changes. Use **Staged** for the
42Git index, **Commit** for a selected commit, **Branch** for the diff against your
43base branch, or **Last turn** for the most recent assistant turn.
44
45
46
47
48
49
50
51## Work with review results
52
53
54
55
56
57### Code review results
58
59Review findings appear as inline comments in the review pane.
60
61Reviews run in the current task by default. Under **Settings** > **General** >
62**Code review**, choose **Detached** to start a separate review task. See
63[developer settings](https://learn.chatgpt.com/docs/developer-settings?surface=app#app-code-review).
64
65<CodexScreenshot
66 alt="Inline code review comments displayed in the review pane"
67 lightSrc="/images/codex/app/inline-code-review-light.webp"
68 darkSrc="/images/codex/app/inline-code-review-dark.webp"
69 maxHeight="400px"
70/>
71
72
73
74
75
76
77
78
79
80
81
82If you ask Codex to apply the fixes it finds, your normal [sandbox and approval
83settings](https://learn.chatgpt.com/docs/sandboxing) apply.
12 84
13- Changes made by Codex
14- Changes you made yourself
15- Any other uncommitted changes in the repo
16 85
17By default, the review pane focuses on **uncommitted changes**. You can also
18switch the scope to:
19 86
20- **All branch changes** (diff against your base branch)
21- **Last turn changes** (just the most recent assistant turn)
22 87
23When working locally, you can also toggle between **Unstaged** and **Staged**
24changes.
25 88
26## Navigating the review pane89## Navigating the review pane
27 90
28- Clicking a file name typically opens that file in your chosen editor. You can choose the default editor in [settings](https://developers.openai.com/codex/app/settings).91- Clicking a file name typically opens that file in your chosen editor. You
92 can choose the default editor in [developer settings](https://learn.chatgpt.com/docs/developer-settings?surface=app#app-project-and-terminal-behavior).
29- Clicking the file name background expands or collapses the diff.93- Clicking the file name background expands or collapses the diff.
30- Clicking a single line while holding `Cmd` pressed will open the line in your chosen editor.94- Clicking a single line while holding <kbd>Cmd</kbd> pressed opens the line in your chosen editor.
31- If you are happy with a change you can [stage the changes or revert changes](#staging-and-reverting-files) you don’t like.95- If you're happy with a change, you can [stage it or revert changes](#staging-and-reverting-files) you don't want.
32 96
33## Inline comments for feedback97## Inline comments for feedback
34 98
38To leave an inline comment:102To leave an inline comment:
39 103
401. Open the review pane.1041. Open the review pane.
412. Hover the line you want to comment on.1052. Hover over the line you want to comment on.
423. Click the **+** button that appears.1063. Select the **+** button that appears.
434. Write your feedback and submit it.1074. Write your feedback and submit it.
445. After you finish leaving feedback, send a message back to the thread.1085. After you finish leaving feedback, send a message back to the task.
45 109
46Because comments are line-specific, Codex can respond more precisely than with a110Because comments are line-specific, Codex can respond more precisely than with
47general instruction.111a general instruction.
48 112
49Codex treats inline comments as review guidance. After leaving comments, send a113Codex treats inline comments as review guidance. After leaving comments, send a
50follow-up message that makes your intent explicit, for example “Address the114follow-up message that makes your intent explicit, for example, “Address the
51inline comments and keep the scope minimal.”115inline comments and keep the scope minimal.”
52 116
53## Code review results
54
55If you use `/review` to run a code review, comments will show up directly
56inline in the review pane.
57
58
59
60## Pull request reviews117## Pull request reviews
61 118
62When Codex has GitHub access for your repository and the current project is on119When Codex has GitHub access for your repository and the current project is on
63the pull request branch, the Codex app can help you work through pull request120the pull request branch, the ChatGPT desktop app can help you work through pull
64feedback without leaving the app. The sidebar shows pull request context and121request feedback without leaving the app. The sidebar shows pull request
65feedback from reviewers, and the review pane shows comments alongside the diff122context and feedback from reviewers, and the review pane shows comments
66so you can ask Codex to address issues in the same thread.123alongside the diff so you can ask Codex to address issues in the same task.
67 124
68Install the GitHub CLI (`gh`) and authenticate it with `gh auth login` so Codex125Install the GitHub CLI (`gh`) and authenticate it with `gh auth login` so Codex
69can load pull request context, review comments, and changed files. If `gh` is126can load pull request context, review comments, and changed files. If `gh` is
762. Review the pull request context, comments, and changed files.1332. Review the pull request context, comments, and changed files.
773. Ask Codex to fix the specific comments you want handled.1343. Ask Codex to fix the specific comments you want handled.
784. Inspect the resulting diff in the review pane.1354. Inspect the resulting diff in the review pane.
795. Stage, commit, and push the changes to the PR branch when you are ready.1365. Stage, commit, and push the changes to the pull request branch when you're ready.
80 137
81For GitHub-triggered reviews, see [Use Codex in GitHub](https://developers.openai.com/codex/integrations/github).138For GitHub-triggered reviews, see [Use Codex in GitHub](https://learn.chatgpt.com/docs/third-party/github).
82 139
83## Staging and reverting files140## Staging and reverting files
84 141
87 144
88You can stage, unstage, or revert changes at these levels:145You can stage, unstage, or revert changes at these levels:
89 146
90- **Entire diff**: use the action buttons in the review header (for example,147- **Entire diff**: Use the action buttons in the review header, such as **Stage all** or **Revert all**.
91 “Stage all” or “Revert all”)148- **Per file**: Stage, unstage, or revert an individual file.
92- **Per file**: stage, unstage, or revert an individual file149- **Per hunk**: Stage, unstage, or revert a single hunk.
93- **Per hunk**: stage, unstage, or revert a single hunk
94 150
95Use staging when you want to accept part of the work, and revert when you want151Use staging when you want to accept part of the work, and revert when you want
96to discard it.152to discard it.
98### Staged and unstaged states154### Staged and unstaged states
99 155
100Git can represent both staged and unstaged changes in the same file. When that156Git can represent both staged and unstaged changes in the same file. When that
101happens, it can look like the pane is showing “the same file twice” across157happens, the pane can show the same file in both views. That's normal Git
102staged and unstaged views. That’s normal Git behavior.158behavior.
103