Cogley was strong-willed and old-fashioned, preferring paper books to computers. He had an extensive collection of books, ranging from the Hebrew Bible to the work of the Tribunal of Alpha III in its original language. He claimed never to use the computer in his office. After Lieutenant Shaw recommended him to Kirk, Cogley moved into Kirk's room at the starbase, bringing many volumes of law books with him.
Cogley's courtroom style was impassioned and dramatic. Shaw said that he was "well known for his theatrics".
Kirk was being tried for culpable negligence leading to the death of Ben Finney. The USS Enterprise had been caught in an ion storm, and during the storm Kirk had ejected an ion pod, with Finney apparently inside it. In his sworn account of the event, Kirk stated that he had ejected the pod several seconds after going to red alert. The computer log indicated that he had ejected the pod before going to red alert, while the ship was still on yellow alert. After Shaw, prosecuting at the court martial, presented a visual record of the log confirming the computer's account, Cogley privately asked Kirk if he wished to change his plea, claiming he could get Kirk off. Kirk, however, was certain, and decided to go forward with his plea of not guilty.
Cogley's suspicions were aroused when he and Kirk received a visit from Finney's daughter, Jame. She had previously accused Kirk of murdering her father, but during this visit she begged Cogley to help him, saying she did not blame Kirk for her father's death.
Just before the trial was due to conclude – and after Cogley had rested his case – first officer Spock entered the courtroom and informed Cogley that the Enterprise computer had shown signs of tampering. (Specifically, Spock had been able to beat it in chess five times running, which should have been impossible, as Spock programmed it to the same level as his abilities, meaning that the best that could be hoped for was a stalemate.) Cogley gave an impassioned plea to the court about human rights, invoking the Bible, the Code of Hammurabi and of Justinian, the Magna Carta, the United States Constitution, the Fundamental Declarations of the Martian colonies and the Statutes of Alpha III. He held that the court had denied Kirk the right to face his accuser, the Enterprise computer, and in so doing had elevated the machine above the Human. The court concurred, and reconvened aboard the Enterprise.
While Dr. McCoy used a white sound device to prove that Finney was still alive and aboard the Enterprise, Cogley returned to the surface and brought Jame Finney on board, believing that his daughter's presence might make Finney easier to handle. Kirk apprehended Finney, and the charges against Kirk were dismissed.
After Kirk was acquitted, Cogley sent him a book as a farewell present. He planned to defend Finney against the charges related to his plot against Kirk. He was confident of an acquittal. (TOS: "Court Martial")