It is transmitted in Sharh as-sunna that Safwan b. Umayya came to Medina and slept in the mosque, using his cloak as a pillow. A thief came and took his cloak and Safwan seized him and brought him to God’s Messenger who ordered that his hand should be cut off. Safwan then said, "This was not my intention. I give it to him as sadaqa.” God’s Messenger replied, "Why did you not do so before bringing him to me?”
Ibn Majah transmitted something similar on the authority of ‘Abdallah b. Safwan who quoted his father’s authority, and Darimi did so also on the authority of Ibn ‘Abbas.
Abu Salama quoted Abu Huraira’s authority to the effect that God’s Messenger said regarding a thief, "If he steals cut off his hand, if he steals again cut off his foot, if he steals again cut off his hand, and if he steals again cut off his foot.”
He reported the Prophet as saying, “Cutting off the hand is not to be inflicted on one who is treacherous, one who plunders, or one who snatches something.”
Tirmidhi, Nasa’i, Ibn Majah and Darimi transmitted it.