documentation/docs/guides/codebase-analysis.md
The Developer extension includes an analyze tool that helps you understand code structure, track symbol usage, and explore call graphs across your codebase. It's automatically available when the Developer extension is enabled and supports file types for multiple programming languages.
Prompt:
"Show me the call graph for the authenticate function"
Output:
:::info Desktop
I'll analyze how the authenticate function is used across your codebase.
Based on my analysis, here's how the authenticate function is used in your codebase:
The authenticate function is defined in auth.py at line 15. It takes username and password parameters and handles user authentication.
api.py:25 - The API endpoint that processes login requestsadmin.py:102 - Special authentication flow for admin userstests/test_auth.py:45 - Test case for authenticationdb.py:102 - Checks credentials against the databaselogger.py:45 - Records authentication attemptssecurity.py:78 - Prevents brute force attacksThis shows that authenticate is a central function in your authentication flow, called by multiple entry points and depending on database validation, logging, and security checks.
:::
The analyze tool operates in three modes—Structure, Semantic, and Focus—depending on whether you’re analyzing directories, files, or symbols. Invoke it through natural language or direct commands with parameters.
Get a structural overview of your codebase by analyzing a directory—understand project organization, identify large files, and view codebase metrics.
Natural language:
Direct commands:
# Get overview with default depth (3 levels)
analyze path="src/"
# Get overview limited to 2 subdirectory levels
analyze path="." max_depth=2
Get semantic details for a single file—see its functions, classes, and imports to understand structure and find specific implementations.
Natural language:
Direct commands:
# Get file details
analyze path="main.py"
# Analyze specific file
analyze path="src/utils.py"
Focus on a specific function, class, or method to see where it’s defined and how it’s called across files—useful for refactoring and debugging.
Natural language:
Direct commands:
# Track function usage
analyze path="src/" focus="authenticate"
# Track with deeper call chains
analyze path="." focus="UserClass" follow_depth=3
| Parameter | Default | Description |
|---|---|---|
path | None (required) | Absolute or relative path to the file or directory to analyze |
focus | None | Name of the symbol to track. For cross-file tracking, path must be a directory. |
follow_depth | 2 | How many steps to trace from the focused symbol (0=where defined, 1=immediate callers/callees, 2=their callers/callees, etc.). Used with the focus parameter. |
max_depth | 3 | How many subdirectory levels to analyze when path is a directory (0=unlimited) |
force | false | Receive full analysis results (otherwise, only a warning message is shown when the results exceed 1000 lines) |
If the analysis results exceed 1000 lines, the tool returns a warning message instead of the analysis. Options for managing large outputs:
force=true to bypass the warning and see the full output (may consume significant conversation context)max_depth=1 or max_depth=2 for directoriesmax_depth=1 or max_depth=2 to limit directory traversal depth.gooseignore and .gitignore files to exclude unnecessary files from analysis (like node_modules/, build artifacts, or sensitive files)