Claude (and many models, deepseek, etc) can operate a TUI just fine by reading and sending control codes to a PTY.