Determine list of module dependencies

Is there a canonical way to determine what modules a given workspace depends on? We’re currently looking at .terraform/modules/modules.json, but found that it does not seem to “clean up” over time when removing/renaming modules, despite running terraform init again.
For context, we use this in linting to verify our terraform cloud workspace trigger directories are correct in a TF-monorepo setup (to avoid unnecessary plan runs), so alternatives to achive that in other ways are also valid :slight_smile: