Skip to content

A powerful Telegram bot that provides remote access to Claude Code, enabling developers to interact with their projects from anywhere with full AI assistance and session persistence.

License

Notifications You must be signed in to change notification settings

milhy545/multicode-ai-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

34 Commits

Repository files navigation

MultiCode AI Telegram Bot ๐Ÿค–โœจ

License: MITPython 3.9+Multi-AITest Coverage

๐Ÿ”ง Forked and enhanced fromclaude-code-telegram by Richard Atkinson (MIT License)

A powerful Telegram bot that provides remote access to 8 different AI coding assistants, enabling developers to interact with their projects from anywhere with the perfect AI for each task. Transform your phone into a development terminal with multi-AI assistance, project navigation, and session persistence.

๐ŸŽ‰ COMPLETE: 8 AI Providers! Choose from Claude, Gemini, OpenAI, DeepSeek, Groq, Ollama, Blackbox, and Windsurf

6 FREE options | Ultra-cheap DeepSeek ($0.14/1M) | Ultra-fast Groq | Local Ollama

See Full Multi-AI Documentation โ†’

โœจ What is this?

This bot bridges Telegram and 8 different AI coding assistants, allowing you to:

  • ๐Ÿ’ฌ Chat with 8 AI assistants about your code projects through Telegram
  • ๐Ÿ”€ Switch between AIs - choose the perfect tool for each task
  • ๐Ÿ“ Navigate directories and manage files remotely
  • ๐Ÿ”„ Maintain context across conversations with session persistence
  • ๐Ÿ“ฑ Code on the go from any device with Telegram
  • ๐Ÿ›ก๏ธ Stay secure with built-in authentication and sandboxing
  • ๐Ÿ’ฐ Save money - 6 FREE options including Gemini, Groq, and Ollama
  • โšก Ultra-fast responses with Groq's LPU technology
  • ๐Ÿ  100% privacy with local Ollama models
  • ๐Ÿ’ธ Ultra-cheap with DeepSeek at $0.14/1M tokens

Perfect for code reviews on mobile, quick fixes while traveling, or getting AI assistance when away from your development machine.

๐Ÿค– Choose Your AI (8 Options!)

Premium Quality

  • Claude ($3-15/1M) - Exceptional quality, full tools, complex reasoning ๐Ÿ†
  • OpenAI GPT-4 ($10-60/1M) - Industry standard, vision support

Budget/Free Options

  • DeepSeek ($0.14-0.28/1M) - Code specialist, 10-20x cheaper than GPT-4! ๐Ÿ’ฐ
  • Gemini (FREE) - 1M token context, vision, no credit card needed ๐Ÿ†“
  • Groq (FREE) - Ultra-fast LPU inference, Llama 3/Mixtral โšก
  • Ollama (FREE) - Local models, complete privacy, offline ๐Ÿ 
  • Blackbox (FREE) - Code-focused web API ๐Ÿ†“
  • Windsurf (FREE) - Codeium cascade architecture ๐Ÿ†“

Full provider comparison โ†’

๐Ÿš€ Quick Start

Choose Your Installation Method:

MethodBest ForInstall Command
๐Ÿš€ curl|bashFastest setupcurl -fsSL https://raw.githubusercontent.com/milhy545/multicode-ai-bot/main/install.sh | bash
๐Ÿณ DockerProduction serversdocker-compose up -d
๐Ÿ“ฆ PyPIPython projectspip install multicode-ai-bot
๐Ÿ“ฑ FlatpakLinux desktopflatpak install multicode-bot
๐Ÿ’ฟ AppImagePortable LinuxDownload & run

๐Ÿ“– Full Installation Guide โ†’ | ๐Ÿณ Docker Guide โ†’

One-Line Install (Recommended):

curl -fsSL https://raw.githubusercontent.com/milhy545/multicode-ai-bot/main/install.sh | bash

Then configure .env and run:

cd~/.multicode-bot nano .env ./multicode-bot

Demo

You: cd my-project Bot: ๐Ÿ“‚ Changed to: my-project/ You: ls Bot: ๐Ÿ“ src/ ๐Ÿ“ tests/ ๐Ÿ“„ README.md ๐Ÿ“„ package.json You: Can you help me add error handling to src/api.py? Bot: ๐Ÿค– I'll help you add robust error handling to your API... [Claude analyzes your code and suggests improvements] 

