The Prophet ﷺ shaved his head, as did a group of his companions, while others trimmed their hair.
حلق النبي ﷺ وطائفة من أصحابه، وقصر بعضهم.
Bukhari related it in the Hajj chapter (1729) via Juwayria bin Asma, from Nafi, from Ibn Umar, who mentioned it. Muslim related it in the Hajj chapter (1301) from the hadith of Layth, from Nafi, with the same wording.