From: Rabbi Moshe Sofer
To: Rabbi Yoel
The Chasam Sofer explains the folk reasoning behind placing and slaughtering chickens in a new house as symbolic ransom for the occupants, but firmly discourages any practice lacking a basis in the Talmud and Poskim, noting that R' Yehudah HaChassid himself did not endorse such customs. He further distinguishes between building unnecessarily in exile, which may be spiritually problematic, and building out of genuine communal necessity, which constitutes a mitzvah providing sufficient spiritual protection; he advises inaugurating the house with Torah study and prayer.
Source: Shu"t Chasam Sofer YD §138