Hu Ji was from Yiyang County, Yiyang Commandery, which is located east of present-day Tongbai County, Henan. Little is known about his early life; the first mention of him in historical records was when he was already serving in the Shu Han state during the Three Kingdoms period as a Registrar under Zhuge Liang, the Imperial Chancellor and regent of Shu. In 231, the Shu general Li Yan, who was in charge of logistics during the militarycampaigns against Shu's rival state Cao Wei, failed to ensure that supplies were transported to the frontline in time. He then attempted to fraudulently cover up his failure, but Zhuge Liang discovered the truth. Hu Ji, then holding the position of acting Army Adviser and General of the Household of Illustrious Martial Might, joined Zhuge Liang in petitioning the Shu emperor Liu Shan to strip Li Yan of his appointments and titles. Following Zhuge Liang's death in 234, Liu Shan appointed Hu Ji as zhongdianjun and enfeoffed him as the Marquis of Chengyang Village. When the Shu general Wang Ping died in 248, the Shu imperial court appointed Hu Ji as the Area Commander of Hanzhong to replace Wang Ping, in addition to granting him imperial authority and appointing him as the nominal Inspector of Yan Province. Some years later, he was promoted to Senior General Who Guards the West. In 256, when the Shu general Jiang Wei led Shu forces on a military campaign against Wei, he made arrangements with Hu Ji, who was leading another detachment, to rendezvous with him in Shanggui County. However, Hu Ji did not show up, and Jiang Wei ended up being defeated by Wei forces under Deng Ai's command. Hu Ji was later promoted to Right General of Agile Cavalry. In 258, Jiang Wei deployed Hu Ji, Wang Han and Jiang Bin in Hanshou County, Yuecheng County and Hancheng County to guard against invasions from Wei. Hu Ji died in an unknown year. He was known for being loyal, upright and honest. Zhuge Liang once mentioned that Hu Ji, Cui Zhouping, Xu Shu and Dong He were the only ones among his friends who could criticise him and point out his shortcomings and failures.