A novel capillary-based micro-battery cell for in situ X-ray powder diffraction (XRPD) has been developed and used to study the initial intercalation and deintercalation of lithium into graphite in a working battery. The electrochemical cell works in transmission mode and makes it possible to obtain diffraction from a single electrode at a time, which facilitates detailed structural and microstructural studies of the electrode materials. The micro-battery cell is potentially also applicable for in situ X-ray absorption spectroscopy and smallangle X-ray scattering experiments. The in situ XRPD study of the initial intercalation and deintercalation process revealed marked changes in the diffraction pattern of the graphitic electrode material. After the formation of the solid electrolyte interphase layer, the d spacing of the diffraction peak corresponding to the 002 diffraction peak of graphite 2H changes nearly linearly in two regions with slightly different slopes, while the apparent halfwidth of the diffraction peak displays a few minima and maxima during charging/discharging. DIFFaX+ refinements based on the initial XRPD pattern and the one after the initial discharging–charging cycle show that the structure of the graphite changes from an intergrown structure of graphite 2H and graphite 3R to a nearly ideal graphite 2H structure. DIFFaX+ was also used to refine a model of the stacking disorder in an apparent stage III compound with AαAB- and AαAC-type slabs.