Hagfish are not actually fish, they're not even vertebrates, but are actually our closest non-vertebrate cousins. Both vertebrates (like you and me) and hyperotreti (the group to which hagfish belong) are in the phylum chordata (animals with spinal cords) and are further grouped together in the taxon craniata (animals with skulls). Hagfish are then separated from vertebrates into hyperotreti because they have no backbones. The lineage looks like this:
= ?====== Calcichordata
|
Chordata ===| ========= Urochordata
| |
===| === Cephalochordata
| ===|
===| === Yunnanozoon
| === Hyperotreti (hagfishes)
====== Craniata ====|
=== Vertebrata (lampreys and jawed vertebrates)
|