We investigate right ideals as codes in twisted group algebras. Such codes are called twisted group codes. It turns out that many interesting codes belong to this class; for instance, the ternary extended Golay code, Hamming codes and constacyclic codes. In particular we characterize all linear codes which are twisted group codes in terms of their automorphism group.