Now if you make an altar of stones for Me, you must not build it with stones shaped by tools; for if you use a chisel on it, you will defile it.
Moses having gone into the thick darkness, where God was, God there spoke in his hearing only, privately and without terror, all that follows hence to the end of ch. 23, which is mostly an exposition of the ten commandments; and he was to transmit it by word of mouth first, and afterwards in writing, to the people. The laws in these verses related to God's worship. I.
Commenting on Exodus 20:22-26
thou shalt not build it of hewn stone, &c.--that is, carved with figures and ornaments that might lead to superstition.
Thou shalt not build it of hewn stone - Because they were now in a wandering state, and had as yet no fixed residence; and therefore no time should be wasted to rear costly altars, which could not be transported with them, and which they must soon leave.