We characterize the smallest codimension components of the Hodge locus of smooth degree [Formula: see text] hypersurfaces of the projective space [Formula: see text] of even dimension [Formula: see text], passing through the Fermat variety (with [Formula: see text]). They correspond to the locus of hypersurfaces containing a linear algebraic cycle of dimension [Formula: see text]. Furthermore, we prove that among all the local Hodge loci associated to a nonlinear cycle passing through Fermat, the ones associated to a complete intersection cycle of type [Formula: see text] attain the minimal possible codimension of their Zariski tangent spaces. This answers a conjecture of Movasati, and generalizes a result of Voisin about the first gap between the codimension of the components of the Noether–Lefschetz locus to arbitrary dimension, provided that they contain the Fermat variety.