From the Why Didn't I Think of That Department, industrial designer Jung Soo Park's Neo magnetic hammer:
But how hard would it be to make one yourself? Get yourself a wood-handle claw hammer, a simple but powerful disc magnet, and some strong glue (the brilliant This to That glue advice website suggests LePage's Metal Epoxy or J-B Weld for adhering metal to wood).
To make an attractive red rubber grip similar to the Neo's, you miiiiiiight try adapting the balloon-dipped glassware DIY project I saw over at Joe's Daily: Find a long, narrow balloon, cut off the top (at an angle) and bottom, and stretch it tightly over the handle. You might want to slather on an adhesive first, and keep in mind that this is an untested idea. So please don't sue me if the hammer goes flying out of its rubber casing.
Alternatively, you could just coat the hammer's handle with magnetic paint. (Apartment Therapy has some helpful advice about magnetic paint here, here and here -- don't forget to read the comments, which have some of the most substantive details.)
For the visually (and entertainment-) oriented, here's Park's cartoon drolly illustrating the problems this solves: