/telegram:access skill ignores TELEGRAM_STATE_DIR — breaks multi-instance pairing

Resolved 💬 3 comments Opened Apr 2, 2026 by HAL-XP Closed May 22, 2026

Environment

  • Claude Code: v2.1.89
  • OS: Windows 11 Pro (10.0.26200)
  • Telegram plugin: v0.0.4 (plugin:telegram@claude-plugins-official)

Description

The /telegram:access skill hardcodes the access file path to ~/.claude/channels/telegram/access.json (in skills/access/SKILL.md, lines 31, 60, 66). It does not read the TELEGRAM_STATE_DIR environment variable.

The channel server (server.ts) correctly respects TELEGRAM_STATE_DIR:

const STATE_DIR = process.env.TELEGRAM_STATE_DIR ?? join(homedir(), '.claude', 'channels', 'telegram')

But the skill's prompt always tells Claude to read/write ~/.claude/channels/telegram/access.json, regardless of the env var.

Impact

In a multi-instance setup (multiple Claude Code sessions with separate Telegram bots), each instance uses a different TELEGRAM_STATE_DIR (e.g., ~/.claude/channels/telegram-john/). When a user runs /telegram:access pair <code>:

  1. The skill reads ~/.claude/channels/telegram/access.json (wrong file — belongs to another instance)
  2. The pending entry is in ~/.claude/channels/telegram-john/access.json (correct file)
  3. The skill reports "no pending entry found" — pairing silently fails
  4. Same issue with /telegram:access allow, /telegram:access status, etc.

Expected behavior

The skill should resolve the access file path using TELEGRAM_STATE_DIR, matching the channel server's behavior. The SKILL.md prompt should instruct Claude to check process.env.TELEGRAM_STATE_DIR or read from the MCP server's state directory instead of hardcoding the default path.

Workaround

Manually write the allowFrom entry in the correct instance-specific access.json file.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