Understanding the microscopic mechanisms of electrochemical reaction and material degradation is crucial for the rational design of high-performance lithium ion batteries (LIBs). A novel nanobattery assembly and testing platform inside a transmission electron microscope (TEM) has been designed, which allows a direct study of the structural evolution of individual nanowire or nanoparticle electrodes with near-atomic resolution in real time. In this review, recent progresses in the study of several important anode materials are summarized. The consistency between in situ and ex situ results is shown, thereby validating the new in situ testing paradigm. Comparisons between a variety of nanostructures lead to the conclusion that electrochemical reaction and mechanical degradation are material specific, size dependent, and geometrically and compositionally sensitive. For example, a highly anisotropic lithiation in Si is observed, in contrast to the nearly isotropic response in Ge. The Ge nanowires can develop a spongy network, a unique mechanism for mitigating the large volume changes during cycling. The Si nanoparticles show a critical size of ∼150 nm below which fracture is averted during lithiation, and above which surface cracking, rather than central cracking, is observed. In carbonaceous nanomaterials, the lithiated multi-walled carbon nanotubes (MWCNTs) are drastically embrittled, while few-layer graphene nanoribbons remain mechanically robust after lithiation. This distinct contrast manifests a strong ‘geometrical embrittlement’ effect as compared to a relatively weak ‘chemical embrittlement’ effect. In oxide nanowires, discrete cracks in ZnO nanowires are generated near the lithiation reaction front, leading to leapfrog cracking, while a mobile dislocation cloud at the reaction front is observed in SnO2 nanowires. This contrast is corroborated by ab initio calculations that indicate a strong chemical embrittlement of ZnO, but not of SnO2, after a small amount of lithium insertion. In metallic nanowires such as Al, delithiation causes pulverization, and the product nanoparticles are held in place by the surface Li-Al-O glass tube, suggesting possible strategies for improving electrode cyclability by coatings. In addition, a new in situ chemical lithiation method is introduced for fast screening of battery materials by conventional TEM. Evidently, in situ nanobattery experiments inside TEM are a powerful approach for advancing the fundamental understanding of electrochemical reactions and materials degradation and therefore pave the way toward rational design of high-performance LIBs.