gitwtfhub

wtf is claudep-telegram-thinking?

gwendolenmave/claudep-telegram-thinking — explained in plain English

Analysis updated 2026-05-18

21Audience · developerComplexity · 3/5Setup · moderate

TL;DR

A developer tutorial showing how to parse Claude Code CLI's streaming output and display its internal reasoning as a collapsible section in a Telegram bot.

Mindmap

mindmap
  root((thinking tutorial))
    What it does
      Parses stream-json
      Separates thinking from answer
      Telegram rendering
    Tech stack
      TypeScript
      Claude Code CLI
      Telegram Bot API
    Use cases
      Bot debugging
      Transparent reasoning UI
      Filtered public summaries
    Audience
      Bot developers
      Claude Code CLI users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Show a collapsible 'thinking' section in a Telegram bot backed by Claude Code CLI.

REASON 2

Parse the NDJSON stream-json output format to separate reasoning from the final answer.

REASON 3

Design a filtered, one-sentence public reasoning summary instead of exposing raw internal thoughts.

What's in the stack?

TypeScriptClaude Code CLITelegram Bot API

How it stacks up

gwendolenmave/claudep-telegram-thinking0whitedev/detranspiler0xluk3/zk-resources
Stars212121
LanguagePython
Setup difficultymoderatehardeasy
Complexity3/54/51/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires an existing Telegram bot backend that calls Claude Code CLI directly, behavior may vary across CLI versions.

No license is stated in the README for this tutorial content.

Wtf does this do

This repository is a written tutorial, not a runnable application, that explains how to show Claude Code CLI's internal reasoning as a collapsible section inside a Telegram bot message. It targets developers who already have a Telegram bot backed by the claude -p command line tool and want to display its thinking process alongside the final answer. The guide walks through switching the CLI call from a plain JSON output mode to a streaming NDJSON mode, which separates the model's structured thinking blocks from its final answer in the output. It shows how to write a small TypeScript parser that reads each line of that stream, collects the thinking text, and pulls out the final result separately, being careful not to mix debug or system events into the visible reply. It then covers two different ways to present that thinking to end users. The first, called Raw Thinking, shows the full or truncated reasoning text and is recommended only for local debugging, not for regular users. The second, called Little Thought, distills the reasoning down to one short, safe, user facing sentence, with rules to filter out anything that looks like internal instructions, system prompts, or private context before it is shown. The guide includes example code for rendering the collapsible section using Telegram's expandable blockquote formatting, along with fallback formatting in case that fails. The tutorial is written primarily in Chinese and is aimed at developers building or customizing their own Telegram bot on top of Claude Code CLI, rather than at end users of such a bot. It emphasizes testing carefully in an isolated environment first, since the exact structure of the thinking output can change between CLI versions and models.

Yoink these prompts

Prompt 1
Walk me through switching a Claude Code CLI call to stream-json output and parsing the NDJSON lines.
Prompt 2
Show me how to render a collapsible thinking section in a Telegram bot using expandable blockquotes.
Prompt 3
Explain the difference between showing raw model reasoning and a filtered 'Little Thought' summary.
Prompt 4
Write a TypeScript function that filters out unsafe or private-looking sentences from raw model reasoning.

Frequently asked questions

wtf is claudep-telegram-thinking?

A developer tutorial showing how to parse Claude Code CLI's streaming output and display its internal reasoning as a collapsible section in a Telegram bot.

What license does claudep-telegram-thinking use?

No license is stated in the README for this tutorial content.

How hard is claudep-telegram-thinking to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is claudep-telegram-thinking for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.