Halogens play important roles in fluid activity and mass transfer in subduction zones. A systematic study of whole-rock and mineral F and Cl concentrations was carried out for a series of blueschists, high-pressure (HP) eclogites and ultrahigh-pressure (UHP) eclogites from the Chinese southwestern Tianshan. The whole-rock and mineral element compositions, phase equilibrium modeling and apatite U–Pb dating and element data were combined. The results are used to constrain halogen storage and transport in the subducting oceanic crust. The fluorine contents decrease from the blueschists to the UHP eclogites, whereas the Cl contents increase from the blueschists and HP eclogites to the UHP eclogites. Combined with the halogen compositions of their possible protoliths, it is inferred that most of the Cl was lost, whereas F was retained during subduction of the oceanic crust to the blueschist facies. Minerals in the UHP eclogites exhibit elevated Cr and Co contents and Ba/Th ratios, indicating that the infiltration of serpentinite-derived fluids resulted in Cl enrichment in the UHP eclogites. Reconstruction of whole-rock F and Cl contents from mineral models and halogen concentrations indicates continuous F and Cl loss from the subducting oceanic crust during prograde metamorphism from the blueschist to the UHP eclogite facies. The F loss from the subducting oceanic crust is consistent with the decreases in F contents in glaucophane, phengite and apatite. Apatite hosts 70–77% of the F in the rock and thus is the main F-host mineral in the subducting oceanic crust. Due to the different behaviors of F and Cl, the fluids released from the subducting oceanic crust had low F/Cl ratios before the blueschist facies but high F/Cl ratios during prograde metamorphism from the blueschist- to the UHP eclogite-facies. The UHP eclogites metasomatized by serpentinite-derived fluids exhibit significantly higher Cl contents and comparable F contents relative to the UHP serpentinites. This difference suggests that halogen-enriched UHP eclogites are important carriers of volatiles at subarc depths and beyond. Changes in the halogen composition of the subducting oceanic crust and the halogen flux between different lithologies in the subduction channel significantly affect element solubility in metamorphic fluids and thus mass transfer from the subducting slab to the overlying mantle wedge.