Classical Sunni sources preserve reports that shortly before Ali ibn Abi Talib, may Allah be pleased with him, was attacked, he saw the Prophet Muhammad, peace and blessings be upon him, in a dream and complained of the hardship and contentiousness he had faced from his people. A fuller al-Ajurri version says the Prophet told him to supplicate, after which Ali prayed that Allah replace his people for him with better people and replace him for them with someone worse than him. The narration then moves directly to the same morning in which Ali went out for prayer and was struck. The report has multiple classical routes and later reception, but important chain weaknesses and a textual ambiguity in a parallel route require cautious presentation.
Ali’s supplication in this fuller account is severe and closely tied to his circumstances. He asks Allah to replace his people for him with those better than them and to replace him for them with one worse than him. The narration then moves directly into the morning prayer setting. Ali goes out, calls the people to prayer, and is attacked. In the way the report is arranged, the dream, the supplication, and the assault form one continuous final sequence.
The same core story also appears in shorter classical forms. Ibn Abi al-Dunya and al-Lalaka'i preserve a version through Amr ibn Hashim al-Janbi from Abu Janab al-Kalbi. Al-Lalaka'i includes the event in his section on the karamat of Ali, which shows how the report was understood in later Sunni devotional and biographical reception. Ibn Asakir, Ibn Kathir, and other later authors also preserve the dream and its connection with Ali’s final day.
The transmission evidence, however, is not uniform. Amr ibn Hashim al-Janbi is described as weak or not strong, and Abu Janab al-Kalbi is also weak in hadith and known for tadlis. Al-Ajurri’s fuller route removes Amr ibn Hashim and has Abu Janab explicitly say that Abu Awn told him, which reduces the tadlis concern at that particular link, but Abu Janab’s general weakness remains.
A separate report in Musnad Abi Ya'la gives additional support to the core idea that Ali saw the Prophet in a dream shortly before his killing and complained of what he had suffered from the community. Al-Haythami says the men of that route are trustworthy, while also warning that the transmitted wording appears to contain a narrator or pronoun problem affecting the exact attribution of the dreamer.
The strongest evidence-based conclusion is therefore cautious. Classical Sunni sources do preserve a dream-before-death report in which Ali complains to the Prophet, peace and blessings be upon him,, a fuller route preserves his subsequent supplication, and the narrative connects this directly with the morning of his attack. The report is stronger than a single isolated weak chain, but its exact wording and route structure do not justify presenting it as an unqualified sahih event or as formal revelation. It is best treated as a classically transmitted karamah and foretelling report with clear source-level caution.
Conclusion
Classical Sunni sources preserve a report that Ali ibn Abi Talib saw the Prophet, peace and blessings be upon him, in a dream shortly before his final attack, complained of his people's conduct, and in a fuller version made a supplication immediately before the morning in which he was struck. The report has meaningful multi-route support and classical karamah reception, but its chain and wording cautions require a qualified presentation.