Mammalian cell behavior is strongly influenced by physical and chemical cues originating from the extracellular matrix (ECM). In vivo, ECM signals are displayed in a spatiotemporally complex fashion, often composed as gradients and in concentration profiles that change in time. Most in vitro models to study the role of ECM signals in regulating cell behavior are limited in capturing this microenvironmental complexity, as they are static and homogeneous. In order to achieve a dynamic control of the physical properties of a hydrogel network, we here designed a chemical scheme to control poly(ethylene glycol) (PEG) hydrogel stiffness in space, time and intensity. Specifically, we combined caging chemistry and Michael-type addition to enable the light-triggered local control of hydrogel crosslinking density. Thiol moieties of one of the reactive PEG macromers undergoing crosslinking were equipped with caging groups to prevent their susceptibility to the counter-reactive vinyl sulfone groups on the termini of the complementary PEG macromers. Thus, the crosslinking density of the hydrogel network could be tuned by uncaging with light which directly translated into differential patterns of hydrogel stiffness. Using this approach, user-defined stiffness patterns in a range of soft tissue microenvironments (i.e. between 3-8 kPa) were obtained and shown to influence the migratory behavior of primary human mesenchymal stem cells (hMSC). Stiffness gradients in the higher range (5.5-8 kPa) were able to elicit durotaxis towards the more densely crosslinked regions, whereas those in the lower range (3-5.5 kPa) showed no significant directional preference in hMSC migration. Our patterning tool should be useful for the manipulation of cell fate in various other contexts.