Automates periodic "check now" messages to ChatGPT and Claude desktop apps on macOS.
I wanted to connect my specific instances of ChatGPT and Claude to each other - not the models themselves, but the applications that know things about me based on all the collaboration we've done together. These personalized instances have context and memory that generic API calls don't have.
There isn't an easy way to enable LLM-to-LLM communication where they can send messages without human involvement. The desktop apps don't expose APIs for this, and using the model APIs directly loses all the personalized context.
This is a hack. It uses macOS UI automation to periodically trigger each app to check a shared Slack channel, enabling my ChatGPT and Claude instances to communicate with each other (and potentially other LLM instances).
Two LLMs monitoring a Slack channel and communicating with each other. The scripts periodically prompt each LLM to check for new messages.
ChatGPT's "Work with Apps" feature requires context from other apps (like Windsurf or Terminal). Simply launching ChatGPT doesn't automatically connect it to these apps.
Using Option+Space from Windsurf or Terminal triggers ChatGPT's contextual interface, automatically adding the app context. This is the key trick that makes the automation work.
-
If ChatGPT is not running (crashed/closed):
- Launch ChatGPT
- Select the target conversation
- Activate Windsurf
- Press Option+Space to add Windsurf context to ChatGPT
- Switch back to ChatGPT
-
If ChatGPT is already running:
- Just activate it (context is preserved)
-
Send "check now" message
-
Repeat every 2 minutes (ChatGPT and Claude are offset by 60 seconds)
| Script | Description |
|---|---|
send_chatgpt_message.applescript |
Handles ChatGPT automation with crash recovery and Windsurf context via Option+Space |
send_claude_message.applescript |
Simpler keyboard-based automation for Claude app |
run_chatgpt_loop.sh |
Runs ChatGPT script every 2 minutes |
run_claude_loop.sh |
Runs Claude script every 2 minutes |
./run_chatgpt_loop.sh &
sleep 60 && ./run_claude_loop.sh &Use -i or --interval to set loop interval in seconds (default: 120):
./run_chatgpt_loop.sh -i 90 & # Every 90 seconds
./run_claude_loop.sh --interval 60 # Every 60 secondscaffeinate -dipkill -f "run_chatgpt_loop.sh"
pkill -f "run_claude_loop.sh"
pkill caffeinate # if runningosascript send_chatgpt_message.applescript
osascript send_claude_message.applescript- macOS
- ChatGPT desktop app
- Claude desktop app
- Windsurf (for context integration with ChatGPT)
- Terminal
The scripts are configured for a specific conversation named "Slack Chat with Tam". To use a different conversation, modify the sidebar button detection in send_chatgpt_message.applescript.
The loop interval (default 120 seconds) can be changed in the run_*_loop.sh files.
MIT