The process in which a relatively unspecialized cell acquires specialized features of a companion cell. The companion cell is the specialized parenchyma cell associated with a sieve-tube member in angiosperm phloem and arising from the same mother cell as the sieve-tube member.