Organic redox-active carbonyl-based polymers are intensively explored as promising high-capacity cathode materials for lithium and sodium batteries. In spite of many inspiring reports that appeared in the field, practical implementation of this group of materials is restricted severely by their poor operational stability. In the present report, we address the capacity fading problem in the recently reported lithium-polyimide batteries. We show experimentally that cathode degradation becomes less pronounced at high charge/discharge current rates, suggesting the involvement of some intermediate redox species in the failure process. Replacing a standard liquid electrolyte with the polymer formulation entirely suppresses the degradation and results in a stable battery performance over 800 cycles. DFT calculations have revealed that the investigated polyimide undergoes fragmentation to low molecular weight species via the rupture of N-N bonds in the main polymer chain during lithiation. Strong 3D coordination bonding involving Li, O, and N atoms preserves the integrity of the cathode structure, which can undergo reversible transition to the initial polymeric state and restore the N-N bonds between the repeating units during lithium removal upon oxidation. However, solvation of the intermediate low molecular weight species results in their disintegration from the cathode composite leading to capacity fading of the battery. The achieved insight into the electrochemical behavior of the investigated model polyimide structure provides very useful guidelines for designing novel cathode materials with enhanced stability with respect to electrochemical lithium (or sodium) insertion.