The Codex is an alien mechanical unit that lives inside the alien psionic/data network. It takes the form of an electric yellow female-humanoid being, seemingly made entirely of energy, save for a metallic skull and a spinal column.
You will first encounter the Codex after you attempt to Skulljack an ADVENT Officer. It is advisable to kill all other enemies on the map. It has high health, a high dodge rate (so even point-blank shots may 'graze' it for partial damage), and high accuracy. For the storyline requirement, the best time to fight it is when there's no turn limit, allowing as much time as necessary to defeat the Codex.
Its abilities include:
- Teleportation: The Codex will usually teleport instead of physically moving. This has a better-than-average movement range, doesn't trigger any reaction fire, and and represents a single action, so the Codex can attack any targets. This ability means the Codex will almost always get a flanking shot every round, unless it uses another ability. However, its plasma weapon is not very high powered, so even a flanking critical hit will not be lethal once Predator Armor is unlocked.
- Rift: The Codex can summon a psionic rift. This disables weapons of XCOM soldiers in the area (mechanically, it reduces their ammo to zero). The rift will detonate on the next turn for moderate damage to anything still in the area of effect. This usually costs the turn of any soldier caught by it, since reloading and moving out of the area of effect to avoid the damage is a full turn of actions, though there are options that don't rely on the primary weapon, such as a Ranger's Slash, the Sharpshooter's pistol or using an item. Auto-loaders can also allow your soldier to reload for free, allowing a soldier to act. If necessary, a soldier can be left in the Rift and ignore the damage, since it will not be lethal to a soldier with full health, although the rift detonation could destroy their cover.
- Clone: Whenever it takes damage the Codex will clone itself and teleport away, leaving two Codices on the battlefield. The remaining HP will be divided between the two clones, rounding up for the clone and down for the original (so if it attempts to clone at 1 HP, it will just teleport). Since any amount of damage will result in a clone, try to hit it with a single killing shot, ensuring that the Codex will not Clone. An Overwatch ambush from Concealment can also defeat it, as all shots are simultaneous.
Flashbangs and other causes of Disorientation greatly reduce its threat by restricting it from using its special abilities, crippling the Codex's offensive potential and movement. Killing your first Codex reduces Avatar progress by 1, but afterwards, they will spawn in regular enemy pods.
After researching the Codex Brain in the Shadow Chamber, you will be tasked with Skulljacking a Codex itself (which, similarly to the skulljacking of the ADVENT Captain, summons the stronger Avatar). After this task is complete, all future Codices can be Skullmined, offering an easier way to kill Codices without allowing it to clone itself (unless the Skulljack misses).
Codices have the unfortunate distinction of being considered both partially mechanical and organic simultaneously. This means that both mental Psionic attacks (such as Insanity and Domination) and Bluescreen Protocol (Bluescreen Rounds and EMP Bombs) are effective upon it, although Haywire Protocol will not work. Codices also have high Will, so early Psionic attacks should be focused elsewhere.
Having two soldiers close to each other will almost always result in the Codex using Rift, leaving 2-3 soldiers with empty primary guns. However, it deals no immediate damage and leaves the Codex open to counterattack. By clone or Teleports, the Codex will tend to at least stay in LoS, thus within range of attack of your squad. A high-ranking Sharpshooter is perhaps best suited to facing them: Standoff can kill all low health clones, Fan Fire and Deadeye can kill a Codex in one shot, and Serial can let you snipe several clones in a row.
Codices do not have an autopsy as such. Instead, it is split into three parts. The first is called Alien Encryption, a regular research project revealing that the encryption is so complex that a separate facility is required to get through. The Shadow Chamber is unlocked from this.
The second part is called Codex Brain, a Shadow Project. Upon completion, a cutscene plays, depicting Dr Tygan and Lily Shen trying to analyse the Codex and extract data, succeeding despite the Codex's best efforts.
The third and final part is called Encrypted Codex Data, and is again a Shadow Project. The encryption is cracked, revealing that the Elders (Ethereals) are dying, suffering from extreme muscular degeneration. All the conquering and enslavement is a mighty effort to find a successor species to plant their minds into, so they can survive. Humanity is the next test subject, and the Elders have struck gold.
After this, the Psionic Gate is revealed, and an XCOM squad is to capture it.