โœจ Features

๐Ÿšง Development Status

This project is actively being developed. Here's the current status of features:

โœ… Working Features

  • Full Telegram bot functionality with advanced command handling
  • Directory navigation (cd, ls, pwd) with project switching
  • Multi-layer authentication (whitelist + optional token-based)
  • Advanced rate limiting with token bucket algorithm
  • Complete Claude integration with SDK/CLI support
  • โœจ Enhanced file upload handling with archive extraction
  • โœจ Git integration with safe repository operations
  • โœจ Quick actions system with context-aware buttons
  • โœจ Session export in Markdown, HTML, and JSON formats
  • โœจ Image/screenshot upload with smart analysis prompts
  • โœจ Conversation enhancements with follow-up suggestions
  • SQLite database persistence with migrations
  • Comprehensive usage and cost tracking
  • Session management with persistence
  • Audit logging and security event tracking

๐Ÿš€ New Advanced Features

  • ๐Ÿ“ฆ Archive Analysis: Upload ZIP/TAR files for comprehensive project analysis
  • ๐Ÿ”„ Git Operations: View status, diffs, logs, and commit history
  • โšก Quick Actions: Context-aware buttons for tests, linting, formatting, etc.
  • ๐Ÿ“ค Session Export: Download conversation history in multiple formats
  • ๐Ÿ–ผ๏ธ Image Support: Upload screenshots and diagrams for analysis
  • ๐Ÿ’ก Smart Suggestions: AI-powered follow-up action recommendations

๐Ÿ”„ Planned Enhancements

  • True streaming responses with real-time updates
  • Claude vision API integration for full image analysis
  • Custom quick actions configuration
  • Advanced Git operations (when security permits)
  • Plugin system for third-party extensions
  • Multi-language code execution
  • Webhook support for CI/CD integration

๐Ÿค– Multi-AI Integration (8 Providers!)

  • 8 AI Providers: Claude, Gemini, OpenAI, DeepSeek, Groq, Ollama, Blackbox, Windsurf
  • Flexible Switching: Choose the best AI for each task or conversation
  • Unified Interface: All providers work through the same clean API
  • Session Persistence: Maintain conversation context with SQLite database storage
  • Smart Fallbacks: Automatically handle provider failures with graceful degradation
  • Cost Optimization: Mix FREE and paid providers based on your budget
  • Privacy Options: Local models (Ollama) for sensitive projects
  • Speed Options: Ultra-fast Groq LPU for real-time interactions

๐Ÿ“ฑ Terminal-like Interface

  • Directory Navigation: cd, ls, pwd commands just like a real terminal
  • File Management: Upload files, archives, and images for Claude to analyze
  • Git Integration: View repository status, diffs, and commit history
  • Project Switching: Easy navigation between different codebases with context preservation
  • Command History: Full session tracking with export capabilities

๐Ÿ›ก๏ธ Enterprise-Grade Security

  • Multi-Layer Authentication: Whitelist-based and optional token authentication
  • Directory Isolation: Strict sandboxing to approved project directories
  • Rate Limiting: Token bucket algorithm with request and cost-based limits
  • Comprehensive Audit Logging: Complete tracking of all user actions and security events
  • Input Validation: Protection against injection attacks, path traversal, and zip bombs

โšก Developer Experience

  • Quick Actions: Context-aware buttons for tests, linting, formatting, and more
  • Session Management: Start, continue, end, export, and monitor Claude sessions
  • Usage Analytics: Detailed cost tracking, usage patterns, and system statistics
  • Responsive Design: Clean, mobile-friendly interface with inline keyboards
  • Smart Follow-ups: AI-powered suggestions for next actions based on context

๐Ÿ› ๏ธ Installation

Prerequisites

1. Get Your Bot Token

  1. Message @BotFather on Telegram
  2. Send /newbot and follow the prompts
  3. Save your bot token (it looks like 1234567890:ABC...)
  4. Note your bot username (e.g., my_claude_bot)

2. Set Up AI Providers

You can use one or multiple AI providers! Here's how to set up each:

FREE Providers (No API key needed):

# Blackbox - No setup required, works immediately! DEFAULT_AI_PROVIDER=blackbox # Ollama - Install locally for 100% privacy brew install ollama # or download from ollama.ai ollama pull codellama DEFAULT_AI_PROVIDER=ollama

