Justice Campbell ordered the man remanded without plea until his next appearance, which he scheduled next month. Name suppression will be reassessed at that time.
He was ordered to remain either at the Mason Clinic or, if deemed fit, in custody.
The man was arrested May 28, four days after Coombes was found stabbed along the Roy Clements Treeway, close to Mt Albert Grammar School in Auckland.
A passer-by held Coombes' hand as he bled to death.
Coombes had been walking home from university, where he studied photography. The former Massey High School student was also a keen surfer who lived at Bethells Beach, where he also served as a volunteer firefighter.
His family said in a statement last month that he had been living a "happy and beautiful life" before it was cruelly cut short.