Echolocating bats sense their surrounding by producing high frequency calls and extracting information from the features of returning echoes. Bats modify the directional aim and timing of their sonar calls as they inspect targets and obstacles, and importantly, these inspection behaviors provide a direct readout of their attention to objects. Multichannel recordings from the midbrain superior colliculus and hippocampus of the free-flying bat reveal that neural coding of space is dynamic and modulated by sonar-guided attention.