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

claudegram

v2.1.1

Published

Control Claude Code or OpenAI Codex from Telegram with full computer access

Readme

Claudegram

Control AI coding assistants (Claude Code or OpenAI Codex) from Telegram with full computer access.

License: MIT

Overview

Claudegram bridges AI coding assistants to Telegram, letting you interact with them from anywhere. Supports both Claude Code and OpenAI Codex CLI as backends. The AI has full computer access, enabling file operations, bash commands, and more.

Screenshots

Real-time Progress Updates

Progress Updates

Screenshot Capture

Screenshot Feature

Features

  • Multiple AI Backends — Choose between Claude Code CLI or OpenAI Codex CLI
  • Full Computer Access — AI can read/write files, execute commands, etc.
  • Real-time Progress — See what the AI is doing (reading files, running commands, etc.)
  • Streaming Updates — Tool usage displayed as it happens, with 30s fallback messages
  • Security Prompts — Configurable system prompt to require confirmation before actions
  • Image Input — Send images from Telegram to the AI
  • Screenshots — Capture and receive screenshots from the host machine
  • Direct Shell Access — Execute commands directly via /cmd
  • Secure Access — Telegram user ID whitelist

Architecture

Telegram Client
    ↕ (Telegram Bot API)
Claudegram
    ↕ (AI Client Interface)
    ├── Claude Code CLI (--dangerously-skip-permissions)
    └── OpenAI Codex CLI (--full-auto)
    ↕
Your Computer

Requirements

  • macOS (screenshot feature is macOS-only)
  • Node.js >= 18.0.0
  • One of the following AI CLIs:
    • Claude Code CLI installed and authenticated (claude), OR
    • OpenAI Codex CLI installed and authenticated (npm i -g @openai/codex && codex auth)
  • Telegram Bot Token (via @BotFather)
  • Screen Recording permission for screenshots (System Settings > Privacy & Security > Screen Recording)

Installation

npm (Recommended)

npm install -g claudegram

After installation, run the bot with:

claudegram

From Source

git clone https://github.com/Nicolas-Arsenault/claudegram.git
cd claudegram
npm install
npm run build

Setup

Creating a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Start a chat and send /newbot
  3. Choose a display name for your bot (e.g., "My Claudegram")
  4. Choose a username ending in bot (e.g., my_claudegram_bot)
  5. BotFather will reply with your bot token — save this securely
Done! Congratulations on your new bot. You will find it at t.me/my_claudegram_bot.
Use this token to access the HTTP API:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz

Getting Your Telegram User ID

Your user ID is required for the whitelist. To find it:

  1. Search for @userinfobot on Telegram
  2. Start a chat and send any message
  3. The bot replies with your user ID
Your user ID: 123456789

Alternatively, forward a message from yourself to @userinfobot.

Authenticating Claude Code

Before running Claudegram, ensure Claude Code is authenticated:

claude

This will open a browser for OAuth login with Anthropic. Once authenticated, Claudegram will use those stored credentials.

Configuration

| Variable | Required | Description | |----------|----------|-------------| | TELEGRAM_BOT_TOKEN | Yes | Telegram bot API token | | ALLOWED_USER_IDS | Yes | Comma-separated Telegram user IDs | | AI_BACKEND | No | AI backend: claude or codex (default: claude) | | SYSTEM_PROMPT_FILE | No | Path to custom system prompt file (default: CLAUDE_PROMPT.md in package root) | | SCREENSHOT_OUTPUT_DIR | No | Screenshot directory (default: ./screenshots) | | INPUT_IMAGE_DIR | No | Image directory (default: ./inputs) | | SESSION_IDLE_TIMEOUT_MS | No | Idle timeout in ms (default: 10800000 / 3 hours) |

Example (Claude Code)

export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
export ALLOWED_USER_IDS="123456,789012"
claudegram

Example (OpenAI Codex)

