Explore the Code Graph
Detailed guide to all graph commands with examples. Read more
The unfault graph commands let you ask structural questions about your codebase. Before making changes, running a migration, or onboarding to unfamiliar code, these queries help you understand what’s there and what might break.
All graph commands run locally against the code graph built during analysis. No network required.
unfault graph impact src/api/auth.pyShows direct and transitive dependents. Use this before refactoring to understand blast radius.
unfault graph function-impact src/api/auth.py:validate_tokenNarrower than file-level impact. Useful when you’re changing a single function, not an entire module.
unfault graph deps src/api/routes/payments.pyShows internal imports and external libraries. Helps you understand the full picture before touching a file.
unfault graph library requestsUseful when migrating dependencies, auditing security vulnerabilities, or understanding how broadly a library is used.
unfault graph criticalReturns files sorted by how many other files depend on them. These are your load-bearing files, the ones where changes have the widest effect.
unfault graph statsA quick overview: file count, function count, total edges, external library usage.
A practical workflow before a significant change:
# 1. Understand how central the file isunfault graph impact src/core/models.py
# 2. See what it depends onunfault graph deps src/core/models.py
# 3. Find files using any libraries involvedunfault graph library sqlalchemyAll graph commands support --json for programmatic use or scripting:
unfault graph impact --json src/api/auth.pyunfault graph critical --json --limit 5unfault graph library --json requestsThis is useful for CI checks, custom tooling, or feeding context to AI assistants.
The review command itself is a form of query: “what patterns in this codebase tend to cause production problems?”
# Everythingunfault review
# Only stability patternsunfault review --dimension stability
# Only performance patternsunfault review --dimension performance
# Detailed output with suggested fixesunfault review --output full
# Machine-readable outputunfault review --output json