Abu Khizama said that his father asked God’s messenger, “Tell me whether invocations we invoke, medicine we apply and caution we practise can avert anything God has decreed.” He replied, “They are a part of God’s decree ’
God’s messenger came out with two books in his hands and asked, “Do you know what these two books are?” We replied, “No, messenger of God, unless you tell us.” Of the one in his right hand he said, “This is a book from the Lord of the universe containing the names of those who will go to paradise, as well as the names of their fathers and their tribes. It is completed to the last man, so there will never be any increase or diminution in their numbers.” Of the one in his left hand he then said, “This is a book from the Lord of the universe containing the names of those who will go to hell, as well as the names of their fathers and their tribes. It is completed to the last man, so there will never be any increase or diminution in their numbers.” His Companions asked, “What then, messenger of God, is the good of doing anything if the matter is already decided?” He replied, “Follow a right course and keep as near to it as you can, for the last act of one who is to go to paradise will be an act appropriate for those who go to paradise no matter what he may have done; but the last act of one who is to go to hell will be an act appropriate for those who go to hell no matter what he may have done.” God’s messenger then made a gesture with his hands throwing the books away and said, “Your Lord has decided everything about mankind; a section will be in paradise and a section in the blaze.”
God’s messenger came out to us when we were arguing about God’s decree. He was angry and his face became so red that it looked as if pomegranate seeds had been burst open on his cheeks. He then said, “Is this what you were commanded to do, or was it for this purpose that I was sent to you? Your predecessors perished only when they argued about this matter. I adjure you, I adjure you, not to argue about it.”
Tirmidhi transmitted it, and Ibn Majah transmitted something similar from ‘Amr b. Shu'aib from his father from his grandfather.
Muslim b. Yasar said that when ‘Umar b. al-Khattab was questioned about the verse, “When your Lord took their offspring from the backs of the children of Adam...” 1 he replied that he had heard God’s messenger say when he was questioned about it, “God created Adam, then passed His right hand over his back and brought forth from it his offspring, saying, ‘I have created these for paradise and they will do the deeds of those who go to paradise.’ He then passed his hand over his back and brought forth from it his offspring, saying, ‘I have created these for hell and they will do the deeds of those who go to hell’.” A man asked, “What is the good of doing anything, messenger of God?” to which God’s messenger replied, “When God creates a man for paradise He employs him in doing the deeds of those who will go to paradise, so that his final action before death is one of the deeds of those who go to paradise, for which He will bring him into paradise. But when He creates a man for hell He employs him in doing the deeds of those who will go to hell, so that his final action before death is one of the deeds of those who go to hell, for which He will bring him into hell.”