Sans also has dumb luck on his side, which further adds to his ability to predict exactly what you're gonna do before you can do it. To be fair, he might just go sit in a corner and not do anything, but he has shown to be aware of many things, even when he is asleep.