Yamabushi began as yamahoshi, isolated clusters (or individuals) of mountain hermits, ascetics, and "holy men", who followed the path of shugendō, a search for spiritual, mystical, or supernatural powers gained through asceticism. This path may or may not have had a founder, as the myths surrounding En no Gyōja are numerous and complex; he is quite similar to a Japanese Merlin in this way. Men who followed this path came to be known by a variety of names, including kenja, kenza, and shugenja. These mountain mystics came to be renowned for their magical abilities and occult knowledge, and were sought out as healers or mediums, although Shinto shrines had traditionally reserved this role exclusively for maidens known as Miko.
Most of these ascetics, in addition to their devotion to shugendō, studied the teachings of the Tendai sect of Buddhism, or the Shingon sect, established by Kōbō Daishi in the 8th century. Shingon Buddhism was one of the primary sects of mikkyō (密教) or Esoteric Buddhism, according to which enlightenment is found through isolation, and the study and contemplation of oneself, as well as nature, and esoteric images called mandala. Both the Shingon sect and the Tendai viewed mountains as the ideal place for this sort of isolation and contemplation of nature.