This article studies the origins of Jafr, an apocalyptic, eschatological and occult book attributed to the first Shiʿi imam, ʿAlī ibn Abī Ṭālib (d. 661). While it remains unclear whether Jafr was ever physically composed, it became associated with lettrism (ʿilm al-ḥurūf) in medieval Sunni and Shiʿi literature. Jafr gradually evolved into a crucial component of Islamic occult traditions and influenced various cosmological theories as well as the letter-magic practices of prominent Sunni and Shiʿi occultists. Despite its historical significance, confusion regarding Jafr’s roots, authorship and content in Shiʿi sources from the third to fifth centuries ah persists in scholarship. This article examines various aspects of Jafr in early Shiʿi tradition and sheds light on its status as a key text of messianism, prognostication and apocalypticism.