Introducing Sonar Context Augmentation

Manish Kapur photo

Manish Kapur

VP, Product and Solutions Marketing

6 min read

Start your free trial

Verify all code. Find and fix issues faster with SonarQube.

Get started

Update — March 2026: This article was originally published on March 3rd, 2026, when we launched the closed beta of Sonar Context Augmentation for Enterprise customers. We are now announcing the open beta—expanding access to all SonarQube Cloud Teams and Enterprise plan customers.


AI coding agents like Cursor and Claude Code are changing how we build software, but they often work in a vacuum. They don’t automatically understand your project’s specific rules, architectural boundaries, or code security standards. As a result, they can generate code that works in isolation but fails to integrate cleanly into your broader codebase. This leads to rework, higher costs, and a "trial-and-error" process for software developers.

To address this, Sonar introduced the Agent Centric Development Cycle (AC/DC), a framework built for the age of AI, with four continuous stages: Guide → Generate → Verify → Solve. Today, we are excited to announce the beta of Sonar Context Augmentation to help agents in the Guide stage of AC/DC.

What is Sonar Context Augmentation?

Sonar Context Augmentation is a service that injects real-time, deep knowledge from SonarQube directly into your AI agent’s workflow. It uses the SonarQube MCP Server to act as a bridge between your enterprise codebase and your AI coding tools.

By providing this "repo-aware" context, Context Augmentation helps AI coding agents understand the specific environment they are working in before they ever generate a line of code.

How Sonar Context Augmentation works

Sonar Context Augmentation provides the exact, filtered information an AI agent needs to get the job right on the first try:

  • Dynamic context guidelines: Instead of overwhelming an agent with thousands of rules, Context Augmentation identifies the most relevant coding standards based on what you are asking and the history of the specific files being modified.
  • Architectural awareness: It gives the agent a structural map of your code, including class hierarchies and function flows, so it respects your intended code architecture and avoids creating technical debt.
  • Smarter search: Agents can find specific code sections using exact signatures and body patterns rather than simple text matches, leading to more accurate modifications.

Why context matters

When an agent has the right context, the agentic output is more accurate, faster, and carries less risk for long-term architectural drift. Experience increased build pass rates, increased test pass rates, significantly reduced code duplication, and reduced cognitive complexity. All of this matters for achieving the real productivity promise of AIgen code.

Our benchmarking also shows that when an agent has the right context, it doesn't just write better code—it works more efficiently. Organizations using Context Augmentation can expect to see reduction in token usage, tool calls, and overall AI operating costs, in particular when working in complex code bases.

By defining the "rules of engagement" upfront, developers spend less time fixing AI-generated code errors and more time shipping high-quality software.

Try it out during our beta

The Sonar Context Augmentation beta is available starting today. To participate, you will need:

  • SonarQube Cloud Team or Enterprise annual or monthly plan
  • SonarQube MCP Server
  • An AI agent like Cursor, GitHub Copilot or Claude Code
  • Any language project to leverage intelligent guidelines
  • A Java, C#, Python, JavaScript or TypeScript project to leverage architectural awareness (intended architecture must be set configured for the project to leverage your intended architecture)

NOTE: Context Augmentation only supports projects using CI-based analysis. Projects using Automatic analysis in SonarQube Cloud will not work with Context Augmentation.

For detailed steps to set up Sonar Context Augmentation see our documentation. We hope you will try it out during the beta and explore how agents like Cursor and Claude Code can follow your organization’s specific standards from the first prompt.

Thanks!

Build trust into every line of code

Rating image

4.6 / 5