Glucose-6-phosphate (G6P) is a key metabolic molecule that regulates reactive oxygen species (ROS) homeostasis by initiating the pentose phosphate pathway (PPP) to generate NADPH that converts H2O2 to water by providing hydrogen. While both glucose phosphorylation and glycogenolysis result in G6P production, here we show that G6P derived from glycogenolysis, rather than glucose phosphorylation, flows to PPP for ROS clearance in CD8+ memory T (Tm) cells and inflammatory macrophages. Mechanistically, glycogenolysis-produced G1P allosterically induces G6P dehydrogenase (G6PD) binding to glycogen, which together undergo liquid-liquid phase separation (LLPS) and recruit PPP enzymes, resulting in a compartmentalized reaction cascade. Based on mechanistic elucidation, we demonstrated that G1P can act as an antitumor immunotherapeutic agent by modulating memory fitness and maintenance of tumor-reactive CD8+ T cells in mice. These findings revealed a previously unknown function of glycogen metabolism, which is of paramount importance in the regulation of PPP and redox homeostasis in cells.