ABSTRACT. Every rack Q provides a set-theoretic solution c Q of the Yang-Baxter equation by setting c Q : x ⊗ y → y ⊗ x y for all x,y ∈ Q. This article examines the deformation theory of c Q within the space of Yang-Baxter operators over a ring A, a problem initiated by Freyd and Yetter in 1989. As our main result we classify deformations in the modular case, which had previously been left in suspense, and establish that every deformation of c Q is gauge-equivalent to a quasi-diagonal one. Stated informally, in a quasi-diagonal deformation only behaviourally equivalent elements interact. In the extreme case, where all elements of Q are behaviourally distinct, Yang-Baxter cohomology thus collapses to its diagonal part, which we identify with rack cohomology. The latter has been intensively studied in recent years and, in the modular case, is known to produce non-trivial and topologically interesting Yang-Baxter deformations.