Water hammering that happens after flushing a toilet might be caused by a malfunctioning fill valve that doesn't shut off entirely or by a fill valve that closes quickly.