Tired of people claiming that the Otsutsuki ("alien stuff") came out of nowhere at the end of Naruto.
So, here is a thread about the foreshadowing and clues that hinted at their existence.
1) The Gedo Statue
The Gedo Statue that Madara summoned from the moon sits on an open flower blossom, which is what Kaguya sits on in "The Tale of The Bamboo Cutter" with the Gedo being Kaguya's body.
2) Black Zetsu
After he defeated Madara at the Final Valley, Hashirama was able to sense the presence of something above him, which was revealed later to be Black Zetsu. This clearly shows that Black Zetsu wasn't actually Madara's will.
Kaguya was brought from the moon and inside a tree, mirroring the folklore.
This is peak foreshadowing because the Gedo Statue is literally the body of Kaguya (plus the tree).
As her descendants, some of the members of this clan, namely Kimimaro, possessed a derivative of her Kekkei Moura (the All-Killing Ash Bones). This derivative was the Corpse Bone Chain.
4) The Hyuga Clan
It was stated here that the Uchiha clan's abilities trace their origin back to the Hyuga clan. Meaning the Sharingan was derived from the Byakugan (as stated in the English dub version).
As we all know, the Otsutsuki were the first wielders of the Byakugan.
3) The Sage of the Six Paths
Although initially depicted as a silhouette, several details about the Sage's appearance can be inferred. He had a small goatee and short light-coloured hair that spiked up in the front with two distinctive pieces of hair resembling horns.
5) The Kaguya Clan
They were the direct descendants of the first Otsutsuki that came to Earth, Kaguya Otsutsuki. Besides sharing the same name with her, their shortly cut eyebrows and the zigzag cranial pattern in between their heads also seem to be replications of hers.
Here, Nagato tells Konan that the Sage sealed something inside the moon using the same jutsu he (Nagato) used to seal Naruto when he underwent the Six-Tails transformation. This was the first foreshadowing of Kaguya being sealed in the moon.
The Sage of the Six Paths was hailed as a god for his godlike powers like creating a celestial body, i.e., the moon, which can indicate that he was a celestial being himself (or have celestial powers). One can infer from this that the Sage wasn't (entirely) an earthly being.
So, the introduction of the Kaguya clan earlier in the story, with the similarities in appearance and ability to that of Kaguya, can serve as a hint to the Otsutsuki clan in general, and Kaguya Otsutsuki in particular.
[End of Thread]
Most of these clues can be noticed easily if you reread/rewatch the series.
There may be other foreshadowing that can be derived from the series, but these are all I can think of for now.
Thanks for reading.