> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View and Review Code Changes

<div id="overview">
  # Overview
</div>

After Qoder modifies code, you typically need to check what it changed and conduct a code review. Qoder CLI offers two features: use `/diff` to view specific code diffs, and `/review` to perform a structured code review and identify fixable issues.

Both features are Git-based and must be used within a Git repository.

<div id="diff">
  # View Changes (/diff)
</div>

Use `/diff` to view the code diff in the current workspace:

```shell theme={null}
/diff
```

It displays the specific changes in modified and newly added (untracked) files, helping you quickly confirm what Qoder has changed.

<div id="review">
  # Review Changes (/review)
</div>

`/review` performs a code review on the changes to identify fixable issues. It can be used in two ways:

## Interactively Select Review Scope

When run without arguments, `/review` prompts you to select the review scope:

```shell theme={null}
/review
```

The available review scopes include:

* **Current changes**: Review staged, unstaged, and untracked files.
* **Compare with Base Branch**: Select a local branch and review the changes in the current branch relative to it.
* **Specific commit**: Select a commit from the recent commit list for review (up to 100 commits are listed).
* **Custom instructions**: Enter custom review requirements.

## Provide Review Instructions Directly

When run with arguments, the arguments are passed directly to Qoder as review instructions:

```shell theme={null}
/review Focus on checking concurrency safety and error handling in this change
```

<div id="review-modes">
  # Review Scopes
</div>

| Scope                    | Review Content                                                          |
| :----------------------- | :---------------------------------------------------------------------- |
| Current Changes          | Staged, unstaged, and untracked files in the workspace                  |
| Compare with Base Branch | Differences of the current branch relative to the selected local branch |
| Specific Commit          | Changes introduced by the selected commit                               |
| Custom Instructions      | Review according to your entered requirements                           |

When selecting "Compare with Base Branch", if the `main` or `master` branch exists locally, it is prioritized as the default base branch.

<div id="workflow">
  # Recommended Workflow
</div>

A typical "modify—view—review" workflow:

1. Have Qoder complete a modification.
2. Use `/diff` to quickly view what it changed.
3. Use `/review` to perform a structured review and identify potential issues.
4. Based on the review results, have Qoder make further corrections.

The "Compare with Base Branch" and "Specific Commit" scopes are particularly useful when you need to strictly vet the entire set of changes before committing.

> Both `/review` and `/diff` must be run in a Git repository. If you are not in a Git repository, or if no branches or commits are available, Qoder will display an appropriate prompt.
