There are manga, light novel, and anime versions of Code Geass. Which came first?
It was original, the anime came first then various adaptations. You could confirm this in MyAnimeList. Under "Background":
Code Geass: Hangyaku no Lelouch is an original anime series by Sunrise animation studio with original character designs by the all-female Japanese manga artist group Clamp.
Just don't be surprised that some good shows are anime-original like Psycho Pass, Madoka, etc.
Another way to know it's anime original is that the wikipedia page calls Code Geass an anime. https://en.wikipedia.org/wiki/Code_Geass
Cf another 'anime' like Death Note: The wikipedia page calls Death Note a manga. https://en.wikipedia.org/wiki/Death_Note
Of course it's just heuristic. The sure fire way is to scroll down the page and check the release/publication date.