FREE Providers (API key required but free tier):

# Gemini - Get free API key from https://aistudio.google.com/app/apikey GEMINI_API_KEY=your_key_here DEFAULT_AI_PROVIDER=gemini # Groq - Ultra-fast, get free key from https://console.groq.com/ GROQ_API_KEY=your_key_here DEFAULT_AI_PROVIDER=groq # Windsurf - Free for individuals, get key from https://codeium.com/ CODEIUM_API_KEY=your_key_here DEFAULT_AI_PROVIDER=windsurf

Paid Providers:

# Claude - Best quality (Option 1: CLI auth or Option 2: API key)# Option 1: Install Claude CLI and run `claude auth login`# Option 2: Get API key from https://console.anthropic.com/ ANTHROPIC_API_KEY=your_key_here DEFAULT_AI_PROVIDER=claude # OpenAI - Industry standard, get key from https://platform.openai.com/ OPENAI_API_KEY=your_key_here DEFAULT_AI_PROVIDER=openai # DeepSeek - Ultra-cheap ($0.14/1M!), get key from https://platform.deepseek.com/ DEEPSEEK_API_KEY=your_key_here DEFAULT_AI_PROVIDER=deepseek

Recommendation: Start with Blackbox (instant, no setup) or Gemini (FREE, 1M context)!

3. Install the Bot

# Clone the repository git clone https://github.com/yourusername/claude-code-telegram.git cd claude-code-telegram # Install Poetry (if needed) curl -sSL https://install.python-poetry.org | python3 - # Install dependencies make dev

4. Configure Environment

# Copy the example configuration cp .env.example .env # Edit with your settings nano .env

Minimum required configuration:

TELEGRAM_BOT_TOKEN=1234567890:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 TELEGRAM_BOT_USERNAME=my_claude_bot APPROVED_DIRECTORY=/Users/yourname/projects ALLOWED_USERS=123456789 # Your Telegram user ID

5. Run the Bot

# Start in debug mode make run-debug # Or for production make run

๐ŸŽ‰ That's it! Message your bot on Telegram to get started.

๐Ÿ“‹ Detailed Setup Guide: For comprehensive setup instructions including authentication options and troubleshooting, see docs/setup.md

๐Ÿ“ฑ Usage

Basic Commands

Once your bot is running, you can use these commands in Telegram:

Navigation Commands

/ls # List files in current directory /cd myproject # Change to project directory /pwd # Show current directory /projects # Show available projects 

Session Management

/new # Start a new Claude session /continue [message] # Continue previous session (optionally with message) /end # End current session /status # Show session status and usage /export # Export session (choose format: Markdown, HTML, JSON) 

Advanced Features

/git # Show git repository info (status, diff, log) /actions # Show context-aware quick actions 

Getting Help

/start # Welcome message and setup /help # Show all available commands 

Talking to Claude

Just send any message to interact with Claude about your code:

You: "Analyze this Python function for potential bugs" You: "Help me optimize this database query" You: "Create a React component for user authentication" You: "Explain what this code does" 

File Operations

Upload files: Simply send files to Telegram and Claude will analyze them.

Supported operations:

  • Single files: Code files, configs, documents - Claude analyzes content
  • Archives: ZIP/TAR files - Extracts and analyzes project structure
  • Images: Screenshots, diagrams, UI mockups - Smart prompt generation
  • Multiple files: Send several files for batch analysis

Supported file types:.py, .js, .ts, .jsx, .tsx, .java, .cpp, .c, .go, .rs, .rb, .php, .swift, .kt, .scala, .sql, .json, .xml, .html, .css, .md, .txt, .yaml, .toml, .zip, .tar, .tar.gz, .png, .jpg, .jpeg, .gif, .webp, and more.

Example Workflow

1. You: /cd my-web-app Bot: ๐Ÿ“‚ Changed to: my-web-app/ 2. You: /ls Bot: ๐Ÿ“ src/ ๐Ÿ“ components/ ๐Ÿ“„ package.json ๐Ÿ“„ README.md 3. You: "Can you help me add TypeScript to this project?" Bot: ๐Ÿค– I'll help you migrate to TypeScript! Let me analyze your project structure... [Claude provides detailed migration steps] 4. You: /status Bot: ๐Ÿ“Š Session Status ๐Ÿ“‚ Directory: my-web-app/ ๐Ÿค– Claude Session: โœ… Active ๐Ÿ’ฐ Usage: $0.15 / $10.00 (2%) 

