Impact Analysis
See what your change affects before you ship it. 8v refs shows every caller, every import, and every file that depends on a symbol or file.
Find references to a function
8v refs authenticate
References to `authenticate`
src/handlers/auth.rs:42 (definition)
pub fn authenticate(req: &Request) -> Result<User, AuthError>
Called by:
src/routes/api.rs:28 let user = authenticate(&req)?;
src/routes/api.rs:55 let user = authenticate(&req)?;
src/middleware/guard.rs:19 match authenticate(&req) {
Referenced in:
src/tests/auth_test.rs:12 use crate::handlers::auth::authenticate;
src/tests/auth_test.rs:18 let result = authenticate(&mock_req);
5 references (4 files)
Find references to a file
See everything that depends on a file:
8v refs src/models/user.rs
References to src/models/user.rs
Imported by:
src/handlers/auth.rs:3 use crate::models::user::User;
src/handlers/profile.rs:2 use crate::models::user::{User, UserProfile};
src/db/queries.rs:5 use crate::models::user::User;
src/routes/api.rs:4 use crate::models::user::UserRole;
Referenced in tests:
src/tests/auth_test.rs:2 use crate::models::user::User;
src/tests/profile_test.rs:1 use crate::models::user::*;
6 references (5 files)
Use cases
Before refactoring — Know exactly what breaks when you rename a function or change a signature. If authenticate has 5 callers, you know the scope of the change.
During code review — Understand the blast radius of a pull request. A change to user.rs that's imported by 6 files is higher risk than a change to a test helper.
Deleting code safely — If 8v refs old_function returns zero references, you know it's safe to delete.
Understanding unfamiliar code — When you land in a new codebase, refs shows you how pieces connect. Start with a function you recognize and trace outward.
How it works
8v refs uses the code index built by 8v init (or 8v search index). It cross-references symbol definitions with their usages across your entire project. The index updates incrementally as files change.
If you get stale results, rebuild the index:
8v search index
With AI
The built-in AI agent uses refs automatically when you ask about code impact:
> What would break if I changed the User struct?
Checking references...
The `User` struct is used in 12 places across 6 files:
- 3 handlers (auth, profile, admin)
- 2 database queries
- 1 API serialization layer
Changing fields would require updates to all of these. The highest risk
is `src/db/queries.rs` which destructures the struct directly.
Next
- Getting Started with Linting — Code analysis rules and configuration
- AI Agents — Use AI to search and explain code