If a creature whose thoughts you are reading moves more than 30 feet away from you, you can no longer detect its thoughts.
CONCENTRATION
The surface thoughts of any creature within 30 feet are revealed to you. This spell also allows you to detect the presence of thinking creatures you cannot see, and you must, either at the casting of the spell or as an action, detect the creature's presence first, if you cannot see it.
You may also use an action to learn the surface thoughts of another creature, or to go deeper into one whose mind you've already touched. By going deeper, you can learn the target's emotional state, what's important to it in that moment, or the pattern of its logic. if you try to look deeper into a creature's mind, it makes a Wisdom saving throw and the spell ends if it succeeds. The creature will also know that you are there, even if it fails the save, and can make an Intelligence check contested by your own Intelligence check at the end of each of its turns to try and end your probing.
The spell works through most barriers except 2 feet of stone, 2 inches of metal, or a thin sheet of lead. This spell does
not work on creatures with Intelligence lower than 4 or ones that cannot use language, instead, you will sense nothing.