Graph-based Codebase Context
How Greptile uses a complete codebase graph to provide context-aware code reviews
Greptile builds a complete graph of your codebase to understand how code changes affect other parts of your system, enabling context-aware code reviews that catch issues traditional tools miss.
Why Codebase Context Matters
Most code review tools analyze files in isolation, missing critical relationships:
Without Context:
With Context:
Codebase Indexing
When you sign up, Greptile builds a complete graph of your repository containing every code element:
Legend: 🔵 Files • 🟢 Functions • 🟡 External calls/variables
Indexing Process
Repository Scanning
Parses every file to extract directories, files, functions, classes, variables
Relationship Mapping
Connects all elements: function calls, imports, dependencies, variable usage
Graph Storage
Stores the complete graph for instant querying during code reviews
How Greptile Analyzes Functions
When reviewing a changed function foo(x)
, Greptile queries the graph to understand:
1. Function Dependencies
2. Function Usage
3. Pattern Consistency
Real-time Graph Queries
Every time a file is reviewed, Greptile queries the pre-built graph:
Why This Approach Works
Complete Context
Reviews consider the entire codebase, not just changed files
Pattern Recognition
Finds inconsistencies and suggests improvements based on existing code
Impact Analysis
Identifies all code that could be affected by changes
The graph-based approach transforms code review from isolated file analysis into comprehensive system understanding, catching issues that would otherwise slip through traditional reviews.