Refactoring Summary: Direct Claude Code Integration

Completed: 2026-01-27

Objective

Remove Gemini dependency and simplify bot architecture to pass all Telegram messages directly to Claude Code CLI.

Architecture Change

Before:

Telegram Message

Intent Parser (Gemini) → Skill Extraction

Workflow Orchestrator → Confirmation Flow

Claude Code Executor (skill-specific)

Results

After:

Telegram Message

Claude Code CLI --print

Results (with progress updates)

Files Modified

File
Lines Changed
Description

parsers/intent_parser.py

115 → 34

Removed Gemini LLM logic, only extracts URLs

workflows/orchestrator.py

264 → 159

Removed confirmation flow, direct execution

executors/claude_executor.py

+84 lines

Added execute_direct() method

handlers/message_handler.py

98 → 77

Simplified, removed confirmation UI

requirements.txt

-1 dep

Removed google-generativeai

config.py

-1 field

Removed gemini_api_key

.env.example

-1 line

Removed GEMINI_API_KEY

README.md

Updated

New architecture diagram & features

Benefits

  1. Simpler Architecture: Single integration point (Claude Code CLI)

  2. No External Dependencies: Removed Gemini API requirement

  3. No API Management: No keys, quotas, or rate limits to manage

  4. More Predictable: Claude Code handles all interpretation consistently

  5. Fewer Dependencies: 4 Python packages instead of 5

Key Changes

Intent Parser (Simplified)

Claude Executor (New Method)

Message Handler (Simplified)

Testing Status

✅ Configuration validated ✅ All imports successful ✅ Bot token configured ✅ Orchestrator initialized

Next Steps for Users

  1. Start the bot:

  2. Test with simple message: Send via Telegram: "create a simple hello world Python script"

  3. Test with URL: Send via Telegram: "analyze https://www.anthropic.com"

  4. Test with complex task: Send via Telegram: "analyze article https://example.com/article, create infographic, commit to github"

Rollback Instructions

If needed, revert to Gemini-based version:

Commit Details

Commit: e88d9aa Message: refactor: Remove Gemini dependency, use direct Claude Code CLI integration Files Changed: 8 files changed, 171 insertions(+), 320 deletions(-) Author: Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.comenvelope

Last updated