Hydrogels, essential biomaterials in bioengineering, face challenges of undesirable swelling in applications requiring stable dimensions. This study presents a novel anti-swelling hydrogel using a cyanobenzothiazole (CBT)-cysteine (Cys) click reaction, inspired by luciferin chemistry. By functionalizing 4-Arm PEG with CBT and synthesizing N-terminal cysteine-terminated ethylenediamine precursors, gels are formed under mild conditions, avoiding harsh reagents or catalysts and ensuring compatibility with physiological environments. The resulting hydrogels benefit from enhanced cross-linking density and elastic retractive force due to hydrogen bonding and π-π stacking within the network, which effectively resists polymer-water interactions. Therefore, the CBT-Cys PEG hydrogel exhibits significant anti-swelling properties in water, PBS, and extreme pH environments. Additionally, they demonstrate excellent mechanical strength, self-healing ability, and biocompatibility. This simple, scalable method offers a versatile platform for developing anti-swelling hydrogels with broad potential in biomedical engineering.