Typical use cases are implementing changes due to deprecated functionalities, cleaning up code (e.g. renaming variables, removing unused code, or removing debugging statements like
console calls), or detecting secrets/passwords in files. Some libraries and frameworks even provide Codemod transformations to help upgrade a codebase when a feature is deprecated.
astexplorer.net is a great web-based tool to run codemods, conveniently combining all necessary views (i.e. original code, AST, applied codemod, and resulting code) in one window.