In some examples, an implantable medical device determines that another medical device delivered an anti-tachyarrhythmia shock, and delivers post-shock pacing in response to the determination. The implantable medical device may be configured to both detect the delivery of the shock in a sensed electrical signal and, if delivery of the shock is not detected, determine that the shock was delivered based on detection of asystole of the heart. The asystole may be detected based on the sensed electrical signal. In some examples, an implantable medical device is configured to revert from a post-shock pacing mode to a baseline pacing mode by iteratively testing a plurality of decreasing values of pacing pulse magnitude until loss of capture is detected. The implantable medical device may update a baseline value of the pacing pulse magnitude for the baseline mode based on the detection of loss of capture.