Skip to content

Problem: Claude Code prompts cannot be answered from Telegram #5

Description

@Filyus

Sometimes Claude Code asks a question directly in the terminal, for example:

1. Yes
2. Yes, and don't ask again
3. No

Right now, this question cannot be answered from Telegram.

The reason is that this prompt is not sent through MCP. It is part of Claude Code’s own terminal UI and waits for input from stdin. Since hdcd-telegram runs as an MCP server inside Claude Code, it cannot control that terminal input.

So Telegram can send messages to Claude Code, but it cannot answer Claude Code’s own terminal prompts.

Idea 1: Add a runner mode

One possible solution is to add a new mode where hdcd starts and manages Claude Code itself.

Current architecture:

Claude Code → starts hdcd-telegram as MCP server

Possible new architecture:

hdcd-runner → starts Claude Code → connects it to Telegram

In this mode, hdcd would control the Claude Code process from the outside.

When Claude Code asks a question, hdcd-runner could send that question to Telegram with buttons. The user selects an answer in Telegram, and hdcd-runner sends the answer back to Claude Code.

This would make Telegram a real remote control interface for Claude Code.

This approach is probably the cleanest long-term solution, especially for router mode, because router mode already maps Telegram topics to different Claude Code sessions.

Idea 2: Use hooks for approval prompts

A smaller solution would be to use Claude Code hooks.

When Claude Code asks for permission, a hook could send the request to Telegram. Telegram would show buttons like:

Allow
Deny
Allow always

Then the hook would wait for the user’s answer and return the decision to Claude Code.

This would be easier to add than a full runner mode.

The downside is that it may be less reliable. For example, if the user does not answer in Telegram, the hook may block or time out. It would also need careful handling of pending requests, cancellations, and session routing.

Summary

The problem is not router mode itself. Router mode solves Telegram routing between multiple sessions.

The missing part is answering Claude Code’s own terminal prompts from Telegram.

There are two possible directions:

  1. Runner modehdcd starts and manages Claude Code, so it can handle interactive prompts properly.
  2. Hook-based approval bridge — use hooks to forward permission prompts to Telegram and return the user’s choice.

Runner mode is cleaner long-term. Hooks are probably easier as a first step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions