Prime specialization in higher genus I