For Zhang's contributions, Emperor Taizong enfeoffed him as the Duke of Changping and made him the commandant at Huai Prefecture (, roughly modern Jiaozuo, Henan). In 631, he was made the imperial censor, and then the minister of palace supplies. He was also created the greater title of Duke of Yu. He served several times as commandants, and in 633, when Emperor Taizong made his favorite son Li Tai, the Prince of Wei, the commandant at Xiang Prefecture (, roughly modern Handan, Hebei) but did not actually send Li Tai to Xiang Prefecture, Zhang was made the secretary general at Xiang Prefecture and effectively the commandant. In 637, his title was changed to Duke of Xun.