Skip to content

Latest commit

 

History

History
189 lines (129 loc) · 4.35 KB

File metadata and controls

189 lines (129 loc) · 4.35 KB

Claude TG Coder - Setup Guide

Control Claude Code remotely from your phone via Telegram!

What This Does

  • Monitors your screen for Claude Code permission prompts (Yes/No dialogs)
  • Sends them to Telegram so you can approve from your phone
  • Auto-detects when Claude finishes a task and sends you a summary
  • Lets you send commands and prompts to Claude remotely

Step 1: Clone the Repo

git clone https://github.com/Mjons/claude_tg_coder.git
cd claude_tg_coder

Step 2: Install Python Dependencies

cd claude_approver
pip install pillow pytesseract pyautogui mss requests pyperclip numpy

Or use the requirements file:

pip install -r requirements.txt

Step 3: Install Tesseract OCR

This is needed for reading text from the screen.

Windows

  1. Download from: https://github.com/UB-Mannheim/tesseract/wiki
  2. Run the installer
  3. Important: Add to PATH during installation, or manually add C:\Program Files\Tesseract-OCR to your system PATH

Mac

brew install tesseract

Linux

sudo apt install tesseract-ocr

Step 4: Create Your Telegram Bot

  1. Open Telegram and message @BotFather
  2. Send /newbot
  3. Follow the prompts to name your bot
  4. Copy the API token it gives you (looks like 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ)

Step 5: Get Your Chat ID

  1. Message @userinfobot on Telegram
  2. It will reply with your user ID (a number like 211277292)
  3. Copy this number

Step 6: Configure the Bot

Edit claude_approver/watcher.py and replace these lines near the top:

TELEGRAM_BOT_TOKEN = "YOUR_BOT_TOKEN_HERE"  # Paste your bot token
TELEGRAM_CHAT_ID = "YOUR_CHAT_ID_HERE"      # Paste your chat ID

Step 7: Calibrate Screen Regions

The bot needs to know where things are on your screen. Run these commands and drag to select each area:

# 1. Select where Yes/No prompts appear
python calibrate.py

# 2. Select the input box (where you type to Claude)
python calibrate.py input

# 3. Select the main output area
python calibrate.py context

# 4. Select the summary area (bottom of Claude's output)
python calibrate.py summary

# 5. Select the loader text area (shows "vibing...", "coding...", etc)
python calibrate.py loader

Tips:

  • A semi-transparent overlay appears - click and drag to select
  • Press ESC to cancel
  • If Claude Code is on a different monitor, edit MONITOR_INDEX in calibrate.py (1 = primary, 2 = second monitor)

Step 8: Start the Bot

python watcher.py

You should see:

Claude Approver started!
Monitoring region: {...}
Loader region: {...}
Auto-summary when loader gone for 12s
Waiting for Claude Code prompts...

Step 9: Message Your Bot

Open Telegram and message your bot. Try these commands:

Command What it does
/help Show all commands
/summary Get current task summary
/context See what Claude is doing
/commit Tell Claude to commit changes
/pause Mute "still working" notifications
/library Browse saved prompts

Or just type anything to send it to Claude!


How It Works

  1. Permission Prompts: When Claude asks "Allow this command?", the bot sends it to Telegram with Yes/No buttons
  2. Auto-Summary: When Claude finishes (loader disappears for 12 seconds), you get a summary
  3. Heartbeats: Every 15 seconds while working, you get a fun "still coding..." message
  4. Remote Control: Type anything in Telegram to send it directly to Claude

Troubleshooting

"Tesseract not found"

Make sure Tesseract is installed and in your PATH. Try running tesseract --version in terminal.

Bot not detecting prompts

  • Re-run python calibrate.py and select the exact area where Yes/No options appear
  • Make sure Claude Code window is visible (not minimized)

Wrong monitor

Edit calibrate.py and change MONITOR_INDEX = 2 to match your monitor (1 = primary)

Loader detection not working

  • Re-run python calibrate.py loader
  • Select just the small area where status text appears ("vibing...", "coding...")
  • Watch the console for [LOADER] content=X% visible=True/False

Keep It Running

To run in background on Windows:

pythonw watcher.py

Or use a tool like screen or tmux on Linux/Mac.


Questions?

Open an issue on the repo or ping me!