> ## Documentation Index
> Fetch the complete documentation index at: https://docs.potpie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Refactor Scope

> Map every dependency before touching a shared service.

Refactoring a shared service with an incomplete dependency tree breaks callers the refactor missed. In a large codebase, the actual scope of a "small" change rarely surfaces from the service itself.

**Ask** maps every dependent across the [knowledge graph](/concepts/knowledge-graph) using the **Node Neighbors** tool, organized by dependency type, so the full impact surfaces before touching a single line.

**Question:**

```
What depends on UserService?
```

**Ask returns:**

* Every class, function, and module that imports or calls `UserService`
* Every call site with its exact file path and line number, organized by dependency type
* Transitive dependencies that could be affected by interface changes

**Ask** maps the full **blast radius** before the refactor begins. [**Build**](/build-flow/build-a-feature) uses the same dependency map to generate a spec and **diff** scoped to every affected file.

Try it yourself on your codebase → [Ask Your Codebase](/tutorials/explore-your-codebase)
