It is said that since the death of Chancellor Zhuge Liang, Liu Shan, the later ruler of Shu Han, increasingly neglected state affairs. The eunuch Huang Hao, originally a commandant of light chariots, gradually gained favor and power through his skill in discerning Liu Shan's intentions and his flattering words. All major and minor state affairs in the court had to pass through Huang Hao's hands; bribery became rampant, and discipline collapsed. General Jiang Wei, carrying on the legacy of Marquis Wu (Zhuge Liang), launched annual northern expeditions against Cao Wei; although there were victories and defeats on both sides, Shu Han's national strength gradually declined, and with Huang Hao monopolizing power in the court, there were many constraints. Jiang Wei was deeply worried and submitted several memorials, pointing out that Huang Hao was treacherous and evil, and deserved execution.
Liu Shan only said, 'Huang Hao is merely a minor eunuch; I know his character well; why worry about him?'
Jiang Wei's earnest remonstrations went unheeded; instead, Huang Hao became even more arrogant. Huang Hao's partisans spread throughout the court and the countryside; anyone who wished to speak to Liu Shan first had to probe Huang Hao's intentions. If their views did not align, they would obstruct and undermine them in every possible way. Wise ministers in the court, such as Zhuge Zhan and Dong Jue, were all feared by him. Jiang Wei once strongly urged Liu Shan, saying that Huang Hao, having been in the palace for a long time, might cause great disaster, and wanted to send him out. After learning of this, Huang Hao tearfully told Liu Shan, 'I have received great favor from Your Majesty; how dare I have any other thoughts? It is the general who wants to trap me in disloyalty!'
Liu Shan believed his words and instead blamed Jiang Wei for meddling.
It is said that from then on, Huang Hao became even more favored and wielded power that overshadowed the entire court. Loyal ministers and righteous men in the court, seeing his great influence, dared to be angry but dared not speak. Jiang Wei saw Shu Han deteriorating day by day, with deep internal troubles, and was burning with anxiety. At that time, the great generals of Cao Wei, Deng Ai and Zhong Hui, guarded the borders, waiting for an opportunity to act. Jiang Wei knew well that with powerful enemies watching from outside and treacherous villains disrupting the government from within, if Huang Hao were not removed, the state would not survive. However, Liu Shan was weak-willed and trusted slanderous words; Jiang Wei's repeated remonstrations were all ineffective.