In this paper, preparation and the inhibition properties of a cationic hyperbranched polymer (HBP-HTC) on clay hydration and swelling were researched. The properties of HBP-HTC, including chemical structure, cationic degree, and molecular weight, were investigated by using Fourier transform infrared (FTIR) spectroscopy, nuclear magnetic hydrogen spectroscopy , sodium tetraphenylborate back titration, and gel permeation chromatography. The obtained results indicated that HBP-HTC was a hyperbranched unsaturated polyester amide with a low molecular weight and high cation degree, with corresponding values of 34,730 and 43.26%, respectively. The inhibition properties of HBP-HTC on clay hydration and swelling were evaluated through linear anti-swelling, water flushing, rolling recovery, and core flooding tests. The results showed that HBP-HTC has an excellent anti-swelling and long-term effect. When 1.0 wt % HBP-HTC was added, the initial anti-swelling rate reached 91.58%. After flushing 10 times with water, the anti-swelling rate remained at 85%. The two cutting rolling recoveries exceed 70%, and the permeability damage rate of HBP-HTC to the core was lower, just 7.03%, which indicated that HBP-HTC effectively inhibited the clay hydration and swelling, had an excellent anti-washing capacity, and also reduced the permeability damage to the core in the process of waterflooding. The inhibiting mechanism of HBP-HTC was revealed by FTIR, zeta potential, X-ray diffraction, X-ray photoelectron spectroscopy, scanning electron microscopy, and contact angles tests. The results exhibited that HBP-HTC neutralized negative charges on the surface of clay to compress the electric double layer. Besides, HBP-HTC was strongly adsorbed on the surface of clay particles due to the highly concentrated cations and hydrogen bonds at the end of the molecule and a large number of hyperbranched molecular chains and formed a waterproof polymer film, preventing water invasion of the clay interlayer, inhibiting clay hydration swelling.