The jackhammer sound comes from the water pipes, not the toilet. When the toilet valve shuts off, water slams against the pipes. The water's incompressible makes it possible for the vibrations to be transferred through the pipes to the wall or the toilet.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.