Sufism, or Taṣawwuf (Arabic: الْتَّصَوُّف; personal noun: صُوفِيّ ṣūfiyy / ṣūfī, مُتَصَوِّف mutaṣawwif), variously defined as "Islamic mysticism", "the inward dimension of Islam" or "the phenomenon of mysticism within Islam", is mysticism in Islam, "characterized ... [by particular] values, ritual practices, doctrines and institutions" which began very early in Islamic history and represents "the main manifestation and the most important and central crystallization of" mystical practice in Islam. Practitioners of Sufism have been referred to as "Sufis" Historically, Sufis have often belonged to different ṭuruq or "orders" – congregations formed around a grand master referred to as a waliwho traces a direct chain of successive teachers back to the Islamic prophet, Muhammad. These orders meet for spiritual sessions (majalis) in meeting places known as zawiyas, khanqahs or tekke. They strive for ihsan (perfection of worship), as detailed in a hadith: "Ihsan is to worship Allah as if you see Him; if you can't see Him, surely He sees you." Sufis regard Muhammad as al-Insān al-Kāmil, the primary perfect man who exemplifies the morality of God, and see him as their leader and prime spiritual guide.
All Sufi orders trace most of their original precepts from Muhammad through his cousin and son-in-law Ali.
The earliest figures of Sufism are Muhammad himself and his companions (Sahabah). Sufi orders are based on the "bay‘ah" (بَيْعَة bay‘ah, مُبَايَعَة mubāya‘ah "pledge, allegiance") that was given to Muhammad by his Ṣahabah. By pledging allegiance to Muhammad, the Sahabah had committed themselves to the service of God.
Verily, those who give Bai'âh (pledge) to you (O Muhammad) they are giving Bai'âh (pledge) to Allâh. The Hand of Allâh is over their hands. Then whosoever breaks his pledge, breaks it only to his own harm, and whosoever fulfils what he has covenanted with Allâh, He will bestow on him a great reward. — [Translation of Quran, 48:10]
Sufis believe that by giving bayʿah (pledging allegiance) to a legitimate Sufi shaykh, one is pledging allegiance to Muhammad; therefore, a spiritual connection between the seeker and Muhammad is established. It is through Muhammad that Sufis aim to learn about, understand and connect with God. Ali is regarded as one of the major figures amongst the Sahaba who have directly pledged allegiance to Muhammad, and Sufis maintain that through Ali, knowledge about Muhammad and a connection with Muhammad may be attained.
Practitioners of Sufism hold that in its early stages of development Sufism effectively referred to nothing more than the internalization of Islam. According to one perspective, it is directly from the Qur'an, constantly recited, meditated, and experienced, that Sufism proceeded, in its origin and its development. Other practitioners have held that Sufism is the strict emulation of the way of Muhammad, through which the heart's connection to the Divine is strengthened.
Sufism had a long history already before the subsequent institutionalization of Sufi teachings into devotional orders (tarîqât) in the early Middle Ages. The Naqshbandi order is a notable exception to general rule of orders tracing their spiritual lineage through Muhammad's grandsons, as it traces the origin of its teachings from Muhammad to the first Islamic Caliph, Abu Bakr.