First off, in the traditional parsing of verses, it's not even a separate verse:
I am the YHVH your God, who brought you out of the land of Egypt, out of the home of slavery; you should have no other gods before me. (Ex 20:2)Though to be fair, verse 12 contains 4 commandments. And verses 7-10 encompass one commandment. So you can't look to the verse as a unit of measure for a commandment here.
But even in the traditional paragraph spacing (petuchot and setumot), "I am YHVH" is grouped with the commands relating to idolatry, i.e. with no break in between, whereas there is a space between all the other commandments. (Interestingly though, there's also a space between "Do not cover your neighbor's house" and "Do not covet your neighbor's wife," making ten separate paragraph sections in total, albeit not matching the traditional Jewish division of commandments.)
Point being, completely apart from the fact that "I am YHVH" doesn't have the wording of a command, neither the verse nor the paragraph particularly lends to the idea that it should be counted as a separate commandment.
And then there's the fact that there are numerous other places in the Torah where "I am YHVH" appears - 4 additional instances of "anochi YHVH" (like our verse) and 28 times as "ani YHVH." Some of these instances even mirror the "who brought you out" language:
"I am YHVH, who brought you out of Ur Kasdim..." (Gen 15:7)And if we say a comparison only applies if "I am YHVH" comes in the context of law and/or covenant language, the last two above verses appear at the end of sections detailing specific laws and speaking in general about keeping "my laws and statues."
"I am YHVH, and I have brought you out from under the burdens of Egypt..." (Ex 6:6)
"I am YHVH, your God, who has brought you out from the land of Egypt to give you the land of Canaan..." (Lev 25:38)
"I am YHVH, your God, who has brought you out from the land of Egypt, from your being slaves..." (Lev 26:13)
Sometimes "I am YHVH" is used as a signature at the end of a legal passage, as in, "Keep my statutes and rules that a person will do and live by them, I am YHVH." (Lev 18:5) Sometimes, as in the Ten Commandments passage, it's a preamble, an introduction.
Scholars talk about "I am YHVH" following the structure of Hittite vassal treaties, where the ruler identifies himself and his deeds as an introduction and justification for the binding legal covenant that follows. And like the two tablets, two copies of the covenant are made - one for the ruler, the other for the vassal.
Like so many other instances of "I am YHVH" throughout the Torah, it appears (if you didn't know anything to the contrary) that "I am YHVH" in the Ten Commandments text is providing a justification for the covenant to follow.
And indeed Jewish tradition is divided as to whether "I am YHVH" should be included as a separate commandment. Some, notably Maimonides, say yes. Others, such as R. Shimon Kiyara ("Behag," Ba'al Halachot Gedolot, 8th C.) and Abarbanel, say no.
For traditional Jewish commentators who don't count "I am YHVH" as a separate command, how do they get 10 commandments? Well, the Torah actually refers to "ten statements" (aseret hadevarim), not "ten commandments." So they can simply take the first statement, "I am YHVH," as an axiom rather than a command, making it 1 axiom plus 9 commandments, totaling 10 statements. There have been others in history who don't count "I am YHVH" and yet still find ways of counting 10 "commandments," but I haven't seen this from traditional Jewish commentators, with the possible exception of Philo ("possible" meaning he's not really a traditional commentator in the rabbinic/Talmudic sense). If anyone has info to impart on this issue, please let me know.
And while we're on the subject of the "ten statements," there are three places the phrase "aseret hadevarim" appears in the Torah. The first is:
"And [Moses] was there with YHVH, forty days and forty nights; he did not eat bread and he did not drink water, and he wrote upon the tablets the words of the covenant, the ten statements. (Ex 34:28)At the beginning of this chapter, Moses is asked to carve two tablets like the first which he broke. And what words, what covenant, was written on the originals?
The first time the tablets are mentioned is Ex 24:12, where Moses is simply told that he'll be given "tablets of stone, and the Torah and the mitzva that I have written." So no hint there about their specific content. The next time is Ex 31:18, where Moses is actually given two "tablets of stone, written with the finger of God." (Note: This is already a full 11 chapters after the Sinai covenant, which had no mention of "tablets," or "ten statements" for that matter.) In Exodus 31, Betzalel and Oholiav are appointed as master craftsmen to supervise the building of the Tabernacle and its vessels. But in the five verses immediately preceding the giving of the tablets, the discussion is about keeping the Sabbath as an "eternal covenant."
So that is indeed a covenant, but nothing resembling "ten statements." Interestingly, Exodus 34 itself offers what scholars have identified as ten statements, sometimes referred to as the "Ritual Decalogue" (as opposed to the "Ethical Decalogue," beginning "I am YHVH"). These include an opening statement about driving out the Canaanite nations, followed by various injunctions involving idolatry, the command to keep Passover, redemption of firstborn animals, keeping the Sabbath and the Feast of Weeks, appearing before God three times a year, not offering sacrifices with leaven, offering first fruits, and not boiling a kid in its mother's milk.
In other words, sandwiched between "Carve yourself two stone tablets" and "he wrote upon the tablets the words of the covenant, the ten statements," is this whole section of various laws. Which on the face of it looks like that's what's written on the tablets!
But let's look at the second and third instances of the phrase "aseret hadevarim":
"And he told you his covenant that he commanded you to do, the ten statements, and he wrote them on two stone tablets." (Deut 4:13)The context here is clearly the Sinai revelation: "Assemble for me my people, and I will make them hear my words... And you stood under the mountain, and the mountain burned with fire... And YHVH spoke to you from the midst of the fire..." (Deut 4:10-12)
The final instance puts it all in one verse:
"And he wrote on the tablets according to the first writing, the ten statements, which YHVH spoke to you on the mountain from the midst of the fire, on the day of the assembly..." (Deut 10:4)To sum up, we have a set of "something important" given at Sinai, beginning "I am YHVH," and the text is fairly easily divided into 10 parts, albeit not all "commandments" necessarily. This text doesn't refer to itself as "aseret hadevarim" (the ten statements), nor is there any discussion of "tablets" anywhere proximal to this text. Later on in Exodus, we have a chapter bounded by "tablets" talk, and which refers to aseret hadevarim, whose legal content can be divided into 10 parts (the Ritual Decalogue) and is arguably what the text is referring to as being written on the tablets. However, in Deuteronomy, we have an explicit connection made between the tablets/ten statements, and the Sinai covenant (i.e. Ethical Decalogue).
Modern scholarship attempts to resolve the confusion by hypothesizing several different, individually coherent sources within the text. This is a long and involved discussion (interested readers can look here for an overview), so I'll leave it there for now.
I just want to quickly mention the photo I attached to this post. A while back we acquired a sort of "old-school" Ten Commandments wood carving. Whatever we say about the Torah text and what it originally meant, for Jewish religious and cultural purposes, this is still the "Ten Commandments," or in Hebrew, "Aseret Hadibrot." These 10, starting with "I am YHVH," are what we visualize God giving to Moses and the Israelites at Sinai. These are what we say are carved on the stone tablets. It's what we depict in the imagery found in our shuls and elsewhere. The idea of Ten Commandments from "I am YHVH" to "Do not covet," carved on two stone tablets, is taken for granted in nearly every Torah lecture you'll ever hear on the topic. Why? Because that's Jewish tradition. Judaism is not academia - it's the package of norms and thought we've carried with us across the ages. The Ten Commandments, Aseret Hadibrot, are in the realm of Judaism, and the exact identification of the "ten statements," the aseret hadevarim, is a matter of scholarship and academic debate.
Many prefer to choose one over the other, Judaism at the expense of scholarship, or scholarship at the expense of Judaism. I for one see no reason why we can't have and appreciate both.