Do not show iMessages on iPhone when using Messages on Macbook
The function of iMessage is to push your messages to all devices. To turn this off, go to Settings > Messages and disable iMessage. However, this is certainly not automatic, and may remove your cache of message from your iPhone.

As a commenter mentioned, keeping the app open on the iPhone will minimize your annoyance.