A man caught trying to break into a house claimed that he lived there, a court heard.
Gary Cornelly denies the attempted burglary at a house in Grasmere Road, Gledholt, in the early hours of Monday (Sept 18).
Kirklees magistrates heard that he walked through the front gate and then tried to force open the window with his hands.
The 40-year-old was confronted by a witness and allegedly told him that he lived there and had left some of his belongings inside.
Prosecutor Alex Bozman told magistrates that Cornelly then assaulted the witness after he took a photograph of him, an offence he also denies.
Magistrates sent the case to Leeds Crown Court, where Cornelly will first appear on October 18.
Cornelly, of Church Street in Paddock, was remanded into custody in the meantime.