The following incident mentioned in Darus Salām of the late Agha Nūri (r.a.) proves that the deceased person benefits from the good deeds performed by the living on his behalf: The most pious and good-fearing Haji Mulla ‘Ali Tehrani narrates from his father, the late Mirza Khalīl that he said, “In a public bath of Tehran was a servant named ‘Ali Talib who never prayed or fasted. The late Mirza Khalīl says that when he was in Najaf al-Ashraf he saw ‘Ali Talib in his dream and that he had come to Wadi us-Salam, the valley of peace (a part of Barzakh). He was surprised and asked, “How did you reach this elevated position while you neither prayed nor fasted?”
The person replied, “O man! When I died I was tied in iron collar and chains and was being dragged towards punishment when Mulla Muhammad Kermanshahi (a Scholar of Tehran), May Allah (S.w.T.) bestow him a good recompense, appointed someone to perform Hajj in my place and to perform Prayers and fast on my behalf. He gave Zakat on my behalf and restored the rights of those whom I had oppressed. He did not leave out any of the duties that had to be performed on my behalf and saved me from the divine chastisement. May Allah (S.w.T.) give him a goodly reward.” Mirza Khalīl woke up from sleep, filled with terror. He was astonished at this dream. After a few days some people came from Tehran and Mirza Khalīl asked them regarding ‘Ali Talib. They confirmed that the Mulla had compensated for all the duties of ‘Ali Talib. In fact even the names of the persons appointed were identical as the Mirza had seen in his dream Reference : Greater Sins Volume 3