In the current reform of interest rate benchmarks, a central role is played by risk-free rates (RFRs), such as SOFR (secured overnight financing rate) in the US. A key feature of RFRs is the presence of jumps and spikes at periodic time intervals as a result of regulatory and liquidity constraints. This corresponds to stochastic discontinuities (i.e., jumps occurring at predetermined dates) in the dynamics of RFRs. In this work, we propose a general modelling framework where RFRs and term rates can have stochastic discontinuities and characterize absence of arbitrage in an extended HJM setup. When the term rate is generated by the RFR itself, we show that it solves a BSDE, whose driver is determined by the HJM drift restrictions. In general, this BSDE may admit multiple solutions and we provide sufficient conditions ensuring uniqueness. We develop a tractable specification driven by affine semimartingales, also extending the classical short rate approach to the case of stochastic discontinuities. In this context, we show that a simple specification allows to capture stylized facts of the jump behavior of overnight rates. In a Gaussian setting, we provide explicit valuation formulas for bonds and caplets. Finally, we study hedging in the sense of local risk-minimization when the underlying term structures have stochastic discontinuities.