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

# Change Stack

> CodeRabbit Change Stack is a **code review interface** that reorganizes a pull request from a flat file list into a guided, layer-by-layer walkthrough, so reviewers can follow the change in the logical, explorable order, not in alphabetical file order. Each *cohort* is accompanied by range-specific summary and diagrams.

export const Hint = ({type, children, headline, tip, href, cta}) => {
  const TIPS = {
    learnings: {
      headline: "Learnings",
      tip: "Review preferences CodeRabbit learns from your chat conversations and applies automatically to future reviews.",
      cta: "Learn about Learnings",
      href: "/knowledge-base/learnings",
      content: "Learnings"
    },
    walkthrough: {
      headline: "PR Walkthrough",
      tip: "A structured comment posted by CodeRabbit at the top of every pull request, summarizing changes, sequence diagrams, review effort, and more.",
      cta: "Learn about PR Walkthroughs",
      href: "/pr-reviews/walkthroughs",
      content: "Walkthrough"
    },
    "finishing-touches": {
      headline: "Finishing Touches",
      tip: "Post-review agentic actions (Autofix, writing docstrings or unit tests, and more) you trigger from a PR comment or a checkbox in the Walkthrough.",
      cta: "See all Finishing Touches",
      href: "/finishing-touches",
      content: "Finishing Touches"
    },
    "coding-plan": {
      headline: "Coding Plan",
      tip: "A detailed, codebase-aware implementation plan CodeRabbit generates from an issue or description, ready to hand off to any coding agent.",
      cta: "Learn about Coding Plans",
      href: "/plan",
      content: "Coding Plan"
    },
    "knowledge-base": {
      headline: "Knowledge Base",
      tip: "The collected context sources CodeRabbit draws on during reviews: Learnings, Code Guidelines, issue trackers, connected MCP servers, and cross-repo analysis.",
      cta: "Explore the Knowledge Base",
      href: "/knowledge-base",
      content: "Knowledge Base"
    },
    "path-instructions": {
      headline: "Path Instructions",
      tip: "Custom review rules that only apply to files matching a glob pattern, e.g. 'src/controllers/**'.",
      cta: "Configure path instructions",
      href: "/configuration/path-instructions",
      content: "Path Instructions"
    },
    "coderabbit-review": {
      headline: "CodeRabbit Review",
      tip: "A new code review interface that reorganizes a pull request into a layered, logical walkthrough of the change, improving the reviewer experience.",
      cta: "Learn about CodeRabbit Review",
      href: "/pr-reviews/change-stack",
      content: "CodeRabbit Review"
    },
    scope: {
      headline: "Scope",
      tip: "A named set of repositories, connections, and spend limits that controls what CodeRabbit Agent can access in a given Slack conversation.",
      cta: "Learn about Scopes",
      href: "/slack-agent/scopes",
      content: "Scope"
    },
    "coderabbit-agent": {
      headline: "CodeRabbit Agent for Slack",
      tip: "An AI agent built into Slack that investigates issues, generates implementation plans, and opens pull requests right from the Slack threads.",
      cta: "Explore CodeRabbit Agent",
      href: "/slack-agent",
      content: "CodeRabbit Agent"
    }
  };
  const defaults = TIPS[type] || ({});
  return <Tooltip headline={headline ?? defaults.headline} tip={tip ?? defaults.tip} cta={cta ?? defaults.cta} href={href ?? defaults.href}>
      {children ?? defaults.content}
    </Tooltip>;
};

