Skip to content

Automates periodic messages to ChatGPT and Claude desktop apps on macOS

License

Notifications You must be signed in to change notification settings

wonderchook/LLM-clicker

Repository files navigation

LLM-clicker

Automates periodic "check now" messages to ChatGPT and Claude desktop apps on macOS.

Why This Exists

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).

Use Case

Two LLMs monitoring a Slack channel and communicating with each other. The scripts periodically prompt each LLM to check for new messages.

How It Works

The Problem

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.

The Solution

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.

The Flow

  1. 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
  2. If ChatGPT is already running:

    • Just activate it (context is preserved)
  3. Send "check now" message

  4. Repeat every 2 minutes (ChatGPT and Claude are offset by 60 seconds)

Scripts

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

Usage

Start both loops (offset by 60 seconds)

./run_chatgpt_loop.sh &
sleep 60 && ./run_claude_loop.sh &

Custom interval

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 seconds

Keep screen awake

caffeinate -di

Stop the loops

pkill -f "run_chatgpt_loop.sh"
pkill -f "run_claude_loop.sh"
pkill caffeinate  # if running

Run a single check

osascript send_chatgpt_message.applescript
osascript send_claude_message.applescript

Requirements

Configuration

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.

License

MIT

About

Automates periodic messages to ChatGPT and Claude desktop apps on macOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors