In the movie, a shapeshifter changes her appearance to look like Captain Kirk while Kirk and McCoy are trying to escape the Klingon prison, Rura Penthe.
Kirk fights the shapeshifter while the Klingon prison guards track them down. The prison commander then kills the shapeshifter while she looks exactly like Kirk. It's clear the Klingons wanted to kill the shapeshifter anyway so there would be no witnesses.
How did the prison commander know which person to kill since the shapeshifter and Kirk looked identical?
Is there something in the novelization of the show that says how the prison commander knew?