Stellarion
Tools

stellarion_dependency_drift [Pro]

Detect dependency changes for modified files
This is a Pro tool. Requires a Stellarion Pro license. A 180-day free trial starts automatically.

Detects how dependencies have changed for a set of modified files. Reports new dependencies added, dependencies removed, fan-out increases or decreases, and circular dependency status. Compares the current state against the previously indexed graph.

When to Use

  • After modifying files to verify no unintended dependencies were introduced
  • During code review to spot dependency creep
  • To detect accidental circular dependencies before they are merged
  • As part of a post-refactor validation step

Parameters

ParameterTypeRequiredDefaultDescription
filesarray of stringsYesAbsolute paths to the files to check for dependency changes

Examples

Check dependency changes after editing

I just modified src/services/payment.ts and src/services/order.ts — did I introduce any new dependencies?

Reports any new imports, removed imports, and whether fan-out increased.

Detect circular dependencies

Check if my changes to src/core/ introduced any circular dependencies.

The agent collects the changed files in src/core/ and passes them to the tool.

Post-refactor validation

I moved code from utils.ts into helpers.ts. Check for dependency drift.

Detects whether the move changed the dependency graph in unexpected ways.

Output Format

For each file analyzed:

  • New dependencies — modules this file now imports that it did not before
  • Removed dependencies — modules this file no longer imports
  • Fan-out change — increase or decrease in the number of outgoing dependencies
  • Circular dependency status — whether any new circular dependencies were introduced, with the full cycle path if so

Summary

  • Total new dependencies across all files
  • Total removed dependencies
  • Net fan-out change
  • Circular dependencies introduced (count and paths)

Tips

  • Run this after every significant edit session to catch dependency creep early
  • A fan-out increase is not always bad — but consistent increases across many files signal growing coupling
  • Circular dependencies are flagged with the full cycle path (e.g., A -> B -> C -> A) so you can decide where to break the cycle
  • Pair with stellarion_assess_change_risk before making changes and stellarion_dependency_drift after to get a before-and-after picture
  • Re-index changed files first (stellarion_index_files) if you want the drift analysis to reflect your latest edits