export const EarlyAccessBadge = ({tip = "This feature is in early access. Enable it by setting `early_access: true` in your `.coderabbit.yaml`, or by toggling Early Access on the web interface.", title = "Early Access", cta = "View configuration", href = "/reference/configuration#param-early-access", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="flask-conical" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const ProPlusPlanBadge = ({tip = "This feature is available as part of the Pro+ plan and Enterprise plan. Please refer to our pricing page for more information about our plans and features.", title = "Pro+ Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="shield-plus" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const GitLabBadge = ({tip = "This feature is available on GitLab.", title = "GitLab", cta, href, disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="gitlab" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const GitHubBadge = ({tip = "This feature is available on GitHub and GitHub Enterprise.", title = "GitHub", cta, href, disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="github" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<GitHubBadge tip="CodeRabbit Review is available on GitHub Cloud and GitHub Enterprise Server." /> <GitLabBadge tip="CodeRabbit Review is available on GitLab.com and self-managed GitLab." /> | <ProPlusPlanBadge title="Pro+ Plan *" tip="CodeRabbit Review is available to all users during launch and will be part of the Pro+ plan." /> <EarlyAccessBadge tip="CodeRabbit Review is in early access and available to all users during launch." />

## Overview

Change Stack takes any pull request and reorganizes it into a small number of independent **change cohorts** — logical groupings of related work — each broken into ordered **layers** that reflect the natural reading order of the change. Every layer anchors to specific line ranges in the diff, each with its own summary.

Reviewers open Change Stack from the [`Review Change Stack →`](#opening-change-stack) button that CodeRabbit posts in the <Hint type="walkthrough">PR Walkthrough</Hint> comment. Inside, they navigate cohorts and layers with the keyboard, drop inline comments against specific ranges, and submit native review feedback without leaving the Change Stack tab.

<Info>
  CodeRabbit Review is available on GitHub Cloud, GitHub Enterprise Server, GitLab.com, and self-managed GitLab. CodeRabbit Review is in [early access](/early-access) and is available to all users during launch. It will be part of the Pro+ plan going forward.
</Info>

## Why Change Stack

AI-assisted development has made pull requests larger and more frequent, a single AI-authored change can touch dozens of files across multiple layers of a codebase. GitHub's or IDE's default diff view presents those files alphabetically, without reflecting the logical dependencies between them. Change Stack reorganizes the diff into cohorts and layers that reflect the structure of the change:

* **Cohorts** group related files and hunks that belong together conceptually.
* **Layers** order those groups so foundational changes (data shapes, contracts) come before the code that depends on them (consumers, call sites, tests).
* **Range summaries** explain each contiguous block of changed lines in plain language.
* **Diagrams** are generated inline for layers where a visual earns its place — sequence diagrams for new call flows, state machines for lifecycle changes, ERDs for data model updates. Layers that do not warrant a diagram do not get one.

## Opening Change Stack

Every pull request review comment from CodeRabbit includes a **Review Change Stack →** button above the standard walkthrough. Clicking it opens the review in the Change Stack interface.

<Frame caption="&#x22;Review Change Stack →&#x22; button in the CodeRabbit review comment">
  <img width="400px" src="https://mintcdn.com/coderabbit/vxxyCiPZPM0A23bY/assets/images/change-stack-button.png?fit=max&auto=format&n=vxxyCiPZPM0A23bY&q=85&s=5d925733d579ac75b11bf88aa83032dd" alt="CodeRabbit review comment showing the Review Change Stack button alongside Walkthrough and Pre-merge checks sections" data-path="assets/images/change-stack-button.png" />
</Frame>

Change Stack is opt-in per reviewer. Teammates who prefer the default GitHub review experience can ignore the button — nothing about the PR workflow changes for them.

## The three-panel layout

Change Stack uses a fixed three-panel layout tuned for rapid navigation:

| Panel  | Contents                                                                                                                                                                                           |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Left   | Cohort and layer navigation, plus an **All files** view for jumping to any file in CodeRabbit's review scope. Each layer shows its file count and comment count.                                   |
| Center | The unified, split, or semantic diff for the active layer, scoped to the relevant line ranges. Click a variable, function, class, or type name to look up its definition and usages via Code Peek. |
| Right  | Per-range AI summaries for the visible diff, plus a Comments tab for inline discussion.                                                                                                            |

<Info>
  Change Stack reflects CodeRabbit's review scope, not necessarily the full pull request file list on the host platform. Files excluded by default ignore rules or configured [Path filters](/configuration/path-instructions#path-filters) are omitted from cohorts, layer file counts, and file navigation.
</Info>

### Keyboard navigation

Change Stack is designed to be driven from the keyboard:

| Shortcut     | Action                                    |
| ------------ | ----------------------------------------- |
| <kbd>J</kbd> | Advance to the next layer                 |
| <kbd>K</kbd> | Go back to the previous layer             |
| <kbd>Z</kbd> | Toggle focus mode (hides the side panels) |

Reviewers can also switch between unified, split, and semantic diff views, step through the review order using the arrow controls in the diff header, and use the **All files** view to search the reviewed file tree. Diff lines wrap automatically in all views.

## Reviewing in Change Stack

Change Stack supports native review workflows on the host platform, including inline comments and review submission without leaving the Change Stack interface. Reviews post back to GitHub or GitLab natively, so comments and approvals land exactly where your team expects them.

<Frame caption="Submit review dialog in Change Stack with Comment, Approve, and Request changes options">
  <img width="500px" src="https://mintcdn.com/coderabbit/vxxyCiPZPM0A23bY/assets/images/change-stack-review.png?fit=max&auto=format&n=vxxyCiPZPM0A23bY&q=85&s=9c634027c6aea5f9a2752fc4ebf6601d" alt="Submit review dialog showing Comment selected, with Approve and Request changes options, and a Submit review button" data-path="assets/images/change-stack-review.png" />
</Frame>

### Inline comments

Every range summary in the right panel has an **Add block comment** action that opens a comment against the exact line range covered by the summary. Comments accumulate into a pending review, which you submit from the **Submit review** menu in the top-right corner.

The comment composer supports platform-native autocomplete for user and team mentions, issue references, pull request references, metadata references, and emoji shortcodes.

### Code Peek

Click a variable, function, class, or type name to look up its definition and usages. Code Peek uses GitHub code search to show likely definitions and references with surrounding context, so you can follow the code without leaving the review.

Code Peek is available in GitHub Change Stack sessions when CodeRabbit has the GitHub access it needs for the repository. If GitHub needs to be reconnected or code search is unavailable for the session, Code Peek is not shown.

When a result points to a changed file in the pull request, **Open in Change Stack** jumps to that file. Change Stack keeps an in-page back trail so you can return to where you started.

### Files viewed

On GitHub, marking a file as viewed in Change Stack syncs with GitHub's **Viewed** state on the same file, so your progress is visible to other reviewers and persists if you switch back to the GitHub UI.

## Snapshots and stale-state protection

Every time the PR author pushes a new commit, Change Stack generates a new **snapshot** of the change and retains previous ones. A snapshot dropdown in the header lets reviewers switch between snapshots to answer the question *"what changed since I last looked?"* — even across rebases and force-pushes.

<Info>
  While a new snapshot is being generated, Change Stack disables commenting on the current view and shows a banner until the new snapshot is ready. This prevents reviewers from leaving comments against a diff that no longer reflects the tip of the branch.
</Info>

## Access and permissions

Change Stack authenticates with a repo-scoped Git provider grant and preserves your return path through SSO, so links work end-to-end even on organizations with enforced SSO. Public-link sharing is supported within the limits of the underlying repository's access controls, so a reviewer without access to the repo will not be able to open the Change Stack.

## What's next

<CardGroup cols={1}>
  <Card title="PR Walkthroughs" href="/pr-reviews/walkthroughs" icon="list-tree" horizontal>
    Learn how CodeRabbit's walkthrough comment structures every review and feeds the layer summaries you see in Change Stack.
  </Card>

  <Card title="PR Summaries" href="/pr-reviews/summaries" icon="file-text" horizontal>
    See how CodeRabbit generates the plain-language summary that appears in the PR description alongside the Review Change Stack button.
  </Card>

  <Card title="Pre-Merge Checks" href="/pr-reviews/pre-merge-checks" icon="shield-check" horizontal>
    Enforce review requirements — linked issues, title conventions, and custom checks — before a PR can merge.
  </Card>
</CardGroup>
