Desperate to ensure their son's safety, James and Lily both use a morally ambiguous ritual to split parts of their souls and join them to Harry's. This allows them to communicate with him.

Unfortunately, due to needing to keep Tom beaten down in the little box they've decided to keep him in, they're unable to actively talk with him until he enters Hogwarts, the raw ambient magics in the area replenishing the nearly exhausted stores of the Soul Shards.