This article investigates consonant gemination in late Nineteenth-and early Twentieth-century haketía, a now moribund, regional dialect of Judeo-Spanish spoken in northern Morocco since the late fifteenth century. Some, but not all, consonant clusters arising across a word boundary undergo regressive total assimilation, e.g. [n.n] siudad ninguna 'no city' but [z.n] laz niñas 'the girls'. We present novel descriptive generalizations to show that regressive gemination is sensitive to the degree of sonority distance between the coda and the onset. Evidence of parasitic harmony comes from lateral+consonant clusters, which undergo gemination only if the target and trigger consonants are already similar in some respect. In the framework of Optimality Theory, we formalize syllable contact as a relational hierarchy of ∗Distance constraints and capture parasitic harmony effects by similarity avoidance, or Obligatory Contour Principle, constraints against adjacent consonants with identical manner and/or place features. These markedness constraints interact with other universal faithfulness and markedness constraints in a language-specific ranking that predicts the attested patterns of regressive gemination. This study lends further support to sonority distance effects and gradient syllable contact in phonological theory and shows that similarity avoidance is also necessary to give a full account of regressive gemination in Moroccan Judeo-Spanish.