Silk is a unique, remarkably strong biomaterial made of simple protein building blocks. To date, no synthetic method has come close to reproducing the properties of natural silk, due to the complexity and insufficient understanding of the mechanism of the silk fiber formation. Here, we use a combination of bulk analytical techniques and nanoscale analytical methods, including nano-infrared spectroscopy coupled with atomic force microscopy, to probe the structural characteristics directly, transitions, and evolution of the associated mechanical properties of silk protein species corresponding to the supramolecular phase states inside the silkworm’s silk gland. We found that the key step in silk-fiber production is the formation of nanoscale compartments that guide the structural transition of proteins from their native fold into crystalline β-sheets. Remarkably, this process is reversible. Such reversibility enables the remodeling of the final mechanical characteristics of silk materials. These results open a new route for tailoring silk processing for a wide range of new material formats by controlling the structural transitions and self-assembly of the silk protein’s supramolecular phases.