Whilst building a wooden step and re-laying the surrounding laminate flooring, I managed to break the shaft of a small hammer.
I ordered a replacement handle and used a pin to drift out the remainder of the old handle. There is a small wedge that holds the handle in place so I was careful not to misplace that.
The new handle needed to be shaped to fit the hole in the head of the hammer so I used a spokeshave to trim this down to size. You could use a chisel for this task if that’s all you have.
Once the handle was fitting in the head, I cut a slot using a tenon saw, parallel to the direction of striking. Looking at that last picture, the slot is from left to right.
I applied a few coats of varnish to give the handle some protection and as the wood finish was a little rough I also gave it a sand with some fine sandpaper.
The last step was to refit the head and tap the wedge into place.