Skip to main content

Telegram remote-control daemon for Claude Code CLI sessions running in dtach

Project description

aipager

Telegram remote-control for Claude Code CLI sessions. Run Claude inside a detached terminal (dtach), drive it from your phone — read responses, send prompts, approve permission requests, switch sessions — without an SSH session staying open.

Install

Linux or macOS, any architecture. dtach is installed automatically via the dtach-bin dependency — no separate system package needed.

One-line install (recommended)

curl -fsSL https://raw.githubusercontent.com/dev-aly3n/aipager/main/install.sh | sh

This auto-detects uv / pipx / brew and uses whichever is already on your system. If none is present, it bootstraps uv (Astral's Python tool manager) and installs through it.

uv

uv tool install aipager     # if uv is already installed

— or to install uv first:

curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install aipager

uv bundles its own Python interpreter, so this works on any macOS / Linux version regardless of what system Python is doing.

pipx

pipx install aipager

Homebrew tap (macOS, Linuxbrew)

brew install dev-aly3n/tap/aipager

Pulls dtach from Homebrew's standard formula and installs aipager into a Homebrew-managed Python venv.

Heads-up: if you're on macOS Tahoe (26.x), the brew path may fail at pip install time with a pyexpat _XML_SetAllocTrackerActivationThreshold symbol error — that's a known Homebrew Python bottle issue unrelated to aipager. Use the uv path instead (it's not affected) until Homebrew rebuilds the bottles for Tahoe.

Configure

aipager config

Interactive wizard — asks for your Telegram bot token (from @BotFather) and chat ID, validates them, then patches ~/.claude/settings.json to wire the necessary hooks automatically. You never edit any file by hand.

Run

aipager start

The daemon stays in the foreground. Launch a Claude session in another terminal:

aipager session dev

This creates (or reattaches to) a dtach session named claude-dev running Claude Code. The aipager daemon discovers it within seconds and Telegram starts mirroring it. Re-run the same command to reattach later; detach with Ctrl-\.

If the dtach session was killed (machine reboot, etc.) but you want to pick up the Claude conversation from disk, add --resume:

aipager session dev --resume    # resume the last claude conversation in this cwd

You can also pass --resume <session-id> (or any other claude flag) through as trailing args:

aipager session dev -- --resume abc1234

Run as a service (survives logout)

aipager service install

On Linux this writes a systemd-user unit at ~/.config/systemd/user/aipager.service and starts it. On macOS it writes a launchd plist at ~/Library/LaunchAgents/com.aipager.daemon.plist and bootstraps it. Subcommands: start, stop, status, logs, uninstall.

What it does

  • Mirrors Claude Code session state to Telegram: busy/idle, tool calls, context %, cost, line counts
  • Lets you reply to messages to inject prompts back into the session
  • Surfaces permission prompts and AskUserQuestion dialogs as Telegram inline keyboards
  • Notifies on context warnings, compaction, session end, and stalls
  • Supports multiple concurrent sessions with one bot
  • Optional read-only observer bots

Note on model buttons (Bedrock / Vertex users)

The persistent keyboard's Model submenu sends /model sonnet, /model opus, /model haiku, and /model opusplan — Claude Code's aliases. On the Anthropic API these resolve to the latest in each family (currently Opus 4.7, Sonnet 4.6, Haiku 4.5). On Bedrock and Vertex the same aliases may resolve to older snapshots depending on your provider's available versions. If you target those backends and want a specific model, tap the alias as a starting point, then /model <full-id> from chat.

Developing locally

git clone <repo-url> aipager && cd aipager
python3 -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
pytest -q

When iterating on code changes you'll generally want to also install dtach-bin from a local checkout — or pip install dtach-bin — so the runtime can find dtach on PATH.

Release process is in CONTRIBUTING.md.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aipager-0.3.11.tar.gz (93.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aipager-0.3.11-py3-none-any.whl (83.3 kB view details)

Uploaded Python 3

File details

Details for the file aipager-0.3.11.tar.gz.

File metadata

  • Download URL: aipager-0.3.11.tar.gz
  • Upload date:
  • Size: 93.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aipager-0.3.11.tar.gz
Algorithm Hash digest
SHA256 388b1bc18bc33de2f0e2baab3aaa9242279022a971223ec935085aa1fda16bce
MD5 f408e455ab5c96c7b714be75f0d2a19a
BLAKE2b-256 e75af812c4f181479c75461cf7a05eb3d7da29e1857d00c8b7d83b51c041ae61

See more details on using hashes here.

Provenance

The following attestation bundles were made for aipager-0.3.11.tar.gz:

Publisher: publish.yml on dev-aly3n/aipager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aipager-0.3.11-py3-none-any.whl.

File metadata

  • Download URL: aipager-0.3.11-py3-none-any.whl
  • Upload date:
  • Size: 83.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aipager-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c3da6d26ac73f0d094bea9ff669718b34ffe621bd8999792d1e7a7b6e49ddb47
MD5 cb874c7075a978eac9d7b8bf025e8b53
BLAKE2b-256 415d2464f1fc006290691bece7c68e333b3262699d73ee5f2b71ddc57a9d1ae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aipager-0.3.11-py3-none-any.whl:

Publisher: publish.yml on dev-aly3n/aipager

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page