███████ ██░░░░░██ ██░█░█░██ ██░░░░░██ █████████ ███░██░███

agent-tools.org

ghost-code

Ghostty + Claude Code Telegram bridge

Get notified on your phone when Claude finishes a task or needs input — reply to inject text back into the terminal, or chat with Claude directly.

cargo install ghost-code

How It Works

Zero-latency hook architecture

ghost-code — data flow
# Claude Code fires a lifecycle event
claude hook:stop spool/1710000000.json
   # instant write, no network, <1ms
 
# Bot daemon picks up spool file
daemon poll telegram sendMessage
   # async delivery with streaming
 
# You reply from Telegram
telegram reply ghostty keystroke inject

Security notice — ghost-code has high system privileges: terminal injection via Accessibility API, file system access to ~/.claude/, and keychain reads. Your Telegram bot token grants terminal access — keep it secret. Details →

Features

Everything you need to stay connected to Claude

📨

Task Summaries

Silent Telegram notifications when Claude finishes a task, with cost and duration.

🚨

Attention Alerts

Immediate forwarding when Claude needs your input, with full context.

Tool Approval

Inline Allow/Deny buttons for tool-use requests — approve from your phone.

📊

Live Statusline

Real-time model, cost, plan usage, context window, and aid task metrics.

💬

Streaming Chat

Send messages to Claude directly from Telegram with live streaming responses.

Terminal Injection

Replies route back to the originating Ghostty tab via session mapping.

🌐

Multi-Machine

Hostname identification lets you run ghost-code on multiple machines.

🔇

Noise Filtering

Suppresses quota recovery spam and system events automatically.

Sleep Prevention

Automatic caffeinate keeps your Mac awake during long tasks.

🔒

Single Instance

flock-based daemon ensures exactly one bot process with graceful shutdown.

Quick Start

Two commands to get going

$ cargo install ghost-code
$ ghost-code setup
# Edit ~/.claude/hooks/ghost-code.env with your bot token
$ ghost-code test

Statusline

Real-time metrics in Claude Code's bottom bar

🤖 Opus 4.6 | 💰 $5 / $463 today | 📊 82% block · 38% weekly | 🧠 25% | 🌐 AIS 80% 51.0K $0.15 | 🔧 AID 2⏳ 117✓ $464 | 📡 TG