🌍 Language / 언어 / 语言: English | 한국어 | 中文 | Español | हिन्दी | العربية | Português | Русский | 日本語 | Français | Deutsch
GitHub: https://github.com/hada0127/cc-telegram
Remote Claude Code execution via Telegram bot.
Control Claude Code from anywhere using your Telegram app. Create tasks, monitor progress, and receive completion notifications - all from your phone.
- Remote Task Execution: Send coding tasks to Claude Code via Telegram
- Parallel Execution: Run multiple tasks simultaneously (configurable)
- Priority System: Urgent, High, Normal, Low priority levels
- Auto-Retry: Automatic retry on failure with configurable attempts
- Real-time Status: Monitor task progress and Claude's output
- Log Rotation: Automatic cleanup of old logs and completed tasks
- Node.js 18.0.0 or higher
- Claude Code CLI installed and authenticated
- Telegram account
npx cc-telegramOr install globally:
npm install -g cc-telegram
cc-telegramOn first run, cc-telegram will guide you through the setup process:
-
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbotand follow the prompts - Copy the bot token provided
-
Enter Bot Token
- Paste your bot token when prompted
- The tool will verify the token is valid
-
Link Your Account
- Open your new bot in Telegram
- Send
/startto the bot - The CLI will detect your message and display your chat ID
- Enter the chat ID to confirm
-
Configure Settings
- Set default retry count (recommended: 15)
- Enable/disable parallel execution
- Set max concurrent tasks (if parallel enabled)
Your configuration is stored locally in .cc-telegram/config.json (encrypted).
After setup, simply run:
npx cc-telegramThe bot will start and listen for commands from your Telegram account.
| Command | Description |
|---|---|
/new |
Create a new task |
/list |
View pending and in-progress tasks |
/completed |
View completed tasks |
/failed |
View failed tasks |
/status |
Check current execution status and cancel running tasks |
/debug |
View system information |
/cancel |
Cancel task creation flow |
/reset |
Reset all data (with confirmation) |
For one-time execution without completion criteria:
- Send
/new - Select "Simple (no completion criteria, no retry)"
- Enter your requirement
- Task is queued immediately
For tasks with completion criteria and auto-retry:
- Send
/new - Select "Complex (with completion criteria and retry)"
- Enter your requirement
- Enter completion criteria (e.g., "All tests pass")
- Select priority level
- Choose retry count (10 or custom)
Plan Mode: Complex tasks automatically run Claude in plan mode (--permission-mode plan option). This enables Claude to design an implementation approach before executing, resulting in better outcomes for complex requirements.
You can attach files when entering requirements or completion criteria:
- When prompted for requirements/criteria, first send your files (images, documents, etc.)
- A confirmation message will appear for each attached file
- Then enter your requirements/criteria as text
- Attached files will be passed to Claude along with the task
Note: Attached files are automatically deleted when the task is completed, failed, or canceled.
Tasks are executed in priority order:
| Priority | Icon | Description |
|---|---|---|
| Urgent | 🔴 | Execute first |
| High | 🟠 | High priority |
| Normal | 🟢 | Default priority |
| Low | :blue_circle: | Execute when idle |
When enabled during setup, multiple tasks can run simultaneously:
- Configure max concurrent tasks (1-10)
- Each task shows its ID prefix in console output
/statusshows all running tasks with stop buttons to cancel them- Higher priority tasks still get slots first
You can cancel tasks that are currently running:
- Send
/statusto view running tasks - Each running task displays a "Stop" button
- Click the button to immediately terminate the task
- The canceled task will be marked as failed
[a1b2c3d4] Starting task...
[e5f6g7h8] Compiling project...
[a1b2c3d4] Tests passed!
Configuration is stored in .cc-telegram/config.json:
| Setting | Description | Default |
|---|---|---|
botToken |
Telegram bot token (encrypted) | - |
chatId |
Your Telegram chat ID (encrypted) | - |
debugMode |
Enable debug logging | false |
claudeCommand |
Custom Claude CLI command | null (auto-detect) |
logRetentionDays |
Days to keep log files | 7 |
defaultMaxRetries |
Default retry count | 15 |
parallelExecution |
Enable parallel execution | false |
maxParallel |
Max concurrent tasks | 3 |
If Claude CLI is installed in a non-standard location:
{
"claudeCommand": "npx @anthropic-ai/claude-code"
}.cc-telegram/
├── config.json # Encrypted configuration
├── tasks.json # Pending task index
├── completed.json # Completed task index
├── failed.json # Failed task index
├── tasks/ # Individual task files
├── completed/ # Completed task details
├── failed/ # Failed task details
└── logs/ # Daily log files
Claude Code signals task completion using special markers:
<promise>COMPLETE</promise>- Task completed successfully<promise>FAILED</promise>- Task failed with reason
If no signal is detected, the system uses pattern matching to determine success or failure based on output content.
- Log files are created daily:
YYYY-MM-DD.log - Old logs are automatically deleted after
logRetentionDays - Completed/failed task files are cleaned up after 30 days
- Bot token and chat ID are encrypted using AES-256-GCM
- Only messages from your registered chat ID are processed
- All data is stored locally in your project directory
- Ensure the bot is running (
npx cc-telegram) - Check if your chat ID matches the configured one
- Verify internet connection
- Ensure Claude CLI is installed:
npm install -g @anthropic-ai/claude-code - Or set a custom command in config:
"claudeCommand": "npx @anthropic-ai/claude-code"
- On restart, orphan tasks are automatically reset to "ready" status
- Use
/resetto clear all data if needed
MIT