He sought refuge with his followers on Mount Mangdang (in present-day Yongcheng, Henan) and maintained secret contact with Cao Shen and Xiao He.
In 209 BC, after the Dazexiang Uprising broke out, the magistrate of Pei County considered rebelling against the Qin dynasty as well, so he heeded Cao Shen and Xiao He's advice to invite Liu Bang back to support him.
Cao Shen defeated the Qin armies led by Xue Guo, Hu Ling and Fang Yu, and was promoted to a high rank by Liu Bang for his contributions.
After the fall of the Qin dynasty, Liu Bang received the title of "King of Han" from Xiang Yu, and was relocated to Hanzhong.
During the Chu–Han Contention, a power struggle between Liu Bang and Xiang Yu, Cao Shen joined Han Xin's army in the campaigns on the northern front.
After the conquest of the Qi kingdom, Cao Shen left Han Xin and returned to Liu Bang's side to join him in resisting Xiang Yu.
In 201 BC, Cao Shen was appointed as chancellor of Qi Kingdom, which was then ruled by Liu Fei (Gaozu's eldest son).
After discussing with a scholar called Gai Gong, Cao Shen was influenced by the Huang-Lao (黃老) school of thought, which used a mix of persuasion and coercion.
In 196 BC, he commanded the Qi forces that assisted the emperor in suppressing Chen Xi's rebellion[3] in Dai (present-day northern Shanxi and northwestern Hebei).
Cao Shen spent his time drinking and feasting, and maintained well Xiao He's system of governance but did not implement any new changes.