Here, we initiate a program to study relationships between finite groups and arithmetic–geometric invariants in a systematic way. To do this, we first introduce a notion of optimal module for a finite group in the setting of holomorphic mock Jacobi forms. Then, we classify optimal modules for the cyclic groups of prime order, in the special case of weight 2 and index 1, where class numbers of imaginary quadratic fields play an important role. Finally, we exhibit a connection between the classification we establish and the arithmetic geometry of imaginary quadratic twists of modular curves of prime level.