After the Sui Dynasty was shaken, the gate forces around the country rose in succession, waiting for an opportunity to seize territory. In order to protect themselves, at the suggestion of the villagers, Zhang Shigui also revolted. In my hometown, I opened up my own sphere of influence and became famous in one fell swoop. After Li Yuan, Duke of Sui and Tang Dynasties, rose in Shanxi, his strength grew rapidly, and prominent local forces from all over the country went to join the army. At this time, Zhang Shigui also actively participated in the anti-Sui forces led by Tang Gaozu.
After investigation, Li Yuan trusted Zhang Shigui and ordered him to lead troops to occupy and defend Henan. In this way, Zhang Shigui's military command ability has been actively exercised, and he has been loyal to Tang Gaozu guarding the east of Chang 'an. Later, Tang Gaozu put Zhang Shigui under the jurisdiction of Li Shimin. Under the unified command, he took an active part in quelling the mutiny of Xue Ju and his son, and took an active part in the war against the king. He is famous for defeating Wang's 50 thousand army with a small number of troops. During the Xuanwumen Revolution, Zhang Shigui actively supported Li Shimin and became one of the few confidants in Li Shimin.
However, in the later war against Koguryo, he was gradually laughed at because his fame was not as good as that of his subordinate Xue. Slowly, this positive image was portrayed by people bit by bit as a treacherous villain.