Madtsoiids are among the most basal snakes, with a fossil record dating back to the Upper Cretaceous (Cenomanian). Most representatives went extinct by the end of the Eocene, but some survived in Australia until the Late Cenozoic. Yurlunggur and Wonambi are two of these late forms, and also the best-known madtsoiids to date. A better understanding of the anatomy and palaeoecology of these taxa may shed light on the evolution and extinction of this poorly known group of snakes and on early snake evolution in general. A digital endocast of the inner ear of Yurlunggur was compared to those of 81 species of snakes and lizards with known ecological preferences using three-dimensional geometric morphometrics. The inner ear of Yurlunggur most closely resembles both that of certain semiaquatic snakes and that of some semifossorial snakes. Other cranial and postcranial features of this snake support the semifossorial interpretation. While the digital endocast of the inner ear of Wonambi is too incomplete to be included in a geometric morphometrics study, its preserved morphology is very different from that of Yurlunggur and suggests a more generalist ecology. Osteology, palaeoclimatic data and the palaeobiogeographic distribution of these two snakes are all consistent with these inferred ecological differences.