Sufism as a category or mode of religious practice has been shaped by a variety of influences. As a result, Sufism does not follow one predictable trajectory or appear the same in all places or times. In its earliest stage, Christianity had a clear impact on the practice and explication of Sufism. Always an important social and institutional presence in the Near East and the Byzantine world (territories conquered by the Muslim Armies in the 7th and 8th centuries), Christian asceticism and monasticism was an essential feature of the landscape in which Sufism was formed.
It has been noted that although Sufism was in part a reaction against the wealth and material success of the Muslim world, Sufis always identified as Muslims. In fact, from their perspective, they were keeping an essential aspect of the faith alive, in spite of increasing distance from the original practice of Muhammad and his first followers, the Companions. By taking the term "Islam" literally, they sought to align every aspect of their lives and desires with God's will, an alignment that was generally expressed as a union with God. The extreme version of that expression was in turn taken literally, however, and it was deemed blasphemous by other Muslims who considered the idea of literally becoming "one with God" a heresy.
According to contemporary scholar Fazlur Rahman, it was not just Christianity that influenced Sufism, but Judaism , Gnosticism, Buddhism , and Zoroastrianism as well. Examples of Gnostic interpretations include mystical interpretations of scripture, which had long been in use by Jewish exegetes in the Talmud. Expansive worldviews incorporating competing forces of good and evil, or divine and earthly, likewise have a long genealogy in the ancient religions of the Near East. Gnosticism, a term that denotes "inner meaning" in general and which has been applied most recently to certain early Christian movements in particular, similarly emphasized allegorical readings of biblical and apocryphal stories. All of these permeated and impacted the thought-world of the medieval Islamic Near East where Sufism developed.
This is not to say that Sufism contributed nothing original to Muslim interpretations of the inner or esoteric religious perspective, or that it is reducible to these elements, but only that it was open to absorbing and reforming elements of all these traditions for its own purposes. This openness has historically been a double-edged sword for Sufism vis-à-vis mainstream Islam. Absorbing the philosophical and artistic (especially poetic and musical) aspects of a tradition like Neoplatonism or Buddhism left Sufis open to critiques of being unislamic. At the same time, the flexibility of Sufism made it popular and contributed to its spread through a variety of cultures. In the later medieval period—the 12th and 13th centuries C.E.—great Sufi thinkers like Abu Hamid al-Ghazali (d. 1111) were still explicating the boundaries of Sufism against these charges.
Resemblances between Hinduism and Sufism have likewise sparked debates among contemporary scholars about the question of influence. Some modern scholars postulate that there are also parallels between the Sufi model of a master and disciple and a guru and disciples. Sufis are led by shaykhs, or teachers, similar in some ways to Hindu gurus. Yet, absent any textual attestation to this type of cultural influence, these types of comparison are fairly superficial when one considers the widespread archetype of teacher-student or master-disciple relationships found in the Quran between Moses and Aaron, or between Khidr and Moses, and within other traditions, including Judaism and Christianity. It is noteworthy that Sufism's earliest practitioners rooted their own sense of their identity in the interpretation of verses of the Quran, and in the life and practice of Muhammad.