Every mature codebase has two layers of knowledge. The first is the code itself, like the syntax, the logic, the tests, etc. The second is everything that never gets written down: why the billing module uses a different pattern than the rest of the app, which files always change together, where new API endpoints should go, and what naming conventions the team settled on three years ago. This second layer is what we call codebase intelligence.

Codebase intelligence is the practice of extracting, structuring, and operationalizing the implicit knowledge embedded in a codebase. It turns tribal knowledge into something queryable, enforceable, and available to every developer and every AI tool that touches your code.

Why This Matters Now

The urgency behind codebase intelligence comes from a shift that is already well underway. AI agents are writing production code and generating pull requests, scaffolding features, and refactoring modules at a pace no team could match manually. This is genuinely useful, but it introduces a problem that most teams are only starting to recognize.

AI agents write code without context, which then drifts from the patterns your team has established. The result is bloated and hard-to-maintain AI slop. It compiles and passes tests, sure, but generally feels foreign to your devs and introduces problems that cause problems down the road.

Scrubby exists to solve this problem. When an AI agent has access to Scrubby’s codebase intelligence, it generates code that looks like your team wrote it.

The Three Pillars

Codebase intelligence rests on three foundational capabilities.

1. Domain Discovery

Every codebase organizes around domains, logical groupings of functionality like authentication, billing, notifications, or data ingestion. But these domains are rarely documented explicitly. They emerge organically from how files are structured, how imports flow, and how teams divide ownership.

Domain discovery is the process of automatically identifying these groupings. Rather than relying on a developer to maintain an architecture diagram, Scrubby analyzes the actual structure and produces a map of domains, as well as their boundaries and relationships. This map becomes the foundation for everything else.

2. Relationship Mapping

Code does not exist in isolation. A change to a database migration typically requires a model update. A new API endpoint usually needs a corresponding test and a route registration. These co-change patterns are invisible in the code itself but clearly visible in git history.

Relationship mapping analyzes your repository’s change history to surface these patterns. When a developer or an AI agent modifies a file, relationship data can flag which other files historically change alongside it. This is behavioral analysis drawn from how your team actually works.

3. Convention Extraction

Conventions are usually the hardest form of codebase intelligence to capture because they live in the habits of senior engineers. Conventions like file naming patterns and error handling approaches are rarely enforced by linters and almost never documented comprehensively.

Scrubby’s convention extraction analyzes your codebase to identify these patterns and express them as explicit rules. Once extracted, conventions become enforceable. They can guide AI code generation, power automated code review, and accelerate onboarding for new team members.

How It Differs from Linting and Static Analysis

A reasonable question at this point: how is Scrubby different from what linters and static analysis tools already do?

Linters enforce universal rules. These tools are valuable, but they are generic. They apply the same rules to every codebase, regardless of context.

Static analysis goes deeper into code correctness, catching potential null pointer exceptions, type mismatches, or security vulnerabilities. Again, valuable, but operating on universal patterns rather than your team’s specific conventions.

Scrubby occupies a different layer entirely. It’s not about what is universally correct, it’s about what is correct for your codebase. Your team might have a perfectly valid reason for structuring error handling differently in the payments module than in the notifications module. A linter cannot know that. Scrubby can, because it’s developed its codebase intelligence from the patterns your team has actually established.

Think of it this way: linting enforces the rules of the language, static analysis enforces the rules of correctness, and Scrubby enforces the rules of your team.

Putting It Into Practice

Scrubby is the key implementation of codebase intelligence. It connects to your repository and extracts the conventions your team follows. That knowledge is then made available in two ways: as an MCP server that gives AI coding agents real-time access to your codebase context, and as a GitHub App that reviews pull requests against your actual patterns rather than generic rules.

Where to Go from Here

Codebase intelligence is still an emerging practice, but the need for it is growing fast. As AI agents take on more of the code generation workload, the teams that will ship the most reliable software are the ones that give those agents the deepest context about their codebases.

Read our full guide to codebase intelligence for a deeper exploration of the concepts, patterns, and architecture behind this approach.