Negative commandment · Lo Ta’aseh #38 of 613
Not to seek information from the dead in dreams
שלא לשאול בחלום מן המתים
The verse · Devarim 18:11
וְחֹבֵר חָבֶר וְשֹׁאֵל אוֹב וְיִדְּעֹנִי וְדֹרֵשׁ אֶל־הַמֵּתִים
“or a charmer, or a medium, or a wizard, or a necromancer.”
The Rambam’s words
Not to seek information from the dead in dreams, as [Deuteronomy, ibid.] states: "[There shall not be found among you...] one who attempts to communicate with the dead."
שלא לשאול בחלום מן המתים, שנאמר "ודורש אל המתים" (דברים יח,יא).
Who & when
“And this prohibition is practiced in every place and at all times by males and females.”
Where in the Mishneh Torah
Hilchot Foreign Worship and Customs of the Nations הלכות עבודה זרה וחוקות הגויים