I had a similar problem in a friend's old house, where hammering problem became a problem after they had a new kitchen & bath installed,
One thing was clear, there was no such noise problem before the new kitchen and bath went, it only became prominent after the builders finished kitchen and bath and were gone and couldn't figure out what was causing their problem, they were pointing it to the rest of the installation that should also be replaced!
However, the cause was quick closing of 1/4 turn sink taps, abruptly closing of washing machine filling solinoids, including sudden closing of toilet flush which used this new style pressure assisted servo valve on its flush, (the modern ones which uses the smaller float, so I was called to help them alliviate this irritating thud and clonky noise!
So I experimented by adding a long vertical copper pipe that just ran empty, with trapped air all the way to the top, just one 3m length, and the end was capped using a compression joint so that in future if any water filled into it, then it can be vented. This acted as a home made shock absorber and it stopped the hammer noise.
The end capped standard water copper tube running vertically will not allow water to enter it accept under pressure from the water mains, this will compress the aior trapped above in the pipe, so I guess the water will enter a certain distance up, compressing the trapped air, which absorbs a sudden pressure surge, so it is cheap surge arrester home baked style!
But remember, the prime reason the noise occurs is due to pipes bending or moving due to this sudden closing of water taps, causing a water hammer, which must occur in all installations, but only those will make noise where the pipes are not clipped firmly to the surface they are running along, although this old house did not have any problem before, that is before they upgraded a new kitchen that used 1/4 turn taps, and new bath etc, so the older unclipped installation did not produce any hammering as the older taps and toilet flush used slow closing valves or multiturn taps.
Washing machines may not always cause a hammer even though they have a solinoid valve that closes abruptly, this can be put down to the fact they are connected to the mains via a rubber hose, which can absorb some shock as rubber can stretch to absorb a surge, but then you might ask why is the washing machine causing this hammering now? Oh well that can be explained down to the fact the new washing machine came with sturdy nerw hose, which probably did not stretch as much as the older hose that must have seen better days and more flexible due to its age! .
Try it if you must, if you close any1/4 turn tap gently, this will not produce any hammering, so it is all to do with a sudden closing of flow, kinetic energy stored in flowing water!
Hey i love explaining! Can you imagine a water pipe let us say 30 meters long carrying water at a very high velocity! that is when your tap is fully opened, so imagine that length of 30 meter long train of water jetting through that pipe at say 2 meters per second! and if you now try to stop it suddenely! what is going to give in? correct compression joints and pipes will flex and bend and oscillate with energy trying to dissipate!