My kitchen sink faucet would hammer heavily whenever in use. I tracked it down to a leaky side spay wand. The leak would reduce the pressure in the wand so that the side spray diverter valve would switch open and at that point would immediately build up enough pressure to close. Bam Bam Bam Bam....
I took it apart and lubed the o-rings which only slowed the hammer, so the valve body must have a flaw in it. The faucet is a Moen Torrance CA87480. A quick call to Moen and they are sending me a new sprayer, lifetime warranty.