Warehouse management is a discipline that has gained importance in recent decades. In the era of the Digital Revolution and Industry 5.0, to enable a company to attain a competitive advantage, it is necessary to identify smart improvement tools that help search for warehouse problems and solutions. A good tool to highlight issues related to layout and resource flows is the spaghetti chart which, besides being used to minimize waste according to lean philosophy, can also be used to assess warehouse safety and reliability and improve the plant sustainability. This article shows how to exploit “smart spaghetti” (spaghetti chart automatically generated by smart tracking devices) to conceive improvements in the layout and work organization of a warehouse, reducing the risk of collision between forklifts and improving the operators’ safety. The methodology involves automatically mapping the spaghetti charts (searching for critical areas where the risk of collision is high) and identifying interventions to be carried out to avoid near misses. “Smart spaghetti” constitutes a valuable decision support tool to identify potential improvements in the system through changes in the layout or in the way activities are performed. This work shows an application of the proposed technique in a pharmaceutical warehouse.