Water hammer arrestors are made to be installed right under the the sink between the stop valve and the compression nut. You can purchase these at your local plumbing supplier. They work very well to stop the hanmmer.
Good Luck
Ray VinZant
Master Plumber