Skip to content

Heyagent

Telegram bridge for Claude Code and Codex CLI

Install

$npm install -g heyagent

Install command taken from the project's README or registry entry. Always review code before running it.

HeyAgent CLI

HeyAgent CLI is a bidirectional Telegram bridge for Claude Code and Codex. Send and receive Telegram messages with Codex or Claude (and switch any time).

Fully free, fully open source, and fully local — no server or external storage required.

v2 Update

Note: before v2, this project focused on notification integration for CLI coding agents.

Installation

npm install -g heyagent

Usage

# Resume latest session (default)
hey claude
hey codex

# Create new session
hey claude --new
hey codex --new

# Run with explicit session id
hey claude --session [SESSION-ID]   # resumes given session
hey codex --session [SESSION-ID]    # resumes given session

# Show local pairing/session status
hey status

# Reset Telegram setup (clears bot token + chat pairing)
hey reset

# Non-interactive reset
hey reset --yes

Setup and Pairing Flow

Start with hey claude or hey codex.

On first run, HeyAgent will:

  1. Ask for setup mode:
    • Phone setup (recommended) — scan one QR code and complete guided steps on your phone
    • Manual fallback — no tunnel required; paste the bot token directly into the terminal
  2. In phone setup mode, CLI starts a temporary local server exposed via a Cloudflare Quick Tunnel and shows a single QR code. (This same tool is handy for reaching your local dev environment from your phone.)
  3. Complete guided steps on phone:
    • Open BotFather
    • Create your own bot
    • Submit bot token
    • Open bot chat and press START
  4. CLI validates token, waits for pairing, and stores bot + chat locally.

Manual fallback avoids tunneling completely:

  1. Create your own bot
  2. Paste bot token into the terminal.
  3. CLI shows bot opening link/QR for pairing.

If recommended phone onboarding fails in your environment, install system cloudflared (for example brew install cloudflared) or choose manual fallback.

Telegram Commands

Inside Telegram:

  • /help list commands
  • /new force next prompt to run as a new session
  • /claude switch active provider to Claude
  • /codex switch active provider to Codex
  • /status show provider, directory, bot, session, and pairing
  • /stop stop current execution and clear queued messages

Any other text message is forwarded to the active agent. For voice input, keyboard dictation on your phone is recommended.

Local CLI Input

When running in an interactive terminal, HeyAgent also accepts live local input.

  • Plain text: run prompt through provider and send response to Telegram
  • /ask same as plain text
  • /say <text> send raw message directly to Telegram
  • /new force next prompt to start a fresh session
  • /stop stop current execution and clear queued Telegram messages
  • /claude switch to Claude provider
  • /codex switch to Codex provider
  • /status print local bridge status
  • /help show local commands
  • /exit stop the running bridge

CLI logs are shown for inbound Telegram commands, local prompts, and outgoing messages.

Provider Execution

Default runtime:

  • claude --dangerously-skip-permissions -p --output-format json ""
  • codex exec --dangerously-bypass-approvals-and-sandbox --json ""

You can override default bypass behavior by passing explicit provider permission flags, for example:

  • hey claude --permission-mode acceptEdits
  • hey codex --full-auto

Session startup strategy:

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

Multi-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, Google Antigravity, and Pi

Open source Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents. Built for multitasking, organization, and programmability.

The Developer Tool for Visual Engineers • An Open-Source AI-First Design tool • Visually build, style, and edit your code with AI • World's best, top-most agent recommended #1…

A powerful GUI app and Toolkit for Claude Code - Create custom agents, manage interactive Claude Code sessions, run secure background agents, and more.

Explore related