He is best known for making annotations to the historical text Records of the Three Kingdoms (Sanguozhi) written by Chen Shou in the third century, providing additional details omitted from the original work.
His commentary, completed in 429, became integral to later editions of the Sanguozhi, making the joint work three times as long as the original.
In the early fifth century, Pei served as a Regular Mounted Attendant (散騎侍郎) and later as the prefect (縣令) of Guzhang County.
He was recalled to the imperial court later and was promoted to shangshu ci bu lang (尚書祠部郎; a ceremonial official).
In 416, the Jin imperial court ordered Liu Yu, the Duke of Song, to lead a campaign against the state of Later Qin.
Liu Yu was very impressed with Pei and praised him as a talented person, and then appointed him as zhizhong congshi shi (治中從事史).
Pei took up various appointments in the Liu Song government, including Secretary of the Interior (內史) of Lingling, State Academician (國子博士) and rongcong puye (冗從僕射).
He was promoted to Palace Gentleman Writer (中書侍郎) and Grand Judge (大中正) of Si and Ji provinces, and was enfeoffed as the Marquis of Xi District (西鄉侯).
His commentary, completed in 429, became integral to later editions of the Sanguozhi, making the joint work three times as long as the original.