Basically, the top part amplifies the piezo. The 4017 counts the pulses, and the wire going to 4013 selects how many claps turn the relay on and off. All those diodes going to R7 make the counter reset after some time set by this resistor, so that it is ready for a new set of claps.
Doesn´t the original circuit have some description?