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

afk-code

v0.3.0

Published

Monitor and interact with Claude Code sessions from Slack/Discord/Telegram

Readme

AFK Code

Monitor and interact with Claude Code sessions from Slack, Discord, or Telegram. Respond from your phone while AFK.

Client Comparison

Telegram and Discord are recommended.

| | Telegram | Discord | Slack | |---|---|---|---| | Siri integration | Receive & Send | Receive only | Receive only | | Multi-session support | One at a time (switchable) | Yes | Yes | | Permissions required | Personal | Personal | Admin | | Image support | Yes | Yes | Yes |

Quick Start (Telegram)

# 1. Create a bot with @BotFather on Telegram
#    - Send /newbot and follow the prompts
#    - Copy the bot token

# 2. Get your Chat ID
#    - Message your bot, then visit:
#    - https://api.telegram.org/bot<TOKEN>/getUpdates
#    - Find "chat":{"id":YOUR_CHAT_ID}

# 3. Configure and run
npx afk-code telegram setup   # Enter your credentials
npx afk-code telegram         # Start the bot

# 4. In another terminal, start a monitored Claude session
npx afk-code claude

Quick Start (Discord)

# 1. Create a Discord app at https://discord.com/developers/applications
#    - Go to Bot → Reset Token → copy it
#    - Enable "Message Content Intent"
#    - Go to OAuth2 → URL Generator → select "bot" scope
#    - Select permissions: Send Messages, Manage Channels, Read Message History, Attach Files
#    - Open the generated URL to invite the bot

# 2. Get your User ID (enable Developer Mode, right-click your name → Copy User ID)

# 3. Configure and run
npx afk-code discord setup   # Enter your credentials
npx afk-code discord         # Start the bot

# 4. In another terminal, start a monitored Claude session
npx afk-code claude

Quick Start (Slack)

# 1. Create a Slack app at https://api.slack.com/apps
#    Click "Create New App" → "From manifest" → paste slack-manifest.json

# 2. Install to your workspace and get credentials:
#    - Bot Token (xoxb-...) from OAuth & Permissions
#    - App Token (xapp-...) from Basic Information → App-Level Tokens (needs connections:write)
#    - Your User ID from your Slack profile → "..." → Copy member ID

# 3. Configure and run
npx afk-code slack setup   # Enter your credentials
npx afk-code slack         # Start the bot

# 4. In another terminal, start a monitored Claude session
npx afk-code claude

A new channel is created for each session. Messages relay bidirectionally.

Image Support

When Claude references image paths in responses (e.g., /path/to/screenshot.png), the bot automatically detects and uploads them to the chat. Supports PNG, JPG, GIF, WebP, and other common formats.

Commands

afk-code telegram setup     Configure Telegram credentials
afk-code telegram           Run the Telegram bot
afk-code discord setup      Configure Discord credentials
afk-code discord            Run the Discord bot
afk-code slack setup        Configure Slack credentials
afk-code slack              Run the Slack bot
afk-code <command> [args]   Start a monitored session
afk-code help               Show help

Slash Commands

| Command | Slack | Discord | Telegram | Description | |---------|:-----:|:-------:|:--------:|-------------| | /sessions | ✓ | ✓ | ✓ | List active sessions | | /switch <name> | - | - | ✓ | Switch session (Telegram only) | | /model <name> | ✓ | ✓ | ✓ | Switch model (opus, sonnet, haiku) | | /compact | ✓ | ✓ | ✓ | Compact the conversation | | /background | ✓ | ✓ | ✓ | Send Ctrl+B (background mode) | | /interrupt | ✓ | ✓ | ✓ | Send Escape (interrupt) | | /mode | ✓ | ✓ | ✓ | Toggle mode (Shift+Tab) |

Installation Options

# Global install
npm install -g afk-code

# Or use npx (no install)
npx afk-code <command>

# Or run from source
git clone https://github.com/clharman/afk-code.git
cd afk-code && npm install
npm run dev -- slack
npm run dev -- claude

Requires Node.js 18+.

How It Works

  1. afk-code slack, afk-code discord, or afk-code telegram starts a bot that listens for sessions
  2. afk-code claude spawns Claude in a PTY and connects to the bot via Unix socket
  3. The bot watches Claude's JSONL files for messages and relays them to chat
  4. Messages you send in chat are forwarded to the terminal

Limitations

  • Does not support plan mode or responding to Claude Code's form-based questions (AskUserQuestion)
    • You can bypass this using the /mode command or by sending any message
  • Does not send tool calls or results (would encounter rate limits)

Disclaimer

This project is not affiliated with Anthropic. Use at your own risk.

License

MIT