npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tg-claude

v0.3.7

Published

Bridge between Claude Code CLI and Telegram for mobile interaction

Readme

Claude Telegram Bridge

Control Claude Code from your phone via Telegram. Get notifications when Claude needs input, respond with buttons or text, and monitor progress from anywhere.

Features

  • Mobile Notifications: Get Telegram alerts when Claude needs a decision
  • Interactive Buttons: Tap to select options without typing
  • Multi-Select Support: Handle questions with multiple choices
  • Dual Interface: Use both terminal and Telegram simultaneously
  • Session Continuity: Continue conversations across turns
  • Autonomous Mode: Runs with --dangerously-skip-permissions for unattended operation

Quick Start

Prerequisites

Installation

npm install -g tg-claude

Setup (Interactive Wizard)

Just run the command — the setup wizard guides you through everything:

tg-claude

The wizard will:

  1. Walk you through creating a Telegram bot via @BotFather
  2. Help you get your user ID from @userinfobot
  3. Save credentials to .env automatically

That's it! Now run with a prompt:

tg-claude "Fix the bug in app.js"

Alternative: npx (no install)

npx tg-claude

Note: With npx, the .env file is created in your current directory. Run from your project folder.

Re-run Setup

To reconfigure your Telegram credentials anytime:

tg-claude --setup

Usage

tg-claude [options] "Your prompt"

Options

| Flag | Description | |------|-------------| | --setup | Run setup wizard to configure Telegram credentials | | --help, -h | Show help message | | --version, -v | Show version number | | --verbose | Show additional logging | | --debug | Enable debug output | | --quiet | Suppress bridge logs, show only Claude output |

Examples

# Basic usage
tg-claude "Explain this codebase"

# Verbose output
tg-claude --verbose "Refactor the auth module"

# Quiet mode (only Claude's output)
tg-claude --quiet "Write tests for user.ts"

# Using npx
npx tg-claude "Create a README"

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | TELEGRAM_BOT_TOKEN | Yes | Bot token from @BotFather | | TELEGRAM_USER_ID | Yes | Your numeric Telegram user ID |

Without Telegram credentials, the bridge runs in terminal-only mode.

How It Works

  1. Start: You run tg-claude "your prompt"
  2. Execute: Claude Code processes your request autonomously
  3. Notify: When Claude needs input, you get a Telegram notification
  4. Respond: Tap a button or type a response
  5. Continue: Claude resumes with your answer
  6. Complete: Get a completion notification when done

The bridge uses Claude's --output-format stream-json for structured events and --resume for session continuity.

Dual Interface

Both terminal and Telegram can respond to prompts:

  • Terminal: Type option numbers or freeform text
  • Telegram: Tap buttons or send messages
  • Responses from either interface are echoed to the other

Security

Only the configured TELEGRAM_USER_ID can interact with your bot. All other users are silently ignored.

Troubleshooting

"TELEGRAM_USER_ID must be a number"

Your user ID should be a numeric value like 123456789, not a username. Get it from @userinfobot.

"Claude CLI not found"

Install Claude Code CLI:

npm install -g @anthropic-ai/claude-code
claude auth login

"Permission denied" or EACCES errors

Fix npm permissions (recommended one-time fix):

sudo chown -R $(whoami) ~/.npm

Then install normally:

npm install -g tg-claude

Or use a custom npm prefix:

npm config set prefix ~/.npm-global
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
npm install -g tg-claude

Avoid using sudo with npx — it creates files with root ownership which causes issues.

Bot not responding

  1. Make sure you messaged your bot at least once to start a conversation
  2. Verify TELEGRAM_BOT_TOKEN and TELEGRAM_USER_ID are correct
  3. Check that Claude Code CLI is authenticated (claude auth status)

Development

git clone https://github.com/memehalis/tg-claude
cd tg-claude
npm install
npm run dev "test prompt"

License

MIT