Context-Aware Code Review: AI Code Review That Reads Your Production Data
Most AI code review tools only read the diff. Context-aware code review connects to Sentry, Datadog, Amplitude, Jira, and Linear so the review reasons about how your code actually behaves in production, not just how it looks on the page. Here is what context-aware AI code review is, why it catches bugs the diff hides, and how Macroscope does it.
Context-aware code review is AI code review that reasons about more than the diff. Instead of looking only at the lines that changed in a pull request, a context-aware AI code reviewer pulls in the systems where the truth about your code lives: the production errors in Sentry, the latency and resource metrics in Datadog, the usage and funnel data in Amplitude or PostHog, and the intent captured in the Jira or Linear ticket that the pull request is supposed to close. The review is judged against how the code actually behaves, not just how it reads.
This is a guide to context-aware code review: what it is, why diff-only review misses the bugs that matter most, what production context a reviewer should be able to reach, and how Macroscope implements context-aware AI code review on top of GitHub with usage-based pricing. The throughline is simple. A pull request is a proposed change to a running system, and you cannot review a change to a running system well if you cannot see the running system.
TL;DR, Context-Aware Code Review
- Diff-only review judges a pull request against the lines that changed. It is blind to whether the function being edited is the one throwing 40,000 errors an hour in production.
- Context-aware code review connects the review to production signals (Sentry, Datadog), product analytics (Amplitude, PostHog), and ticket intent (Jira, Linear) so findings are grounded in real behavior.
- The payoff is severity ranking that reflects blast radius, not line count. The reviewer flags the change touching a hot error path before it flags a style nit.
- Macroscope has native connections for Sentry, Amplitude, PostHog, LaunchDarkly, GCP Cloud Logging, BigQuery, Jira, Linear, Slack and GitHub, and connects to MCP servers (such as Datadog) for everything else. Check Run Agents use a connection once its tool is in the agent's
toolslist, and the default correctness review can call MCP connectors when.macroscope/correctness/correctness.mdsetstools: [mcp]. Set up under Settings then Connections.- Pricing follows usage: code review is billed at $0.05 per KB of diff in the default Balanced mode (10 KB minimum), not per seat. New workspaces get $100 in free usage to evaluate it.
Macroscope is an AI code review tool for GitHub that can bring production context into pull request review: Check Run Agents call native connections (Sentry, Amplitude, PostHog, LaunchDarkly, GCP Cloud Logging, BigQuery, Jira, Linear) through their tools list, and the correctness review can call MCP connectors such as Datadog when enabled. Findings carry an impact severity (Critical, High, Medium or Low). That lets the review ask "is this change touching code that is already failing in production?" instead of only "is this diff well written?"
What Is Context-Aware Code Review?
Context-aware code review is a review method where the AI reviewer is given access to the context surrounding a code change, not just the change itself. A diff-only reviewer sees a patch. A context-aware code reviewer sees the patch plus the answers to the questions a careful senior engineer would ask before approving it: What is this code supposed to do? Is the function it edits currently failing in production? How many users hit this path? Has this area been a source of incidents before?
The word that does the work here is context. A diff is a tiny slice of information. The same five-line change can be trivial or catastrophic depending on context that lives entirely outside the diff. Context-aware code review is the practice of pulling that surrounding context into the review so the verdict reflects reality.
There are three layers of context that matter, and a serious context-aware AI code review tool should reach all three.
The Three Layers of Context a Reviewer Needs
Context-aware code review draws on codebase context, production context, and intent context. Each layer answers a different question, and each is invisible to a tool that only reads the diff.
Codebase context is everything in your repository that the changed lines depend on or affect. A caller three files away that passes a now-invalid argument. A shared type that the change subtly breaks. A migration that assumes a column the change just renamed. This is cross-file reasoning, and it is the baseline. A context-aware code reviewer that cannot follow a change across file boundaries is not actually context-aware.
Production context is how the code behaves when real users run it. This is where Sentry, Datadog, and your logging stack come in. The function being edited might be the single largest source of unhandled exceptions in your application. The endpoint being touched might have a p99 latency that a new synchronous call would push past your timeout. Diff-only review cannot see any of this. Production context is the layer that most code review tools, including most AI code review tools, simply do not have.
Intent context is what the change is supposed to accomplish. The Jira or Linear ticket states the goal. Context-aware code review can compare the diff against the stated intent and flag the gap: the ticket says "add rate limiting to the public API," the diff adds a constant but never references it in the handler. That is a finding no linter and no diff-only reviewer will ever produce, because the bug is not in the code, it is in the distance between the code and its purpose.
Why Diff-Only AI Code Review Misses the Bugs That Matter
Diff-only review optimizes for the wrong question. It asks "is this code well written?" when the question that protects production is "is this the right change to this part of this system right now?" Those are different questions, and only the second one needs context.
Consider a concrete pattern. An engineer refactors an error-handling block to make it cleaner. The diff is tidy. A diff-only reviewer, human or AI, approves it. What the diff does not show is that the block being refactored is wrapped around the exact call that Sentry has been flagging 40,000 times a day, and the refactor quietly swallows the exception that was the only reason the team could see the problem at all. A context-aware code review tool with Sentry access sees the error volume on that path, recognizes that the change alters how that error surfaces, and flags it as high severity. The diff-only reviewer never had a chance.
This is why severity ranking is the real deliverable of context-aware code review. The value is not just catching more issues, it is ranking them by blast radius so a reviewer reads the dangerous finding first. A finding on a code path that serves a tenth of a percent of traffic and a finding on a code path that serves checkout should not sit in the same undifferentiated list. Production context is what lets the reviewer tell them apart.
How Macroscope Does Context-Aware Code Review
Macroscope is an AI code review tool for GitHub that treats a pull request as a change to a live system and, once you connect your tools, can review it against that system's real behavior. It installs as a GitHub App, reviews every pull request, and goes beyond the diff in three ways that map directly to the three layers of context above.
For codebase context, Macroscope reasons across the whole repository, not just the changed files. It traces how a change ripples through callers, shared types, and adjacent services so cross-file bugs surface during review instead of in an incident. On the 118-bug benchmark we publish, Macroscope caught 48.3% of the bugs, against 45.8% for CodeRabbit, 42.4% for Cursor Bugbot and 23.6% for Greptile.
How Does AI Code Review Find Bugs That Span Multiple Files?
An AI code reviewer finds bugs that span multiple files by following the change out of the diff: it looks up the callers, shared types and other code that depend on what changed, and checks whether those still hold. A diff-only tool cannot do this, because the broken caller is not in the patch. Since October 16, 2026, Macroscope's code review gathers that context with a multi-step agentic approach instead of AST walkers, according to the docs.macroscope.com changelog entry of that date (checked 2026-11-04): the reviewer decides which files and symbols to read next, rather than following a fixed syntax-tree walk. Macroscope's October 2026 changelog reports that correctness reviews became 14% faster on average with 5% higher recall on known bugs, with no change in precision. How AI code review catches bugs across files walks through examples, and AI code review bug detection by language shows how detection varies by language.
For production and intent context, Macroscope's Agent connects to the systems where that context lives. The native connections include Sentry for production errors, Amplitude and PostHog for product analytics, GCP Cloud Logging for production logs, BigQuery for read-only SQL, LaunchDarkly for feature flag state, Jira and Linear for ticket intent, plus Slack and GitHub. Beyond the native list, Macroscope connects to MCP servers, which is how teams wire in Datadog, PagerDuty and internal tools (see the connected tools docs, checked 5 November 2026). MCP connections use OAuth credentials or headers, the discovered tools can be reviewed and disabled individually, and access can be restricted to an allowlist of users. One caveat from the MCP for code review guide: automated Check Run Agent reviews have no requesting user, so they can only use unrestricted workspace connectors, not allow-listed ones.
You configure all of this under Settings then Connections in the dashboard. Once a system is connected, Ask Macroscope can use it right away. A Check Run Agent uses it once you add the matching tool (such as sentry, posthog, amplitude or issue_tracking_tools) to the agent's tools list. The default correctness review already reads code, git history and the web, and calls workspace MCP connectors when .macroscope/correctness/correctness.md sets tools: [mcp]. Those settings are what turn a diff-only review into a context-aware code review.
Native Integrations Plus Any MCP Server
Macroscope gives you native integrations for the common systems and an open door to everything else through MCP, so context-aware code review is not limited to an integration roadmap. This is the part that matters most when you evaluate a tool: not which logos are on the integrations page today, but whether you can connect the system your team actually depends on.
The native connections cover systems many engineering teams already run, with setup limited to credentials:
- Sentry for production error issues and event history
- Amplitude and PostHog for product analytics, funnels and usage
- LaunchDarkly for feature flags and targeting rules
- GCP Cloud Logging for production logs, and BigQuery for read-only SQL
- Jira and Linear for ticket intent
- GitHub and Slack, connected at setup
Then comes MCP: Macroscope connects to MCP servers. If a tool speaks the Model Context Protocol, the review can use it. That is how teams add Datadog, PagerDuty, internal services and home-grown data sources without waiting for anyone to build a bespoke integration. MCP connections use OAuth credentials or headers, and you can review the discovered tools and disable any the agent should not use. Automated reviews have no requesting user, so they use only workspace connectors without a user allowlist.
The practical effect is that context-aware code review is not limited to a fixed list. The native connections cover the common case, and MCP covers the long tail. If your team has an internal incident system or a custom metrics service, you point Macroscope at its MCP server and Macroscope can reason over that context too.
The Same Context Reaches Every Surface in Macroscope
Connect a system once and every part of Macroscope can reason over it. The context you wire up under Settings then Connections is not scoped to a single feature. The same Sentry, Datadog, Amplitude, PostHog, Jira and Linear connections can serve four surfaces, each with its own access setting.
- Pull request review. The correctness review on every PR reads code, git history and the web. With
tools: [mcp]in.macroscope/correctness/correctness.md, it can also call workspace MCP connectors, such as a Datadog MCP server. Native connections such as Sentry reach PR review through Check Run Agents. - Agent queries (Ask Macroscope Anything). You can ask the Macroscope Agent a question in plain language and it pulls the same context to answer. Ask "what is causing the spike in 500s on checkout?" and the Agent queries Sentry, reads the relevant code, and answers with both. Ask Macroscope can use a connection as soon as it is added.
- Macros. Macros are saved, repeatable Agent jobs that run on a schedule or in reaction to an event such as a new commit, a new pull request, or an incoming webhook. A scheduled macro can sweep production logs every morning, cluster the top errors, and draft fix pull requests, the same Fix It For Me capability that turns a review finding into an opened fix PR. An event-driven macro can investigate a Sentry alert the moment it fires. Macros run the same Agent, so they can use the same connections.
- Check Run Agents. Custom checks you define in your repository can call a connection once its tool is in the agent's
toolslist, and can block a merge when a policy is violated. A Check Run Agent withsentryin its tools can require an acknowledgement when a pull request touches a service with an open Sentry issue, because it can read that issue.
The throughline: you connect a system once, then choose which surfaces use it: immediately for Ask Macroscope, per agent through tools for Check Run Agents, and through tools: [mcp] for the correctness review. Agent queries, Macros and Check Run Agents are billed in Agent credits at $0.01 each, with 1,000 free credits per month, separately from code review.
Context-Aware Review and Check Run Agents
Check Run Agents are how you make context-aware code review enforce your specific rules. A Check Run Agent is a custom check you define in a Markdown file in your repository, with YAML frontmatter that names the check and sets its behavior, including a conclusion: failure setting that, together with input: full_diff, lets a failing check block a merge once you mark it required in branch protection (how to make AI code review a required check). Macroscope runs your check on every pull request in its scope. (For a deeper walkthrough, see Check Run Agents: custom AI checks for pull requests.)
Because a Check Run Agent can call your connected tools when you list them in its tools field (which replaces the defaults, so keep browse_code, git_tools, github_api_read_only and modify_pr if you need them), your custom checks can be context-aware too. You can write a Check Run Agent that says, in plain language, "if this pull request touches a service that currently has an open Sentry issue at error level, require an explicit acknowledgement in the description." That is a policy no static rule engine can express, because it depends on live production state. Context-aware code review plus Check Run Agents is how teams move from "the AI gives advice" to "the AI enforces the standards we actually care about."
This is what Check Run Agents add to enforcement: a custom, blocking check can reason about live production signals, not only the diff and the codebase. How to enforce team coding standards with AI covers the rule-writing side.
Context-Aware Review vs Greptile vs CodeRabbit
On production context, Macroscope can reach observability and ticket systems during review through Check Run Agents and MCP-enabled correctness review; Greptile and CodeRabbit, as described when this page was first published in June 2026, focus on the repository and the diff. Check each vendor's current docs before deciding, since features change.
| Capability | Macroscope | Greptile | CodeRabbit |
|---|---|---|---|
| Cross-file codebase reasoning | Yes, whole-repo | Yes, repo history | Yes, diff plus context files |
| Production error context (Sentry) | Yes, native, via Check Run Agents | No | No |
| Metrics and logs (Datadog, GCP) | Yes (GCP Cloud Logging native, Datadog via MCP) | No | No |
| Product analytics (Amplitude, PostHog) | Yes, native, via Check Run Agents | No | No |
| Ticket intent (Jira, Linear) | Yes, native, via Check Run Agents | No | Limited |
| Custom blocking checks over live context | Yes, Check Run Agents | No | Diff-only rules |
| Pricing model | Usage-based ($0.05/KB, Balanced mode) | Credit-based (details) | Seat-based (details) |
Greptile is a capable diff and repository reviewer, and if pattern learning from your history is all you need, it is a reasonable tool. CodeRabbit is a polished diff reviewer with broad surface coverage. Macroscope is built around the idea that the review should see what production sees. If you are evaluating Greptile alternatives or CodeRabbit alternatives specifically for context-aware code review, that is the line that separates them. For the full head-to-head, see Macroscope vs Greptile, CodeRabbit vs Macroscope and Greptile vs CodeRabbit.
What Context-Aware Code Review Looks Like in a Real Review
A context-aware review reads like a senior engineer who already checked the dashboards. Instead of a generic "consider adding error handling here," you get findings grounded in your actual systems:
- "This change wraps the
chargeCardcall, which is the top Sentry issue by event volume this week. The new try block returns early on failure without emitting the existing error event, which will hide the spike. High severity." - "The pull request closes LINEAR-2841, which asks for idempotency on retries. The diff adds a retry loop but no idempotency key, so the stated goal is not met."
- "This endpoint's p99 latency in Datadog is already near the gateway timeout. The added synchronous call to the pricing service will push it over for the slowest decile of requests."
None of those findings are visible in the diff. All of them are exactly what a context-aware AI code review tool exists to surface, and all of them deserve a higher severity than a cosmetic suggestion, so the reviewer reads them first.
How Context-Aware Code Review Connects to Usage-Based Pricing
Macroscope bills code review by the size of the diff: $0.05 per KB in the default Balanced mode, with a 10 KB minimum per review. A one-line fix costs the $0.50 minimum. Over September 29 to October 28, 2026, the average billed review was 76¢ in Balanced mode and 55¢ in Budget mode. Agent queries, Macros and Check Run Agents are billed separately in Agent credits ($0.01 each, 1,000 free per month).
Seat-based pricing breaks this. Charging per engineer per month bears no relationship to how much reviewing actually happens, and in a world where coding agents open pull requests around the clock, the number of seats is the wrong meter entirely. Usage-based pricing aligns the cost of context-aware code review to the reviews you run. You pay for value delivered, not for chairs.
Practically, that means you can turn Macroscope on across every repository without a per-seat budget conversation, let it review everything, and watch spend track real review volume, with a monthly limit and per-review and per-PR caps (controlling AI code review costs). New workspaces start with $100 in free usage, about 131 reviews at the 76¢ average, enough to judge context-aware review on your own codebase. See Macroscope pricing for the full breakdown.
How to Set Up Context-Aware Code Review
Getting to context-aware code review takes three steps, and the codebase-context layer needs no configuration files. First, install the Macroscope GitHub App on your organization and activate the subscription in the dashboard. From that moment, every pull request gets a whole-codebase review, which already covers the codebase-context layer. (For the full walkthrough, see how to set up AI code review on GitHub in 5 minutes.)
Second, connect your production and intent systems under Settings then Connections. Add Sentry, Amplitude, PostHog, LaunchDarkly, GCP Cloud Logging, BigQuery, Jira or Linear from the native list, and connect Datadog or any internal tool through an MCP server. Ask Macroscope can use each connection as soon as it is added.
Third, bring that context into pull request review. Add Check Run Agents as Markdown files in .macroscope/check-run-agents/ with the matching tools (for example sentry) in their tools list, and set conclusion: failure with input: full_diff for policies that should block a merge. To let the default correctness review call MCP connectors, add tools: [mcp] to .macroscope/correctness/correctness.md.
Frequently Asked Questions
What is context-aware code review?
Context-aware code review is AI code review that reasons about the context surrounding a code change, not just the diff. It pulls in codebase context (how the change affects the rest of the repository), production context (how the code behaves in systems like Sentry and Datadog), and intent context (what the originating Jira or Linear ticket asked for), so findings reflect real behavior and real impact.
Which AI code review tool uses production context?
Macroscope can bring production context into GitHub pull request review. Check Run Agents call native connections (Sentry, Amplitude, PostHog, LaunchDarkly, GCP Cloud Logging, BigQuery, Jira, Linear) listed in their tools, and can enforce policies that depend on live production state. The correctness review can call MCP connectors, such as Datadog, when .macroscope/correctness/correctness.md sets tools: [mcp]. Findings carry an impact severity from Critical to Low.
What tool can find bugs that span multiple files in a pull request, not just the diff?
Macroscope reviews each GitHub pull request against the rest of the repository, not just the diff. It follows the change to its callers, shared types and dependent code, and since October 16, 2026 gathers that context with a multi-step agentic approach instead of AST walkers (docs.macroscope.com changelog, checked 2026-11-04). On Macroscope's 118-bug benchmark it caught 48.3% of known bugs, against 45.8% for CodeRabbit and 42.4% for Cursor Bugbot.
How is context-aware code review different from normal AI code review?
Normal AI code review reads the diff and sometimes the surrounding files. Context-aware code review additionally reaches into the systems where your code's real behavior lives. The practical difference is that a context-aware reviewer can tell you the function you just edited is the top source of production errors this week, which a diff-only reviewer can never know.
Does Macroscope read my Sentry and Datadog data during a review?
Only when you configure it. By default the correctness review reads code, git history and the web. Sentry is a native connection: a Check Run Agent reads Sentry issues and event history when sentry is in its tools list. Datadog connects through MCP: add mcp to a Check Run Agent's tools, or tools: [mcp] to .macroscope/correctness/correctness.md. Automated reviews use only workspace connectors without a user allowlist, and you can disable individual MCP tools.
What can I connect to a context-aware code review, and what if my tool is not natively supported?
Macroscope has native connections for Sentry, Amplitude, PostHog, LaunchDarkly, GCP Cloud Logging, BigQuery, Jira, Linear, Slack and GitHub, and connects to MCP servers for everything else. If your tool exposes an MCP server (Datadog, PagerDuty, internal services and custom data sources can), a Check Run Agent with mcp in its tools, or the correctness review with tools: [mcp], can use it during a review. MCP connections use OAuth credentials or headers, and you can disable individual discovered tools.
Can I use this context outside of pull request reviews?
Yes. Agent queries (Ask Macroscope Anything) can use a connection as soon as it is added. Macros run the Agent on a schedule or in reaction to events. Check Run Agents use a connection once its tool is in their tools list, and the correctness review uses MCP connectors when tools: [mcp] is set. You connect a system once and choose which surfaces use it.
Can context-aware code review block a merge?
Yes, through Check Run Agents. A Check Run Agent is a custom check you define in a Markdown file in your repository with YAML frontmatter. Setting conclusion: failure with input: full_diff, and marking the check required in branch protection, lets a failing check block the merge. Because a Check Run Agent can call the connected tools listed in its tools field, your blocking checks can reference live production state, not just the diff.
Is context-aware code review a good CodeRabbit or Greptile alternative?
Yes, especially if production context is what you are missing. Greptile learns from your repository history but does not connect to your observability stack. CodeRabbit reviews the diff and surrounding code. Macroscope can bring Sentry, Amplitude, PostHog, Jira and Linear (native connections) and Datadog (through MCP) into the review via Check Run Agents and MCP-enabled correctness review, which makes it a fit for teams that want review grounded in real behavior. See the best CodeRabbit alternatives and best Greptile alternatives for the wider field.
What does context-aware code review cost?
Macroscope code review is billed at $0.05 per KB of diff in the default Balanced mode, with a 10 KB minimum, so the smallest review costs $0.50. Over September 29 to October 28, 2026 the average billed review was 76¢ in Balanced mode. Agent queries, Macros and Check Run Agents use Agent credits at $0.01 each, with 1,000 free per month. New workspaces get $100 in free usage, about 131 reviews at that average.
Does context-aware code review work on monorepos and multiple languages?
Yes. Macroscope's whole-codebase reasoning is language-aware and handles monorepos, and Check Run Agents can be scoped with include and exclude patterns so a context-aware check applies only to the services or directories you intend. See AI code review for monorepos for the full guide. Macroscope is GitHub-based, so the review and its context access live wherever your code already is.
