Use the nameChanged signal of QgsLayerTreeNode class.
from qgis.core import QgsProject def name_changed(node, name): print(f"New Name: {name}") QgsProject.instance().layerTreeRoot().nameChanged.connect(name_changed) It also works on groups. Therefore, you may need to check if it is a layer.
from qgis.core import QgsProject, QgsLayerTreeLayer def name_changed(node, name): if isinstance(node, QgsLayerTreeLayer): # <-- print(f"New Name: {name}") QgsProject.instance().layerTreeRoot().nameChanged.connect(name_changed)