Nanostructured materials such as metal-organic frameworks and perovskites can be tuned toward applications ranging from sensors to photovoltaic devices. Such design requires causal relations between a material’s atomic structure and macroscopic function, which remain elusive. Therefore, we herein introduce strain engineering as a general approach to rationalizing and designing how atomic-level structural modifications induce dynamically interacting strain fields that dictate a material’s macroscopic mechanical behavior. We first demonstrate the potential of strain engineering by designing shear instabilities in UiO-66, leading to counterintuitive behavior. The strain-engineered structures exhibit time- and space-dependent crumple zones that instill flexibility in the rigid material and locally focus the strain, partially preserving the material’s porosity under compression. Secondly, our strain fields help explain stimulus-induced phase coexistence in the flexible CoBDP, DMOF-1(Zn), and MIL-53(Al)-F materials. These examples demonstrate how strain engineering can be adopted to design state-of-the-art materials for challenging applications from the atomic level onward.