You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add photo/document handling in both directions:
- Telegram → Claude: Photos and documents sent to a session topic are
downloaded to /tmp/ctm-images/ with UUID filenames and 0o600 perms,
then the file path is injected into the tmux session
- Claude → Telegram: New SendImage message type lets any script send
images or documents via the bridge socket
- bot.rs: download_file_to(), send_photo(), send_document() methods
- bridge.rs: handle_telegram_photo/document for inbound,
handle_send_image for outbound with path traversal validation
Co-Authored-By: DreamLabAI <github@thedreamlab.uk>
Monitor and control Claude Code from your phone. CTM is a Rust daemon that bridges Claude Code CLI sessions to Telegram, giving you a real-time mobile interface to what Claude is doing.
@@ -26,6 +26,8 @@ You (phone) Your machine
26
26
- Approve/reject tool executions with inline buttons
27
27
- Each Claude session gets its own Forum Topic thread
28
28
- Type prompts, stop, or kill Claude directly from chat
29
+
- Send photos/files from Telegram directly into Claude's session
30
+
- Send images and documents from Claude back to Telegram
29
31
30
32
## Quick Start
31
33
@@ -71,6 +73,12 @@ This is a security-focused rewrite of the original TypeScript version. The TypeS
71
73
-**Stop/interrupt** — Send `stop` to press Escape, `kill` to send Ctrl-C
72
74
-**Slash commands** — `cc clear`, `cc compact` forwarded to Claude
73
75
76
+
### Image & File Support
77
+
-**Telegram → Claude** — Send photos or documents from Telegram; they're downloaded locally and the file path is injected into Claude's tmux session
78
+
-**Claude → Telegram** — Send images or files to Telegram via the bridge socket using the `send_image` message type
79
+
- Photos include dimensions; documents include file size and original filename
80
+
- Secure download directory (`/tmp/ctm-images/`) with UUID-based filenames and `0o600` permissions
81
+
74
82
### Tool Approval
75
83
-**Inline keyboards** — Approve, Reject, or Abort with one tap
76
84
-**Details button** — Expand to see full tool input parameters
The `content` field is the absolute path to the file. Image extensions (jpg, png, gif, webp, bmp) are sent as photos; everything else is sent as a document. The optional `caption` metadata field adds a caption. If `sessionId` matches an active session, the file is posted to that session's forum topic.
212
+
193
213
## Configuration Reference
194
214
195
215
### Environment Variables
@@ -266,8 +286,8 @@ Run CTM on multiple machines with a shared Telegram group:
266
286
267
287
| Module | Lines | Responsibility |
268
288
|--------|-------|---------------|
269
-
|`bridge.rs`|~1100| Central orchestrator: routes messages between all components |
0 commit comments