Cells can sense the density and distribution of extracellular matrix (ECM) molecules by means of individual integrin proteins and larger, integrin-containing adhesion complexes within the cell membrane. This spatial sensing drives cellular activity in a variety of normal and pathological contexts. Previous studies of cells on rigid glass surfaces have shown that spatial sensing of ECM ligands takes place at the nanometre scale, with integrin clustering and subsequent formation of focal adhesions impaired when single integrin-ligand bonds are separated by more than a few tens of nanometres. It has thus been suggested that a crosslinking adaptor' protein of this size might connect integrins to the actin cytoskeleton, acting as a molecular ruler that senses ligand spacing directly. Here, we develop gels whose rigidity and nanometre-scale distribution of ECM ligands can be controlled and altered. We find that increasing the spacing between ligands promotes the growth of focal adhesions on low-rigidity substrates, but leads to adhesion collapse on more-rigid substrates. Furthermore, disordering the ligand distribution drastically increases adhesion growth, but reduces the rigidity threshold for adhesion collapse. The growth and collapse of focal adhesions are mirrored by, respectively, the nuclear or cytosolic localization of the transcriptional regulator protein YAP. We explain these findings not through direct sensing of ligand spacing, but by using an expanded computational molecular-clutch model, in which individual integrin-ECM bonds-the molecular clutches-respond to force loading by recruiting extra integrins, up to a maximum value. This generates more clutches, redistributing the overall force among them, and reducing the force loading per clutch. At high rigidity and high ligand spacing, maximum recruitment is reached, preventing further force redistribution and leading to adhesion collapse. Measurements of cellular traction forces and actin flow speeds support our model. Our results provide a general framework for how cells sense spatial and physical information at the nanoscale, precisely tuning the range of conditions at which they form adhesions and activate transcriptional regulation.