# Install and authenticate Codex CLI first
npm install -g @openai/codex
codex auth

# Then run Claudegram with Codex backend
export TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
export ALLOWED_USER_IDS="123456,789012"
export AI_BACKEND="codex"
claudegram

If installed from source, use npm start instead of claudegram.

Usage

Telegram Commands

| Command | Description | |---------|-------------| | /start | Start a new Claude session (required before sending messages) | | /status | Check if a session is active | | /screenshot | List available displays | | /screenshot <n> | Capture display n | | /interrupt | Stop current operation (session remains active) | | /kill | Terminate current session | | /cmd <command> | Execute shell command directly (bypasses Claude) |

All other messages are sent to Claude Code (requires active session).

Progress Updates

While Claude works, you'll see real-time updates:

  • 🔧 Reading: src/index.ts — File being read
  • 🔧 Writing: src/config.ts — File being written
  • 🔧 Running: npm test — Command being executed
  • 🔧 Searching for: "pattern" — Content search
  • 💭 Thinking... — Claude is reasoning
  • ⏳ Still working... — Fallback every 30s if no other activity

Plan Mode Updates:

  • 📋 Entering Plan Mode — Claude is planning before executing
  • ✅ Plan Approved — Claude is proceeding with implementation
  • 📝 Creating task: ... — Task being added to plan
  • ✏️ Updating task → completed — Task status change

User Input Requests:

  • ❓ Claude needs your input: — Claude is asking a question with options
    • Reply with your choice or a custom response

Direct Shell Execution

The /cmd command executes shell commands directly on the host machine without going through Claude:

/cmd ls -la
/cmd git status
/cmd npm test

Output includes stdout, stderr, and exit code. Long outputs are automatically split across multiple messages.

Image Handling

  1. Send any image to the bot
  2. Image is saved locally
  3. Claude is notified with the file path
  4. Add a caption for context

Security

Access Control

  • Only whitelisted Telegram user IDs can interact
  • Messages from unauthorized users are silently ignored
  • No inbound network ports exposed

System Prompt

Claudegram includes a default security prompt (CLAUDE_PROMPT.md in the package root) that instructs Claude to:

  • Ask for confirmation before destructive operations
  • Explain what actions it plans to take
  • Request approval before modifying or deleting files
  • Warn about potentially dangerous commands

The default prompt is automatically loaded regardless of which directory you start the bot from. You can customize this by editing CLAUDE_PROMPT.md or setting SYSTEM_PROMPT_FILE to an absolute path to a different file.

Session Model

  • Explicit start — Use /start to create a session (no auto-creation)
  • Persistent context — AI retains full context within a session via session resume
  • One session per chat — Each Telegram chat has its own AI instance
  • 3-hour timeout — Sessions end after 3 hours of inactivity (configurable)
  • Interrupt support — Use /interrupt to stop current operation while keeping session
  • Manual termination — Use /kill to end a session early
  • Clean process management/kill terminates any running AI process

Connection Resilience

The bot includes automatic recovery mechanisms for long-running deployments:

  • Error handling — Telegraf errors are caught and logged without crashing
  • Automatic reconnection — Network failures trigger reconnection with exponential backoff (up to 10 attempts)
  • Health monitoring — Periodic API checks every 2 minutes; reconnects if no updates for 5 minutes
  • Memory management — Stale progress tracking entries are cleaned up automatically
  • Global error handlers — Unhandled rejections and exceptions are logged

Project Structure

src/
├── index.ts              # Entry point
├── config.ts             # Configuration (incl. AI backend selection)
├── sdk/
│   ├── types.ts          # AIClient interface & shared types
│   ├── client.ts         # Claude Code SDK client
│   └── codex-client.ts   # OpenAI Codex SDK client
├── telegram/bot.ts       # Telegram handler with progress updates
├── screenshot/capture.ts # Screenshot (macOS)
└── security/access.ts    # Access control

License

MIT