It depends on the type of Claris you have. Not all Claris real derailleurs are equal. The compatibility can be found in Shimano product descriptions where the recommended range is written.
The current line is Claris R2000. It comes in two variants. Short cage RD-R2000-SS and medium cage RD-R2000-GS.
The difference is not big, the short cage has a sprocket size range 25T-32T and the medium one 28T-34T.
The conclusion is that a 34T sprocket will likely work for both, but for the medium cage derailleur the shifting is guaranteed to be good while for short cage it might be just acceptable.
Theoretically, one could even think of trying a 36T cassette on the medium cage derailleur, but there is none such 8-speed cassette available as far as I am aware.
BTW, it is not very easy to recognize which of these two one owns if it is not explicitly written in the bike description. They often just write Claris RD-2000.