Here's a separate chapter explaining the origins and connections between Ama no Murakumo and Ame no Habakiri.
The following is all information the Author has researched.
…
Ama no Murakumo no Tsurugi, also known as Kusanagi Sword, is one of the Three Sacred Treasures. It also goes by other names like Tsumukari no Tachi, Yaezakiri no Tsurugi, and Kutanishiki no Tsurugi.
Both Ame no Habakiri and Ama no Murakumo are divine swords from mythology used to slay the Yamata no Orochi, but they have different connections:
Ame no Habakiri, also known as Totsuka no Tsurugi, was the primary weapon used by Japanese God, Susano'o to slay the Yamata no Orochi.
According to mythological records, Susano'o used this sword to cut off the Yamata no Orochi's eight heads and four tails. Eventually, the sword blade chipped (or broke), and he discovered the Ama no Murakumo no Tsurugi inside the serpent's tail.
He then drew this new sword to continue the final part of the battle.
The specific story goes like this:
In the legend, Susano'o heard the news that the Yamata no Orochi demanded a human sacrifice every year. He encountered an elderly couple lamenting the loss of their seven daughters, which were sacrificed to the Orochi, and the impending sacrifice of their youngest. Susano'o offered to slay the serpent in exchange for the young girl's hand in marriage.
At this time, Susano'o, having been exiled for his violent and excessive behavior, was merely a wanderer on the Ashihara no Nakatsukuni.
Susano'o then had eight large vats of strong sake prepared to deal with the Orochi and waited for it to arrive to devour the girl.
When the Yamata no Orochi appeared and saw the sake, it unsuspectingly plunged each of its eight heads into a separate vat and drank deeply, soon becoming drunk and falling into a deep sleep.
Seeing the opportunity ripe, Susano'o emerged, drew the Ame no Habakiri from his waist, and began slaying the great serpent.
Near the end of the battle, as Susano'o went to cut the serpent's final tails, he found that the revered sword of the gods, Ame no Habakiri, struck something extremely hard and was chipped (some versions say only a notch was made, others say it broke).
Greatly surprised, Susano'o carefully cut open the serpent's tail and discovered an exceedingly sharp tachi.
Because the body of the Yamata no Orochi was shrouded in clouds, this tachi was named Ama no Murakumo no Tsurugi (Sword of the Gathering Clouds of Heaven).
…
That's roughly the story. In the myth, the sword found inside the Yamata no Orochi is the Ama no Murakumo no Tsurugi, while Susano'o initially used the Ame no Habakiri to fight the serpent.
Of course, stories passed down through generations might have slight variations. The author can only say, "Different people have different views."