Advanced Features Examples

๐Ÿ“ฆ Archive Analysis

You: [Upload project.zip] Bot: ๐Ÿ“ฆ Analyzing archive: project.zip Project Structure: ๐Ÿ“ src/ ๐Ÿ“„ main.py (2.3KB) ๐Ÿ“„ utils.py (1.1KB) ๐Ÿ“ tests/ ๐Ÿ“„ test_main.py (3.2KB) ๐Ÿ“„ requirements.txt (245B) Language: Python Frameworks: pytest detected Entry point: src/main.py ๐Ÿค– I've analyzed your Python project. It appears to be... 

๐Ÿ”„ Git Integration

You: /git Bot: ๐Ÿ“Š Git Repository Status ๐ŸŒฟ Branch: feature/new-api ๐Ÿ“ Changes: 3 files modified ๐Ÿ”„ Behind main: 2 commits Recent commits: โ€ข abc123 - Add API endpoint (2 hours ago) โ€ข def456 - Update dependencies (1 day ago) [View Diff] [Show Log] [See Changes] 

โšก Quick Actions

You: /actions Bot: ๐Ÿš€ Available Quick Actions Based on your project context: [๐Ÿงช Run Tests] [๐Ÿ“ฆ Install Deps] [๐ŸŽจ Format Code] [๐Ÿ” Run Linter] [๐Ÿ“ Add Docs] [๐Ÿ”ง Refactor] 

๐Ÿ“ค Session Export

You: /export Bot: ๐Ÿ“ค Export Session Choose format: [๐Ÿ“ Markdown] [๐ŸŒ HTML] [๐Ÿ“‹ JSON] You: [Click Markdown] Bot: โœ… Session exported! ๐Ÿ“Ž claude_session_abc123.md (15.2KB) [Downloads as file in Telegram] 

Quick Actions

The bot provides helpful buttons for common tasks:

  • ๐Ÿงช Test - Run your test suite
  • ๐Ÿ“ฆ Install - Install dependencies
  • ๐ŸŽจ Format - Format your code
  • ๐Ÿ” Find TODOs - Locate TODO comments
  • ๐Ÿ”จ Build - Build your project
  • ๐Ÿ“Š Git Status - Check git status

โš™๏ธ Configuration

Required Settings

# Telegram Bot Configuration TELEGRAM_BOT_TOKEN=1234567890:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 TELEGRAM_BOT_USERNAME=my_claude_bot # Security - Base directory for project access (absolute path) APPROVED_DIRECTORY=/Users/yourname/projects # User Access Control ALLOWED_USERS=123456789,987654321 # Your Telegram user ID(s)

Common Optional Settings

# Claude Settings USE_SDK=true # Use Python SDK (default) or CLI subprocess ANTHROPIC_API_KEY=sk-ant-api03-... # Optional: API key for SDK (if not using CLI auth) CLAUDE_MAX_COST_PER_USER=10.0 # Max cost per user in USD CLAUDE_TIMEOUT_SECONDS=300 # Timeout for operations  CLAUDE_ALLOWED_TOOLS="Read,Write,Edit,Bash,Glob,Grep,LS,Task,MultiEdit,NotebookRead,NotebookEdit,WebFetch,TodoRead,TodoWrite,WebSearch"# Rate Limiting  RATE_LIMIT_REQUESTS=10 # Requests per window RATE_LIMIT_WINDOW=60 # Window in seconds# Features ENABLE_GIT_INTEGRATION=true ENABLE_FILE_UPLOADS=true ENABLE_QUICK_ACTIONS=true # Development DEBUG=false LOG_LEVEL=INFO

๐Ÿ“‹ Full configuration reference: See .env.example for all available options with detailed descriptions.

Finding Your Telegram User ID

To get your Telegram user ID for the ALLOWED_USERS setting:

  1. Message @userinfobot on Telegram
  2. It will reply with your user ID number
  3. Add this number to your ALLOWED_USERS setting

๐Ÿ”ง Troubleshooting

Common Issues

