The microscopic environment inside a metazoan organism is highly crowded, which makes free space a factor hindering the ability of cells to travel distances or expand the tissue that they build. To cope with this, cells must be able to measure the degree of spatial confinement and adapt their dimensions and behaviors to the available space. Here, we found that cells estimate externally-imposed confinement using their largest and stiffest intracellular component, the nucleus. Cell confinement below a certain threshold compresses the nucleus and expands its envelope area. Unbuffered against area expansion due to slow turnover of constituents, the nuclear envelope becomes stretched. This in turn engages signaling via nuclear membrane stretch-sensitive proteins to the actomyosin cortex, whose vigorous contractions allow cells to minimize their surface and escape the confinement. This mechanism reveals a hitherto unappreciated non-genetic role of the nucleus in guiding cell behaviors when surrounding space becomes restrictive. The advantage of the proposed mechanism is that in contrast to the plasma membrane, nuclear membranes do not participate in constitutive membrane trafficking; their surface area thus fluctuates less. This intrinsic quiescence should privilege them to function as low-noise detectors, to readily discriminate local environmental conditions from internal traffic-induced cell area/tension fluctuations.