How to write disallow paths for comments when their urls keep on changing

There is only one web page here. The hash and text beyond it are a named anchor, which points to a specific location on that page. If you click one it will load the page /post/ and then scroll down to comment 12 or 13 or whichever one you clicked.

Search engines will just load the whole page. They are smart enough to not try to load a named anchor as if it were a separate page. (However, note that there are a couple of old web frameworks that abused the anchor to create actual separate "pages" in a single-page app. This approach has been largely abandoned due to the variety of problems it caused, but your site doesn't appear to be one of these.)

You don't need to do anything in robots.txt.