Potassium-ion capacitors (PICs), skillfully combining the features of batteries and capacitors, hold promise in energy conversion and storage. Cobalt sulfide (CoS2) anode are promising alternatives due to its high theoretical capacity and excellent potassium storage capacity. However, severe volume changes of CoS2 anode leads to capacity decline and poor cycle stability, hindering its application in PICs. Herein, we successfully confine CoS2 nanoparticles in N-doped coal-based carbon fibers (CoS2/CF). Coal-based carbon fibers with flexible characteristic elevate the conductivity and relieve the volume expansion of CoS2. Moreover, the high content of edge nitrogen as active sites further enhances the electrochemical properties. The PICs with flexible CoS2/CF-0.8 as anode exhibits superior specific capacity (331.1 mA h g−1 after 150 cycles at 0.1 A g−1) and long cycling (214.1 mA h g−1 after 900 cycles at 1.0 A g−1). Ex-situ X-ray powder diffraction (XRD) reveal that the mechanism of CoS2/CF-0.8 anode is based on reversible intercalation and conversion reaction. Importantly, CoS2/CF-0.8||activated carbon (AC) devices shows excellent energy density (101.9 W h kg−1) and long cycling (82.23% capacity maintenance rate after 1000 cycles). This work offers insights for other materials with high theoretical capacity but volume expansion problem.