Hu was from Yiyang (present-day Tongbai County, Henan). He replaced Wang Ping as overseer of military affairs in Hanzhong after the latter died. During one of Jiang Wei's Northern Expeditions, Hu was ordered to lead a separate force and rendezvous with Jiang's main army at Shanggui (上邽). However, Hu arrived late and Jiang lost the battle against Cao Wei forces. Hu was later ordered to defend Hanzhong together with Wang Han (王含) and Jiang Bin (蔣斌).
Hu was known to be a loyal and dedicated subject, who often presented suggestions to Shu Han's emperorLiu Shan. Zhuge Liang compared Hu to Xu Shu, Dong He and Cui Zhouping, calling them his "expostulating friends", because they often had intellectual debates.