Abu Huraira reported God’s Messenger as saying, “When any of you prays he should not place his sandals at his right or at his left so as to be at the right of someone else, unless no one is at his left, but should place them between his feet.” A version has, “or pray with them on.”
Abu Dawud transmitted it and Ibn Majah transmitted something to the same effect.
While God’s Messenger was leading his companions in prayer he took off his sandals and laid them at his left side; so when the people saw that, they removed their sandals. When he had finished his prayer he asked, "What made you remove your sandals? They replied, “We saw you remove yours, so we removed ours.” God’s Messenger then said, “Gabriel came to me and informed me that there was filth on them. When any of you comes to the mosque he should examine, and if he sees filth on his sandals he should wipe it off and pray in them.”
Abu Sa'id al-Khudri said, “I visited the Prophet and saw him praying on a reed mat on which he was prostrating himself.” He said, “And I saw him praying in a single garment with part over his shoulder.”
Shaddad b. Aus reported God’s Messenger as saying, “Act differently from the Jews, for they do not pray in their sandals or their shoes.”*
* Khuff (pl. khifaf), an article of footwear which came up above the ankle. Traditions tell that the Prophet allowed pilgrims to wear the khuff only when unable to procure sandals, but said they must be cut to come below the ankle. Cf. Bukhari, Hajj, 21, 23; Libas, 8, 4, 15, 73.