Ferret
Small, fast, fetches anything. A Telegram bot that pipes Claude Code CLI straight into your chat - running on your own server, billed to your own subscription.
What it does
Ferret runs Claude Code CLI as a subprocess on your VPS and connects it to a Telegram bot. Send a message - Ferret forwards it to Claude, streams the response back, and formats it cleanly for Telegram. You get named dialogs with persistent memory, per-dialog model selection (Opus, Sonnet, Haiku), and conversation logs - all from any device with Telegram installed.
Why I built it
I wanted Claude on my phone without a third-party app, without paying API markup on top of a subscription I already have, and without my conversation history sitting on someone else's server. Claude Code CLI is the right tool - it handles sessions, tool use, and auth - but it's terminal-only. Ferret is the missing Telegram wrapper.
How it works
- Runs as a systemd service on any Linux VPS under a non-root user.
- Each chat message spawns a short-lived
claude -psubprocess and resumes the stored session. - Session IDs are stored in SQLite - dialogs survive restarts and can be switched on the fly.
- Inline keyboard for switching, renaming, and deleting dialogs without typing commands.
- Billing goes to your existing Claude subscription or
ANTHROPIC_API_KEY- Ferret adds zero overhead. - Concurrency guard: one active Claude process per chat at a time.
- Multi-user:
ALLOWED_USER_IDSaccepts a comma-separated list; each user gets isolated dialogs.
Feedback
Bugs and feature requests via GitHub Issues. Anything else: email.