A clause can mean a contract. "Claws" is a homophone of "clause". Dogs have claws, and claws can be used to scratch people. It's "in the clause" or "it's in the contract" that the neighbor's dog gets watched as long as it doesn't scratch the person watching it. It's clever that "clause" was used to mean contract because it sounds like "claws", and claws can scratch. The joke is centered on the word "clause" and its homophone "claws".
I agreed to watch my neighbor ' s dog , but only if it didn ' t scratch me . It ' s in the clause .