Bot doesn't respond:

  • โœ… Check your TELEGRAM_BOT_TOKEN is correct
  • โœ… Verify your user ID is in ALLOWED_USERS
  • โœ… Ensure Claude Code CLI is installed and accessible
  • โœ… Check bot logs for error messages

"Permission denied" errors:

  • โœ… Verify APPROVED_DIRECTORY path exists and is readable
  • โœ… Ensure the bot process has file system permissions
  • โœ… Check that paths don't contain special characters

Claude integration not working:

If using SDK mode (USE_SDK=true, which is default):

  • โœ… Check CLI authentication: claude auth status
  • โœ… If no CLI auth, verify ANTHROPIC_API_KEY is set in .env
  • โœ… Ensure API key has sufficient credits
  • โœ… Check logs for "SDK initialization" messages

If using CLI mode (USE_SDK=false):

  • โœ… Verify Claude CLI is installed: claude --version
  • โœ… Check CLI authentication: claude auth status
  • โœ… Ensure CLI has sufficient credits

General troubleshooting:

  • โœ… Verify CLAUDE_ALLOWED_TOOLS includes necessary tools
  • โœ… Check CLAUDE_TIMEOUT_SECONDS isn't too low
  • โœ… Monitor usage with /status command

High usage costs:

  • โœ… Adjust CLAUDE_MAX_COST_PER_USER to set spending limits
  • โœ… Monitor usage with /status command
  • โœ… Use shorter, more focused requests
  • โœ… End sessions when done with /end

Getting Help

๐Ÿ›ก๏ธ Security

This bot implements enterprise-grade security:

  • ๐Ÿ” Access Control: Whitelist-based user authentication
  • ๐Ÿ“ Directory Isolation: Strict sandboxing to approved directories
  • โฑ๏ธ Rate Limiting: Request and cost-based limits prevent abuse
  • ๐Ÿ›ก๏ธ Input Validation: Protection against injection attacks
  • ๐Ÿ“Š Audit Logging: Complete tracking of all user actions
  • ๐Ÿ”’ Secure Defaults: Principle of least privilege throughout

For security issues, see SECURITY.md.

๐Ÿค Contributing

We welcome contributions! Here's how to get started:

Development Setup

# Fork and clone the repository git clone https://github.com/yourusername/claude-code-telegram.git cd claude-code-telegram # Install development dependencies make dev # Run tests to verify setup make test

Development Commands

make help# Show all available commands make test# Run tests with coverage  make lint # Run code quality checks make format # Auto-format code make run-debug # Run bot in debug mode

Contribution Guidelines

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch: git checkout -b feature/amazing-feature
  3. โœจ Make your changes with tests
  4. โœ… Test your changes: make test && make lint
  5. ๐Ÿ“ Commit your changes: git commit -m 'Add amazing feature'
  6. ๐Ÿš€ Push to the branch: git push origin feature/amazing-feature
  7. ๐ŸŽฏ Submit a Pull Request

Code Standards

  • Python 3.9+ with type hints
  • Black formatting (88 char line length)
  • pytest for testing with >85% coverage
  • mypy for static type checking
  • Conventional commits for commit messages

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŒŸ Star History

If you find this project useful, please consider giving it a star! โญ

๐Ÿ™ Credits & Acknowledgments

Original Project

This project is a fork of claude-code-telegram by Richard Atkinson.

  • Original Author: Richard Atkinson (GitHub)
  • Original License: MIT License (maintained in this fork)
  • Original Concept: Telegram bot for remote Claude Code access

Fork Maintainer

  • Enhanced By: milhy545 (GitHub)
  • Fork Started: 2024
  • Major Changes: Multi-AI support (8 providers), AI abstraction layer, PyPI publishing, enhanced features

Special Thanks

  • Claude by Anthropic for the amazing AI capabilities
  • OpenAI for GPT models
  • DeepSeek, Groq, and all AI provider teams
  • python-telegram-bot for the excellent Telegram integration
  • All contributors who help make both projects better

Contributing Back

While this fork has diverged significantly from the original project, we acknowledge and respect the foundation provided by Richard Atkinson's work. If you're looking for a simpler, Claude-focused solution, check out the original project.


Made with โค๏ธ for developers who code on the go

About

A powerful Telegram bot that provides remote access to Claude Code, enabling developers to interact with their projects from anywhere with full AI assistance and session persistence.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python98.9%
  • Other1.1%