Skip to content

0x177630b6/claude_tg_coder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Approver

A Telegram bot that monitors Claude Code for permission prompts and lets you approve them remotely from your phone.

Setup

1. Install Dependencies

cd claude_approver
pip install pillow pytesseract pyautogui mss requests pyperclip numpy

2. Install Tesseract OCR

Download and install from: https://github.com/UB-Mannheim/tesseract/wiki

Make sure to add it to your PATH.

3. Configure Telegram Bot

Edit watcher.py and set your bot token and chat ID:

TELEGRAM_BOT_TOKEN = "your_bot_token_here"
TELEGRAM_CHAT_ID = "your_chat_id_here"

To get these:

  1. Message @BotFather on Telegram to create a bot and get the token
  2. Message @userinfobot to get your chat ID

4. Calibrate Screen Regions

Run calibration for each region (a semi-transparent overlay appears - click and drag to select):

# Main prompt detection area (where Yes/No options appear)
python calibrate.py

# Input area (where you type prompts to Claude)
python calibrate.py input

# Context area (main output feed)
python calibrate.py context

# Summary area (where Claude shows what it did)
python calibrate.py summary

# Loader area (status text like "vibing...", "coding...")
python calibrate.py loader

Note: Edit MONITOR_INDEX in calibrate.py if Claude Code is on a different monitor (1 = primary, 2 = second, etc.)

5. Run the Watcher

python watcher.py

Telegram Commands

Command Description
/help Show all commands
/library Browse prompt library (.md files)
/context View current Claude Code screen
/summary Get task summary
/commit Tell Claude to commit changes
/md <topic> Create new .md file based on topic
/pause Toggle heartbeat notifications
/folder Show current prompts folder
/folder <path> Set prompts folder to new path

Or just type any message to send it directly to Claude!

Inline Buttons

When a permission prompt is detected, you'll get buttons:

  • YES (don't ask again) - Approve and remember
  • Yes (once) - Approve just this time
  • No - Reject
  • Auto-approve ON (5 min) - Auto-approve all prompts for 5 minutes
  • Context - See what Claude is doing
  • Summary - Get task summary
  • Prompt Library - Browse saved prompts

Auto-Summary

The bot automatically sends a summary when:

  • The loader text (e.g., "vibing...", "coding...") disappears for 12 seconds
  • No permission prompt is active

Prompt Library

Put .md files in the prompts/ folder (or set custom folder with /folder).

Example prompts included:

  • add-types.md - Add TypeScript/Python type annotations
  • debug-this.md - Find and fix bugs
  • explain-code.md - Explain code in plain English

Configuration

Settings are stored in config.json:

{
  "region": {"x": 100, "y": 200, "width": 800, "height": 400},
  "input_region": {...},
  "context_region": {...},
  "summary_region": {...},
  "loader_region": {...},
  "prompts_dir": "L:\\path\\to\\prompts"
}

Troubleshooting

Bot not detecting prompts

  • Re-run python calibrate.py to recalibrate the prompt region
  • Make sure Claude Code window is visible and not minimized

Loader detection not working

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

Wrong monitor

  • Edit MONITOR_INDEX in calibrate.py (1 = primary, 2 = second monitor)

Tesseract not found

  • Install Tesseract OCR and add to PATH
  • Or set path manually: pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'

About

helps you use claude in VScode rom tg.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%