{"id":49770034,"url":"https://github.com/r266-tech/babata","last_synced_at":"2026-05-11T12:23:46.692Z","repository":{"id":351047502,"uuid":"1209314626","full_name":"r266-tech/babata","owner":"r266-tech","description":"Talk to Claude Code from Telegram. Thin transport — same CC, just a different wire.","archived":false,"fork":false,"pushed_at":"2026-05-09T07:46:12.000Z","size":640,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T09:32:09.224Z","etag":null,"topics":["ai-agent","claude-code","macos","mcp","personal-assistant","python","telegram-bot","wechat-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r266-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T09:54:28.000Z","updated_at":"2026-05-09T07:46:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/r266-tech/babata","commit_stats":null,"previous_names":["r266-tech/cc-tg","r266-tech/babata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/r266-tech/babata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r266-tech%2Fbabata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r266-tech%2Fbabata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r266-tech%2Fbabata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r266-tech%2Fbabata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r266-tech","download_url":"https://codeload.github.com/r266-tech/babata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r266-tech%2Fbabata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32894424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","claude-code","macos","mcp","personal-assistant","python","telegram-bot","wechat-bot"],"created_at":"2026-05-11T12:23:45.359Z","updated_at":"2026-05-11T12:23:46.684Z","avatar_url":"https://github.com/r266-tech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babata\n\nYour Claude Code, on Telegram.\n\nbabata is a thin transport layer that lets you talk to Claude Code from any phone, any client. Same CC binary, same skills, same memory — just a different wire.\n\n```\n                             ┌─────────────┐\n   📱 Telegram / WeChat ────▶│   babata    │────▶  claude  ─── Anthropic\n                             │  (transport) │\n                             └─────────────┘\n```\n\nThe bot only does what CC physically cannot: TG HTML / 4096-char chunking / OGG voice transcription / image base64. It gives CC capabilities (MCP tools to push back to TG), never tells CC how to use them.\n\n## Quick Start\n\n```bash\ngit clone https://github.com/r266-tech/babata.git\ncd babata\nbash install.sh\n```\n\nDetects what's missing (Python / uv / ffmpeg / Claude Code), installs deps, scaffolds `.env`. Then edit `.env` and run.\n\n## You'll need\n\n- **macOS or Linux** with Python 3.11+\n- **A Telegram bot** — message [@BotFather](https://t.me/BotFather), `/newbot`, save the token\n- **Your TG user ID** — message [@userinfobot](https://t.me/userinfobot)\n- **An Anthropic API key** — https://console.anthropic.com → Settings → API keys\n  - *Or skip the key + set `BABATA_SHARED_CC=1` to share with your existing logged-in `claude`*\n\n## Run\n\n```bash\n$EDITOR .env                    # fill TELEGRAM_BOT_TOKEN, ALLOWED_USER_ID, ANTHROPIC_API_KEY\nbabata                          # bot starts (foreground, Ctrl+C to stop)\n                                # → message it on Telegram\n```\n\n`install.sh` symlinks `babata` into `~/.local/bin/`, so it's globally available — same shape as `hermes` / `openclaw`. (If the command isn't found, add `~/.local/bin` to your PATH.)\n\n## Modes\n\n**Default — isolated (recommended for OSS users)**:\nbabata doesn't touch your `~/.claude/` settings, doesn't read your OAuth keychain, doesn't pollute your existing CC sessions. It runs as its own contained Claude instance, authed via `ANTHROPIC_API_KEY`.\n\n**Shared mode** (`.env`: `BABATA_SHARED_CC=1`):\nbabata shares your existing logged-in CC — same skills, same settings, same OAuth. No `ANTHROPIC_API_KEY` needed. Quota / settings changes affect both.\n\n**Full trust** (`.env`: `BABATA_FULL_TRUST=1`):\nbabata's CC subprocess runs with `cwd=$HOME` and `permission_mode=auto` (CC official auto mode, status shows \"auto mode on\") — can read your home, run any command without prompts for low-risk work. ⚠️ Only when `ALLOWED_USER_ID` is strictly correct, since anyone who can DM the bot effectively gets shell access.\n\n## Multi-instance\n\nRun multiple babatas on one machine — different TG bots, different chats, shared code, independent state. Second instance:\n\n```bash\nBABATA_INSTANCE=alice TELEGRAM_BOT_TOKEN=... ALLOWED_USER_ID=... .venv/bin/python bot.py\n```\n\nState files / sockets / launchd labels all derive from `PROJECT_NAMESPACE` + `BABATA_INSTANCE` so nothing collides.\n\n## Persist (macOS launchd)\n\nSee [`docs/persist-macos.md`](docs/persist-macos.md) — copy a plist template, edit paths, `launchctl bootstrap`.\n\n## Architecture\n\n| File | Role |\n|---|---|\n| `bot.py` | TG transport (HTML, 4096 chunks, reactions, auth) |\n| `weixin_bot.py` | WeChat transport (iLink protocol, optional) |\n| `cc.py` | Claude Code SDK wrapper, channel-agnostic |\n| `bridge.py` | Unix socket so MCP tools can push to TG |\n| `tg_mcp.py` | MCP tools `tg_send_*` exposed to CC |\n| `media.py` | OGG → WAV, image base64, video understanding |\n| `constants.py` | Single source of truth for paths / labels |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr266-tech%2Fbabata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr266-tech%2Fbabata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr266-tech%2Fbabata/lists"}