We aim to study stellar collapses at a local scale, in the spirit of the shearing box that has been used extensively to study accretion discs. For this purpose, we develop a local model of a spherically contracting/expanding gas cloud that consists in a spatially homogeneous, periodic box with a time varying aspect ratio, along with a scale factor analogous to that in FRW/Newtonian cosmology relating the box coordinates to the physical coordinates of the global collapse. The energy, density and vorticity in the box also generically increase as a consequence of the collapse. Symmetries and conservation laws reflect either the periodic box modified by the time dependant geometry or are local analogues for symmetries of the global problem. The formalism has been implemented the code ATHENA++ by modifying the Riemann solver with an anisotropic pressure. Excellent agreement is obtained against a number of nonlinear solutions that have been derived accordingly. The box reveals very interesting physics, such as amplification of local unstable flows by the collapse.