Claudius is **kneeling in prayer** in the castle chapel (or private oratory) during **Act III, Scene III**.
Hamlet enters unseen, draws his sword, but hesitates because killing a praying man would, in his theology, send Claudius's soul to heaven—depriving Hamlet of the damnation he deems just punishment for his father's "unhouseled, disappointed, unaneled" murder.
This moment encapsulates Hamlet's tragic over-intellectualization: he defers revenge for a "perfect" damnation, allowing Claudius to live—and plot further.