because He is antaryāmī,
situated everywhere, in the core of everyone’s heart — SB 10.12.25plugin-autotooltip__small plugin-autotooltip_bigŚrīmad Bhāgavatam 10.12.25
The Supreme Personality of Godhead, Śrī Kṛṣṇa, who is situated as antaryāmī, the Supersoul, in the core of everyone's heart, heard the boys talking among themselves about the artificial python. Unknown to them, it was actually Aghāsura, a demon who had appeared as a python. Kṛṣṇa, knowing this, wanted to forbid His associates to enter the demon's mouth.