We present an experimental platform that can be used for investigating lithium-ion batteries with very high spatial resolution. This in situ experiment runs inside a scanning electron microscope (SEM) and is able to track the morphology of an electrode including active and passive materials in real time. In this work it has been used to observe SnO2 during lithium uptake and release inside a working battery electrode. The experiment strongly relies on an ionic liquid which has very low vapor pressure and can therefore be used as an electrolyte inside the vacuum chamber of the SEM. In contrast to common electrochemical characterization tools, this method allows for the observation of microscopic mechanisms in electrodes. Depending on the SEM, resolutions down to 1nm can be achieved. As a result, the experimental platform can be used to investigate chemical reaction pathways, to monitor phase changes in electrodes or to investigate degradation effects in batteries. SnO2 is a potential anode material for future high capacity lithium-ion batteries. Our observations reveal the formation of interface layers, large volume expansions, growth of extrusions, as well as mechanically induced cracks in the electrode particles during cycling.