In Vajrayana Buddhism there are the three famous bodhisattvas which represent the essential characteristics of all the buddhas of the ten directions and three times. Manjushri represents wisdom, Avalokiteshvara compassion and Vajrapani power. Vajrapani as caretaker and guardian of all the Tantras is the special deity for removing the various types of obstacles that can arise during intensive practice. Within the Sakya School in general and the Lamdre Tradition in particular Vajrapani in the form of Bhutadamara is the foremost practice for removing obstructions on the path of a practitioner. The practice is found in Kriya, Charya and Anuttarayoga Tantra.
Within Anuttarayoga it arises from the exclusive explanatory tantra to the Hevajra called the Vajrapanjara Tantra (chapter two). The meditation and explanatory teachings are based on the ritual text (sadhana) of the Indian Pandit Trailokyavajra and the teachings coming down through Sachen Kunga Nyingpo, the sons Sonam Tsemo and Dragpa Gyaltsen, and Ngorchen. The standard meditation text is written by Ngorchen Konchog Lhundrub, (1497-1557). The Tibetan commentary most commonly used was written by the great Zhuchen Tsultrim Rinchen and called the Shining Sun. A shorter commentary was written by the Tsarpa teacher Zimwog Lhagsam Zangpo.
Historical Background from the Shining Sun Commentary
"...generally it is said, in the precious Tantras of the great secret Vajrayana there are immeasurable deities of great accomplishment and deities for accomplishing the increase of activities; this is the main [method] of the deity accomplishing the increase of activities, making firm the common attainments. Practicing this is also the method for the arising of the supreme attainment. This is special for pacifying obstacles, daemons, hindrances, bhutas, rakshas, and the like - commonly, and the four maras which are obstructions to enlightenment - [specifically]. All the great superior teachers [of Sakya] say; 'before entering any retreat it is foremost to do the Achala or Vajrapani retreat first.' To elaborate, of the great six [[[Vajrapani]] practices]: the  Powerful Great Wheel [[[Mahachakra]]],  Fierce Garuda,  Dharma Protector for the Benefit of Beings,  Tantra of the Great Stick,  Mantra of the Wrathful Acharya and  the Subduer of Daemons, the latter one, the Subduer of Daemons Bhutadamara is the most well known and found in many Tantras. The [long] Bhutadamara Tantra of 160,000 verses has remained in Oddiyana." [(See Kriya Tantra Toh.747, for the short Bhutadamara Tantra .
"...of the many mahasiddhas to come to Tibet, Acharya Tathagata Rakshita made famous the teachings of the short Charya Tantra of Bhutadamara. In the Vajravali of Acharya Abhayakaragupta there are three mandalas of Bhutadamara, these, extracted from the Tantras contain the essence letters, the long mantra is not taught. Both Trailokyavajra and the Omniscient Buton Rinchen Drub wrote from this Charya Tantra..."
"...now, for the Non-dual Anuttara uncommon explanatory Tantra to the Hevajra, called the Vajrapanjara, it is said; Trailokyavajra's greater and lesser Bhutadamara meditations are based on this - which is found in the Sadhanasamgraha Sadhanamala. For the lineage of Atisha the text is found in the Narthang Gyatsa, a very famous collection of teachings. Also, there are the texts of Ngorchen Konchog Lhundrub and Panchen Drangti who wrote the abridged Sadhanasamgraha. Again, Lhachen Shakya Palwai who actually saw the face of Bhutadamara wrote a meditation and initiation text. From the various meditation texts, that of Ngorchen Konchog Lhundrub is used as the basis for the explanation of the practice." [from the commentary of Zhuchen Tsultrim Rinchen (1697-1774) of Dege Gonchen Monastery].