telecoder 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.env.example +363 -0
  2. package/CHANGELOG.md +1186 -0
  3. package/LICENSE +22 -0
  4. package/README.md +126 -2
  5. package/dist/audio/transcribe.js +50 -0
  6. package/dist/bin/mcp-server.js +378 -0
  7. package/dist/bin/tool-result.js +22 -0
  8. package/dist/bot/access/group-access.js +147 -0
  9. package/dist/bot/bot.js +592 -0
  10. package/dist/bot/file-access.js +141 -0
  11. package/dist/bot/handlers/command/access.js +407 -0
  12. package/dist/bot/handlers/command/admin.js +827 -0
  13. package/dist/bot/handlers/command/auto-approve.js +138 -0
  14. package/dist/bot/handlers/command/btw.js +224 -0
  15. package/dist/bot/handlers/command/cost.js +409 -0
  16. package/dist/bot/handlers/command/media.js +197 -0
  17. package/dist/bot/handlers/command/model.js +305 -0
  18. package/dist/bot/handlers/command/prefs-scope.js +197 -0
  19. package/dist/bot/handlers/command/project.js +536 -0
  20. package/dist/bot/handlers/command/resume.js +321 -0
  21. package/dist/bot/handlers/command/session.js +438 -0
  22. package/dist/bot/handlers/command/settings.js +1012 -0
  23. package/dist/bot/handlers/command/shared.js +210 -0
  24. package/dist/bot/handlers/command/streaming-mode.js +16 -0
  25. package/dist/bot/handlers/command/tasks.js +513 -0
  26. package/dist/bot/handlers/command/topic-store.js +113 -0
  27. package/dist/bot/handlers/command/topic.js +80 -0
  28. package/dist/bot/handlers/command.handler.js +772 -0
  29. package/dist/bot/handlers/fork.handler.js +1109 -0
  30. package/dist/bot/handlers/media-fallback.js +121 -0
  31. package/dist/bot/handlers/message/replies.js +133 -0
  32. package/dist/bot/handlers/message/shared.js +117 -0
  33. package/dist/bot/handlers/message/throttle.js +49 -0
  34. package/dist/bot/handlers/message/turn-notify.js +169 -0
  35. package/dist/bot/handlers/message/turn-runner.js +141 -0
  36. package/dist/bot/handlers/message.handler.js +107 -0
  37. package/dist/bot/handlers/newbot.handler.js +221 -0
  38. package/dist/bot/handlers/photo.handler.js +327 -0
  39. package/dist/bot/handlers/prompts.handler.js +343 -0
  40. package/dist/bot/handlers/running-note.js +44 -0
  41. package/dist/bot/handlers/schedule.handler.js +303 -0
  42. package/dist/bot/handlers/session-guard.js +78 -0
  43. package/dist/bot/handlers/suggestion.handler.js +84 -0
  44. package/dist/bot/handlers/tree.handler.js +480 -0
  45. package/dist/bot/handlers/view.js +41 -0
  46. package/dist/bot/handlers/voice.handler.js +209 -0
  47. package/dist/bot/middleware/admin-only.js +49 -0
  48. package/dist/bot/middleware/auth.middleware.js +122 -0
  49. package/dist/bot/middleware/group-mention.middleware.js +139 -0
  50. package/dist/bot/middleware/group-role.middleware.js +75 -0
  51. package/dist/bot/middleware/message-batcher.js +87 -0
  52. package/dist/bot/middleware/queued-messages.js +971 -0
  53. package/dist/bot/middleware/stale-filter.js +31 -0
  54. package/dist/build-info.json +8 -0
  55. package/dist/claude/agent-watchdog.js +162 -0
  56. package/dist/claude/agent.js +1458 -0
  57. package/dist/claude/ask-user.js +295 -0
  58. package/dist/claude/auto-approve.js +225 -0
  59. package/dist/claude/auto-topic-haiku.js +126 -0
  60. package/dist/claude/available-commands.js +153 -0
  61. package/dist/claude/carry-over.js +27 -0
  62. package/dist/claude/ccr-shim.js +46 -0
  63. package/dist/claude/charter-judge.js +214 -0
  64. package/dist/claude/claude-auth.js +121 -0
  65. package/dist/claude/command-parser.js +200 -0
  66. package/dist/claude/cost-overlay-scraper.js +129 -0
  67. package/dist/claude/enabled-plugins.js +56 -0
  68. package/dist/claude/fork-tree.js +393 -0
  69. package/dist/claude/held-query.js +190 -0
  70. package/dist/claude/in-flight-tracker.js +61 -0
  71. package/dist/claude/ipc-server.js +192 -0
  72. package/dist/claude/mcp-bridge.js +453 -0
  73. package/dist/claude/mcp-tools.js +354 -0
  74. package/dist/claude/message-offsets.js +88 -0
  75. package/dist/claude/modal-relay.js +450 -0
  76. package/dist/claude/model-catalog.js +85 -0
  77. package/dist/claude/monitor-relay.js +597 -0
  78. package/dist/claude/pending-forks.js +93 -0
  79. package/dist/claude/pending-suggestions.js +50 -0
  80. package/dist/claude/permission-gate.js +337 -0
  81. package/dist/claude/permission-mode.js +178 -0
  82. package/dist/claude/poll-user.js +51 -0
  83. package/dist/claude/project-commands.js +69 -0
  84. package/dist/claude/prompt-hold.js +124 -0
  85. package/dist/claude/prompt-suggestion-scraper.js +89 -0
  86. package/dist/claude/pty-provider.js +2214 -0
  87. package/dist/claude/pty-spawn-config.js +296 -0
  88. package/dist/claude/pty-stream.js +363 -0
  89. package/dist/claude/request-queue.js +135 -0
  90. package/dist/claude/scheduled-runner.js +91 -0
  91. package/dist/claude/scheduler.js +237 -0
  92. package/dist/claude/scope-guard.js +274 -0
  93. package/dist/claude/sdk-permission-gate.js +77 -0
  94. package/dist/claude/secret-request.js +576 -0
  95. package/dist/claude/session-cost.js +41 -0
  96. package/dist/claude/session-history.js +286 -0
  97. package/dist/claude/session-jsonl.js +920 -0
  98. package/dist/claude/session-manager.js +195 -0
  99. package/dist/claude/session-scan.js +270 -0
  100. package/dist/claude/setup-token.js +285 -0
  101. package/dist/claude/side-call-options.js +45 -0
  102. package/dist/claude/side-question.js +249 -0
  103. package/dist/claude/stage-images.js +62 -0
  104. package/dist/claude/subagent-tools.js +12 -0
  105. package/dist/claude/synthetic-ctx.js +51 -0
  106. package/dist/claude/system-prompt.js +162 -0
  107. package/dist/claude/tasks-overlay-scraper.js +94 -0
  108. package/dist/claude/tip-scraper.js +78 -0
  109. package/dist/claude/tui-modal.js +501 -0
  110. package/dist/claude/tui-state.js +384 -0
  111. package/dist/claude/turn-end.js +91 -0
  112. package/dist/claude/turn-prose.js +64 -0
  113. package/dist/claude/update-banner-relay.js +70 -0
  114. package/dist/cli/commands/doctor.js +305 -0
  115. package/dist/cli/commands/help.js +25 -0
  116. package/dist/cli/commands/init.js +123 -0
  117. package/dist/cli/commands/service.js +678 -0
  118. package/dist/cli/commands/start.js +53 -0
  119. package/dist/cli/commands/version.js +11 -0
  120. package/dist/cli/dispatch.js +79 -0
  121. package/dist/cli/init/env-file.js +99 -0
  122. package/dist/cli/init/flow.js +638 -0
  123. package/dist/cli/init/prompter.js +116 -0
  124. package/dist/cli/init/telegram.js +94 -0
  125. package/dist/cli/service/render.js +212 -0
  126. package/dist/cli.js +18 -0
  127. package/dist/config-report.js +107 -0
  128. package/dist/config.js +500 -0
  129. package/dist/index.js +367 -0
  130. package/dist/launcher.js +933 -0
  131. package/dist/node-version-check.js +27 -0
  132. package/dist/providers/ccr-health.js +119 -0
  133. package/dist/providers/ccr-introspect.js +149 -0
  134. package/dist/providers/ccr-provider.js +60 -0
  135. package/dist/providers/claude-provider.js +63 -0
  136. package/dist/providers/prefs-sync.js +164 -0
  137. package/dist/providers/project-favorites.js +74 -0
  138. package/dist/providers/provider-router.js +127 -0
  139. package/dist/providers/provider-switch.js +91 -0
  140. package/dist/providers/sdk-provider.js +37 -0
  141. package/dist/providers/types.js +8 -0
  142. package/dist/providers/user-preferences.js +214 -0
  143. package/dist/restart-when-idle.js +153 -0
  144. package/dist/startup/auto-continue.js +67 -0
  145. package/dist/startup/auto-resume.js +173 -0
  146. package/dist/startup/notices.js +120 -0
  147. package/dist/startup/shared.js +44 -0
  148. package/dist/startup/verify-token.js +31 -0
  149. package/dist/telegram/access-request.js +153 -0
  150. package/dist/telegram/action-logger.js +684 -0
  151. package/dist/telegram/admin-mention.js +107 -0
  152. package/dist/telegram/background-activity-card.js +502 -0
  153. package/dist/telegram/botname-settings.js +336 -0
  154. package/dist/telegram/button-text.js +26 -0
  155. package/dist/telegram/client-options.js +27 -0
  156. package/dist/telegram/deduplication.js +33 -0
  157. package/dist/telegram/entities.js +295 -0
  158. package/dist/telegram/force-reply-tracker.js +57 -0
  159. package/dist/telegram/lettered-options.js +87 -0
  160. package/dist/telegram/markdown.js +362 -0
  161. package/dist/telegram/message-sender.js +1287 -0
  162. package/dist/telegram/prompt-label.js +142 -0
  163. package/dist/telegram/prompt-suggestion.js +54 -0
  164. package/dist/telegram/send.js +123 -0
  165. package/dist/telegram/streaming-turn.js +105 -0
  166. package/dist/telegram/suggestions-settings.js +30 -0
  167. package/dist/telegram/task-list.js +367 -0
  168. package/dist/telegram/task-tracker.js +209 -0
  169. package/dist/telegram/telegraph-settings.js +31 -0
  170. package/dist/telegram/telegraph.js +453 -0
  171. package/dist/telegram/terminal-renderer.js +671 -0
  172. package/dist/telegram/terminal-settings.js +25 -0
  173. package/dist/telegram/thread-titles.js +190 -0
  174. package/dist/telegram/threads-setup.js +117 -0
  175. package/dist/tts/tts-settings.js +62 -0
  176. package/dist/tts/tts.js +245 -0
  177. package/dist/tts/voice-reply.js +78 -0
  178. package/dist/utils/admins.js +143 -0
  179. package/dist/utils/agent-timer.js +55 -0
  180. package/dist/utils/atomic-write.js +24 -0
  181. package/dist/utils/bot-token.js +74 -0
  182. package/dist/utils/bounded-map.js +55 -0
  183. package/dist/utils/build-info.js +57 -0
  184. package/dist/utils/caffeinate.js +50 -0
  185. package/dist/utils/claude-env.js +54 -0
  186. package/dist/utils/claude-version.js +48 -0
  187. package/dist/utils/config-home.js +62 -0
  188. package/dist/utils/debug-agent.js +117 -0
  189. package/dist/utils/debug-watchdog.js +121 -0
  190. package/dist/utils/download.js +111 -0
  191. package/dist/utils/exit-codes.js +48 -0
  192. package/dist/utils/file-type.js +149 -0
  193. package/dist/utils/format.js +81 -0
  194. package/dist/utils/home-project.js +30 -0
  195. package/dist/utils/host-stall.js +51 -0
  196. package/dist/utils/id-list.js +44 -0
  197. package/dist/utils/idle-restart.js +92 -0
  198. package/dist/utils/install-mode.js +63 -0
  199. package/dist/utils/instance-config.js +148 -0
  200. package/dist/utils/instances.js +95 -0
  201. package/dist/utils/json-store.js +140 -0
  202. package/dist/utils/keyed-settings.js +62 -0
  203. package/dist/utils/legacy-env.js +35 -0
  204. package/dist/utils/npm-version.js +134 -0
  205. package/dist/utils/prefs-relay.js +107 -0
  206. package/dist/utils/proc-children.js +102 -0
  207. package/dist/utils/project-data-dir.js +33 -0
  208. package/dist/utils/reasoning-summary.js +12 -0
  209. package/dist/utils/resolve-bin.js +86 -0
  210. package/dist/utils/resolve-claude-bin.js +63 -0
  211. package/dist/utils/respawn-backoff.js +19 -0
  212. package/dist/utils/sanitize.js +91 -0
  213. package/dist/utils/session-key.js +37 -0
  214. package/dist/utils/stale-launcher.js +109 -0
  215. package/dist/utils/state-dir-migration.js +92 -0
  216. package/dist/utils/systemd.js +126 -0
  217. package/dist/utils/user-roster.js +275 -0
  218. package/dist/utils/verbosity.js +118 -0
  219. package/dist/utils/version-check.js +166 -0
  220. package/dist/utils/workspace-guard.js +44 -0
  221. package/dist/worker-restart.js +141 -0
  222. package/instances.json.example +41 -0
  223. package/package.json +76 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,1186 @@
1
+ # Changelog
2
+
3
+ Notable changes per release. Each entry links the commit that carries the full
4
+ reasoning — the commit bodies are the long form, this is the index.
5
+
6
+ ## Unreleased
7
+
8
+ ## [1.2.0] — 2026-11-14
9
+
10
+ ### Install
11
+
12
+ - **`npm install -g telecoder`** — TeleCoder installs as an npm package with
13
+ a `telecoder` command: `telecoder start` runs one bot, or every bot in
14
+ `instances.json` when there is one; `telecoder doctor` checks Node, the
15
+ `claude` CLI and its login (without spending anything), node-pty and the
16
+ toolchain it needs, and the config, with `--live` asking Telegram about the
17
+ token; `telecoder --version` and `telecoder help` do what they say.
18
+ - **`telecoder service install`** runs the bot in the background: a systemd
19
+ user unit on Linux (enabled, with lingering after asking, so it survives
20
+ logout and reboot) or a LaunchAgent on macOS, pointing at the `node` and
21
+ `telecoder` it was installed with and a `PATH` that finds `claude` and
22
+ `git`. `/restartbot` restarts it from chat; a configuration error stops it
23
+ instead of crash-looping (exit 78, `RestartPreventExitStatus=`; exit 0
24
+ under launchd, which can't single out one code). A changed unit is shown
25
+ as a diff before it is replaced; `status`, `logs`, `restart` and
26
+ `uninstall` go with it, and `--name` allows several installs. Under
27
+ `sudo -u` (no `XDG_RUNTIME_DIR`) it points `systemctl --user` at the
28
+ user's running manager itself, found by its bus socket in
29
+ `/run/user/<uid>`; when no manager runs (no login, no lingering) it leads
30
+ with the fix, `sudo loginctl enable-linger <user>`. Without
31
+ `systemd --user` it prints the unit and a manual fallback; npx installs
32
+ are pointed at `npm install -g` first.
33
+ - **`telecoder init` sets a bot up in a few questions** — it runs doctor's
34
+ checks (offering `claude auth login` when Claude Code isn't logged in),
35
+ takes the bot token masked and checks it with Telegram, and finds your user
36
+ id by having you send the bot `/start`, so there is no @userinfobot step
37
+ (the bot answers that `/start` at once, pointing you back to the terminal).
38
+ Then the workspace, SDK or PTY, and voice transcription and Telegraph if you
39
+ want them. It writes a `.env` with only those settings, readable by you
40
+ only, and the bot messages you to say it's set up. An existing `.env` can
41
+ be kept, edited with its values as defaults, or started over (backed up
42
+ first). `--token-env VAR`, `--owner-id`, `--workspace`, `--transport` and
43
+ `--yes` run it from a script. When the Claude login is a variable in the
44
+ shell's environment (`CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_API_KEY`,
45
+ `ANTHROPIC_AUTH_TOKEN`) rather than stored credentials, it offers to save
46
+ it in the `.env` too (`--yes` does), since a background service never sees
47
+ that environment and would start logged out; `telecoder doctor` warns
48
+ about such a login as well.
49
+ - **Config lives in `~/.telecoder`** for an npm install (`TELECODER_HOME`
50
+ moves it): `.env`, `instances.json` and the Telegraph account file sit next
51
+ to the existing state files. A source checkout with a `.env` or
52
+ `instances.json` next to `package.json` keeps using those, exactly as
53
+ before.
54
+ - **An npm install updates and restarts without a checkout** — `/update`
55
+ also offers `npm install -g telecoder@latest`, `/version` compares the
56
+ installed version with the latest release, and `/restartbot` exits for the
57
+ service manager to start it again (`telecoder service install` sets one
58
+ up; pm2 works too). `/rebuildbot` is for source checkouts
59
+ only and says so elsewhere.
60
+ - **A shorter README** — the README is now the pitch, how TeleCoder compares,
61
+ a three-command quick start and links; the reference moved to `docs/`
62
+ (install, features, commands, multiple bots, providers, sharing,
63
+ configuration, security, architecture). Corrected on the way: the
64
+ `CLAUDE_SDK_LOG_LEVEL` and Groq `TTS_VOICE` defaults, `HOME_PROJECT`,
65
+ `/spinoff` and `/autoapprove` in the command list, and which commands are
66
+ admin-only.
67
+
68
+ ### Security
69
+
70
+ - **`/file` and `/telegraph <path>` can't hand out credentials** — both
71
+ accepted any path under `WORKSPACE_DIR`, which defaults to your home
72
+ directory, so any guest on a shared bot could fetch
73
+ `~/.claude/.credentials.json` with `/file`, or publish `~/.ssh/id_rsa` as a
74
+ public page with `/telegraph`. Guests are now confined to the chat's project
75
+ directory, admins keep the whole workspace, and the scope guard's list of
76
+ credential and bot-state paths (`.env` files, `~/.ssh`, `~/.aws`,
77
+ `~/.claude`, `~/.telecoder`, cloud CLI configs and so on) is refused for
78
+ everyone, admins included. Symlinks are followed before anything is
79
+ decided. `/telegraph <path>` is admin-only; `/telegraph` on its own still
80
+ shows the per-chat toggle to everyone.
81
+
82
+ - **Telegraph is off unless you turn it on** — `TELEGRAPH_ENABLED` defaulted
83
+ to `true`, so every reply over 2500 characters, every `/handoff` and every
84
+ verbose action log became a public telegra.ph page without anyone choosing
85
+ that. It now defaults to `false`, in the code and in `.env.example`; set it
86
+ to `true` to get Instant View links back. Off, long replies arrive in full
87
+ as chunked messages, as they already did underneath the link, and `/handoff`
88
+ sends just the file. Turning it off globally now also stops chats that had
89
+ switched it on with `/telegraph`, and `/handoff` follows the chat's setting.
90
+
91
+ - **ID lists are checked at startup, and strangers are told their ID** —
92
+ `ALLOWED_USER_IDS=@alice` used to parse to `NaN` and start a bot nobody
93
+ could use ("Allowed users: NaN"), and the `.env.example` placeholder
94
+ `123456789` was taken as a real admin. A non-numeric entry in
95
+ `ALLOWED_USER_IDS`, `ADMIN_USER_IDS`, `APPROVER_USER_IDS` or
96
+ `ALLOWED_GROUP_IDS`, or the placeholder in a user list, now stops startup
97
+ with a message saying what belongs there. Someone not on the list who
98
+ messages the bot privately is told their numeric ID to pass on, and it is
99
+ logged; a group that isn't allow-listed gets no reply at all, where it used
100
+ to get "not authorized" for every message when privacy mode was off.
101
+
102
+ - **The bot token stays out of `ps` and out of error messages** — photos,
103
+ documents and voice notes were fetched with `curl`, whose command line
104
+ carried `https://api.telegram.org/file/bot<token>/…` for any local user to
105
+ read, and a failed download sent that command line, token and all, back to
106
+ the chat. Downloads now use Node's own `fetch`, with the same timeouts and
107
+ retries. `sanitizeError` also redacts Telegram bot tokens, API keys, bearer
108
+ headers and credentials in URLs from anything it is given.
109
+
110
+ ### First run
111
+
112
+ - **A missing or wrong setting is explained, not dumped** — with no `.env`, a
113
+ first start printed Zod's raw JSON (`invalid_type`, "expected string,
114
+ received undefined") instead of saying a token was needed. Startup now
115
+ prints one plain report: which `.env` was read, or that none was found;
116
+ each missing or invalid setting with where to get it (`@BotFather` for the
117
+ token, `@userinfobot` for your ID); and `telecoder init` or copying
118
+ `.env.example` when there is no file. The ID-list and admin checks report
119
+ the same way. It exits 1, with no stack trace.
120
+
121
+ - **A bad bot token is caught before anything starts** — a placeholder or
122
+ revoked token ended in `Fatal error: GrammyError: Call to 'getMe' failed!
123
+ (401)` and a stack trace, after the IPC server had started. A token that
124
+ isn't shaped like one now fails the config check, and a well-formed one is
125
+ checked with `getMe` before any other service starts: a rejected token says
126
+ to get a fresh one from @BotFather, and a network failure says
127
+ api.telegram.org couldn't be reached and points at `TELEGRAM_PROXY_URL`.
128
+ The token is never printed. Under the multi-bot launcher, a bot that stops
129
+ on its configuration says so under its own name and isn't respawned into
130
+ the same error; fixing its `instances.json` entry starts it again.
131
+
132
+ - **"Claude Code isn't logged in" says how to log in** — on a machine where
133
+ nobody had signed in, every message came back as `❌ Error: Claude error:
134
+ Claude Code returned an error result: Not logged in · Please run /login`,
135
+ and in PTY mode the CLI's first-run theme and login screens were relayed to
136
+ the chat as dialogs that led nowhere. Both transports now reply that Claude
137
+ Code on the bot's machine isn't logged in, and to run `claude` and /login
138
+ there (or `claude setup-token` for a long-lived token); an invalid API key
139
+ or a 401 from the API gets the same reply. Startup also warns when there is
140
+ no `~/.claude/.credentials.json` and no `ANTHROPIC_API_KEY` or
141
+ `CLAUDE_CODE_OAUTH_TOKEN`, without refusing to start (macOS keeps the login
142
+ in the keychain, where the check can't see it).
143
+
144
+ - **`doctor` sees a login kept in the `.env`** — a `CLAUDE_CODE_OAUTH_TOKEN`
145
+ or `ANTHROPIC_API_KEY` set in the `.env` works for the bot, but `doctor`
146
+ ran `claude auth status` without it and reported "not logged in". It now
147
+ hands claude the login variables from the `.env` (and nothing else from
148
+ it), its hint mentions `claude setup-token`, and its install hint is the
149
+ native installer: `npm install -g @anthropic-ai/claude-code` fails with
150
+ EACCES for a normal user on a distro's Node.
151
+
152
+ - **A fresh install keeps the name you gave the bot** — the startup name sync
153
+ renamed every bot to "TeleCoder", BOT_NAME's default, so the name picked in
154
+ BotFather was gone on the first start. It only renames now when BOT_NAME
155
+ is set, or when dynamic names are on (they're built from it).
156
+
157
+ - **Node.js 22 or newer is required** — Node 20 reached end of life in April
158
+ 2026. `engines.node` is now `>=22`, CI runs on Node 22 and 24, and the bot
159
+ and the launcher check the version before loading anything else, saying
160
+ which version they found and what to install instead of failing somewhere
161
+ further in.
162
+
163
+ ### Multiple bots
164
+
165
+ - **`instances.json` is read while the launcher runs** — adding a bot used to
166
+ mean restarting the launcher, and with it every bot it ran. It now watches
167
+ the file: a bot you add starts, one you take out stops, and one whose token,
168
+ name or settings change restarts on its own and picks its sessions back up.
169
+ The others carry on. Bots are matched by bot id, so a replaced token is the
170
+ same bot restarting rather than one leaving and another arriving, and when a
171
+ bot is taken out of the middle of a `tokens` list, the next one takes over
172
+ its name once it has stopped. A file that doesn't parse, lists no bots, or
173
+ gives two bots one name is ignored until it's fixed.
174
+
175
+ - **`/newbot` creates a bot for a project** — a bot per project meant a
176
+ BotFather chat each time: pick a name, copy the token, paste it into
177
+ `instances.json`. Now `/newbot sjs` offers a button that opens Telegram's own
178
+ create-a-bot screen with the name and username filled in, and once you
179
+ confirm, the bot that sent it fetches the new token, restricts the new bot to
180
+ you, and adds it to `instances.json`, which the launcher picks up. It needs
181
+ Bot Management Mode on in BotFather's Mini App for the bot you send it to,
182
+ and Threaded Mode, which Telegram offers no API for, is still switched on
183
+ there by hand. Only a bot an admin created is adopted: anyone can create one
184
+ managed by ours through a link. Asking Claude for a bot works too: its
185
+ `telecoder_create_bot` tool sends the same button. The new bot sends the
186
+ steps for turning threads on with the first message you send it, then
187
+ checks once a minute and says so when they're on, taking the setting in
188
+ without a restart.
189
+ - **A bot can have a home project** — `HOME_PROJECT`, which `/newbot` sets. A
190
+ conversation with nothing to restore starts there instead of asking for
191
+ `/project`, and the project is left out of the thread names and the bot's
192
+ display name while you're in it, since the bot's own name already says it.
193
+ That leaves the thread names their full width for what they're about. A
194
+ thread that moves to another project gets that one in front again.
195
+
196
+ ### Threads
197
+
198
+ - **Each thread keeps its own model, effort, backend, transport and
199
+ permission mode** — in a bot with threads, a `/model` in one thread used to
200
+ switch every thread in the chat, because these were stored per chat. Now
201
+ they're stored per thread. A thread that never picked one follows the chat's
202
+ setting, so a new thread starts out the way the chat was before threads, and
203
+ resetting one in a thread goes back to the default, not the chat's choice.
204
+ Verbosity and the status line toggles stay per chat. Chats without threads
205
+ are unchanged, and "apply to all bots" still applies to the other bots'
206
+ chats as a whole.
207
+
208
+ - **Threads are named after what they're about** — a message sent from a
209
+ bot's "All" view starts a thread Telegram calls "New chat", and every one of
210
+ them looked the same in the list. The bot now renames a private chat's
211
+ thread to its session topic, and follows the topic as the conversation
212
+ moves on, at most once a minute so the thread isn't filled with rename
213
+ notices. A name you gave the thread yourself, when creating it or by
214
+ renaming it later, is never replaced. Group forum topics keep their names.
215
+ The name is the topic's first half, the broad area, which holds still
216
+ while the second half follows each message. The project's folder name goes
217
+ in front, `telecoder · Thread naming`, since one bot's threads can each be
218
+ in a different project; it's left out when the topic already names it, and
219
+ after a project switch it's the whole name until the new topic comes in.
220
+ Haiku is told the project, so the topic's area names a part of it rather
221
+ than repeating it, and a topic Claude or `/topic` sets while Haiku is still
222
+ summarizing the message is no longer overwritten by Haiku's late answer.
223
+
224
+ - **A fork opens a thread of its own** — on a bot with threads, the 🍴 Fork
225
+ button and `/fork` go straight to a new thread, with no picker and no
226
+ confirmation: someone who turned threads on wants them, and a thread you
227
+ didn't want is deleted as easily as a confirmation is cancelled. It opens a
228
+ thread named after the topic with 🍴 in front, loads the conversation up to
229
+ that point into it with the settings the thread you forked from chose, and
230
+ replies with a link to it. The thread you forked from carries on unchanged,
231
+ so both stay open side by side instead of one going to `/resume`. Bots
232
+ without threads keep the picker.
233
+
234
+ ### Renamed
235
+
236
+ - **The last Claudegram names** — the agent's tools are now `telecoder_*`
237
+ (`telecoder_ask_user`, `telecoder_send_file` and so on) on a server called
238
+ `telecoder-tools`. The state directory is `~/.telecoder`: the launcher moves
239
+ `~/.claudegram` across on its first start, before any bot runs, and leaves a
240
+ link at the old path for anything still holding it. Files sent in the chat
241
+ and `/handoff` notes go to `.telecoder/` in the project, which gets its own
242
+ `.gitignore`, so they stay out of git even in a project that only ignores
243
+ `.claudegram/`. Existing `.claudegram/` folders in projects are left alone.
244
+
245
+ ### Removed
246
+
247
+ - **`/medium`, `/reddit`, `/vreddit` and `/extract`, and the agent tools behind
248
+ them** — these content fetchers came from Claudegram: Medium articles through
249
+ the Freedium mirror, which exists to get around Medium's paywall, Reddit threads
250
+ through a bot account's OAuth app, Reddit videos, and YouTube, Instagram and
251
+ TikTok downloads through `yt-dlp`. None of them has to do with driving Claude
252
+ Code, which can read a link itself. The `claudegram_fetch_reddit`,
253
+ `claudegram_fetch_medium` and `claudegram_extract_media` tools went with them,
254
+ so a bare YouTube, TikTok, Instagram or Reddit video link is now an ordinary
255
+ message to Claude instead of opening a download menu. Their settings
256
+ (`REDDIT_*`, `REDDITFETCH_*`, `VREDDIT_ENABLED`, `MEDIUM_*`, `FREEDIUM_*`,
257
+ `EXTRACT_*`, `YTDLP_*` and `ALLOW_PRIVATE_NETWORK_URLS`) are ignored if they're
258
+ still in your `.env`, and `yt-dlp` and `ffprobe` are no longer needed.
259
+
260
+ ### Agent
261
+
262
+ - **The status line turns amber, then red, as the context grows** — the
263
+ `📊 34%` stat looked the same at 15% as at 80%, and with the 1M window even
264
+ 80% is far past the point where turns get slower, costlier and less sharp.
265
+ The chart now becomes `🟡` from 150k tokens or 60% of the window, and `🔴`
266
+ from 300k or 80%, whichever comes first, a cue to `/clear`, fork or
267
+ `/compact`. The usage footer and `/context` bars follow the same rule.
268
+
269
+ - **Fable gets a 💎 while it's on** — the model showed as one more `🤖` stat
270
+ in the status line, easy to read past, and not at all with the status line
271
+ off, so a Fable picked for one hard task went on spending the plan's limits
272
+ on the easy ones after it. The live status now ends its first line with
273
+ `· 💎 fable` every turn, the status line shows `💎 FABLE-5-1` in place of
274
+ the robot, and picking it in `/model` says what the badge means. Under CCR
275
+ the alias says nothing about the backend, so it's left unbadged.
276
+
277
+ - **The activity card says at its bottom whether anything is still running** —
278
+ the running tasks were listed at the top of the card and the events grew
279
+ below them, so on a long card only the events were on screen, and a card
280
+ whose tasks had all finished looked the same as a busy one. It now ends on
281
+ `⏳ 2 tasks running` or `✅ All done`. A card left behind when a turn starts
282
+ says its tasks run on below it, since their end lands on the next card.
283
+
284
+ - **The reply shows while it is being written** — a reply used to reach the
285
+ chat only once the turn had ended. It now appears in the status bubble as
286
+ Claude writes it and is edited every second or two (every few seconds in a
287
+ group, and less often after Telegram asks the bot to slow down), with the
288
+ status line, or `✍️ Writing…` without the terminal UI, underneath as the sign
289
+ that it isn't final yet. A reply that outgrows one message carries on in a
290
+ silent message below. At the end the final text takes its place; a cancelled
291
+ turn keeps what was written, with the banner under it. The SDK streams it as
292
+ it is typed. PTY mode takes finished blocks from the session log and the one
293
+ being written from the screen, a line at a time, and leaves out tool rows,
294
+ the spinner and Claude Code's own notices. `CLAUDE_SDK_INCLUDE_PARTIAL` is
295
+ gone: streaming needs it on.
296
+
297
+ - **Formatting that can't break a message** — every message used to go out as
298
+ MarkdownV2, which needs escaping, so an underscore in a path or a backtick in
299
+ a command could get a reply refused and resent unformatted, and a long reply
300
+ cut in the middle of bold text or a link broke both halves. Messages now go
301
+ out as plain text with the formatting alongside as entities, from replies to
302
+ menus, edits, `/status`, `/project`, `/recap` and the background-task and
303
+ monitor messages. Nothing needs escaping, and a long reply can be split
304
+ anywhere: bold, links and code blocks carry on in the next part. A link
305
+ Telegram won't take, such as `http://localhost:3000`, is written out as text
306
+ instead of failing the whole message. Code blocks now show their language.
307
+
308
+ - **The task list is back** — Claude Code stopped using `TodoWrite` and keeps
309
+ its list with `TaskCreate`, `TaskUpdate`, `TaskList` and `TaskGet` instead, so
310
+ the live checklist never appeared on a current CLI. The card now reads the
311
+ list from where Claude Code keeps it (`~/.claude/tasks/<session id>/`), in
312
+ both transports, and draws it the way the terminal does: a `3 tasks (1 done,
313
+ 1 in progress, 1 open)` header, `✔` struck through for done, `◼` in bold for
314
+ the one in progress, `◻` for the rest, and `› blocked by #2` while a blocker
315
+ is open. It is posted on a turn's first change and edited in place after
316
+ that. A restored session (`/resume`, `/continue`, a restart, going back to a
317
+ branch in `/tree`) shows its whole list again. `TodoWrite` support is gone.
318
+
319
+ - **Secrets that stay out of the chat** — a task that needed a key or a token
320
+ used to end in instructions to open a terminal on the machine over SSH and
321
+ type it there, since anything sent in the chat, or run there with `!`, lands
322
+ in the session log, in the model's context and in the Telegram history. The
323
+ new `claudegram_request_secret` tool has Claude name the secret and the
324
+ command that consumes it, and shows you both. You send the secret as an
325
+ ordinary message: the bot takes it out of the stream before anything can
326
+ queue or forward it, deletes it, and runs the command with it in `$SECRET`
327
+ and on stdin. Claude gets the exit code and the output with the secret
328
+ blanked out. For a long-lived Claude token the bot runs `claude setup-token`
329
+ itself: it sends you the sign-in link, you approve on your phone and send
330
+ back the code the page shows, and the token goes from the CLI straight into
331
+ the command without passing through Telegram. It works in private chats with
332
+ an admin, one request at a time, and `/cancel` or the Cancel button
333
+ withdraws it.
334
+
335
+ ### Sessions
336
+
337
+ - **Every reply ends with the status line** — it only came after a message you
338
+ typed. A reply to a voice note, a photo or a file, to `/plan`, `/explore` or
339
+ `/loop` with the task on the same line, and the one Claude writes on its own
340
+ when a background agent or task reports back, all left you on the tail of the
341
+ answer with nothing to say where things stood. That last one is often the
342
+ answer you were waiting for, and it tends to arrive while you're in another
343
+ chat, with no prompt of yours above it. Each now closes the way a typed turn
344
+ does: your last prompts, the project, the model and the context, which under
345
+ a background reply is the figure that reply left and not the one from the
346
+ turn before. They get the compaction and new-session notices a typed turn
347
+ gets as well, and a `/loop` shows the model and the context, which the line
348
+ under one never had. A scheduled fire closes with a short line, the stats
349
+ and the context bar alone: a schedule can fire every minute, and each fire
350
+ counts as a prompt, so the list would soon show nothing else. A background
351
+ turn that says nothing still posts nothing.
352
+
353
+ - **The action log follows you past a question** — when Claude asked you
354
+ something mid-turn and you answered, the turn carried on in the action log
355
+ posted before the question, so its next actions landed above the question
356
+ and your answer, where you'd scrolled past them, and the bottom of the chat
357
+ looked like nothing was happening. Answering (or the question timing out,
358
+ or a secret request settling) now collapses that log and the next action
359
+ opens a new one under your answer, with the status line and the prompt.
360
+
361
+ - **The status line names the project** — a bot moves between projects and its
362
+ display name only says where it is now, so scrolling back left you guessing
363
+ which project an older answer belonged to. `📁 telecoder` now leads the stats
364
+ under each answer. After a switch it already names the new project, where your
365
+ next message goes.
366
+
367
+ - **A turn ends in one message** — with the status line on under `/verbosity
368
+ verbose`, a turn closed with two messages that both gave the context and the
369
+ cost, and each one notified you. The context bar now sits at the bottom of the
370
+ status line, whose own 📊 and 💰 make way for it. With the status line off, the
371
+ bar still comes on its own.
372
+
373
+ - **`/recap` ends like a turn** — after a long reply, `/recap` left you on the
374
+ tail of an answer with the prompt it answers scrolled away, and it said
375
+ nothing about the context, which is what has changed when you've just gone
376
+ back to a fork or an earlier point. It now closes with the same status message
377
+ as a normal turn: your last prompts, then the figure for the point the chat is
378
+ at. In PTY mode that figure comes from the session log when no turn has cached
379
+ one, so `/status` now shows its context line straight after
380
+ a jump or a restart too, and `/context` answers from the log at those moments
381
+ instead of starting a separate `claude` to ask.
382
+
383
+ - **A restart carries on instead of asking** — a chat quiet for between an hour
384
+ and a week came back from a restart with "Continue where you left off, or
385
+ start fresh?", and a `/rebuildbot all` left that choice waiting in every bot
386
+ you hadn't used in the last hour. Every chat used in the past week now
387
+ carries straight on in its conversation, as it would have with no restart at
388
+ all; `/clear` is there when you'd rather start fresh. A project you'd picked
389
+ but not talked in yet comes back with your next message too, where an hour
390
+ on it used to answer "No project set". A "Start fresh" still standing on an
391
+ old prompt now runs `/clear`.
392
+
393
+ - **A fork stands out where it starts** — loading a fork left one plain line,
394
+ "✅ Fork loaded from …" or "✅ Branched into a new conversation", between two
395
+ conversations that otherwise read as one thread when you scroll back. A
396
+ branch taken in the same chat was the worst of it: the messages just above
397
+ carry on past the point the branch starts from. The confirmation is now a
398
+ banner — 🍴 Forked from … or 🌱 New branch, between heavy rules — that says
399
+ outright a new conversation starts there and says the conversation above is
400
+ in `/resume`. It shows the exchange the fork picks up after: your prompt on
401
+ one line, and the reply whole in a collapsed quote that opens on a tap — so
402
+ a fork to another bot doesn't leave that reply behind in the other chat, and
403
+ the last reply above your next message is one the fork actually has. No
404
+ summary: that would be a model call, and a retelling of the one thing you
405
+ need verbatim. A reply too long to fit is cut at a word, pointing to
406
+ `/recap` for the rest. The "✅ Forked to …" message in the sending chat now
407
+ says that conversation carries on unchanged.
408
+
409
+ - **A fork can be forked again from either chat** — both messages confirming a
410
+ fork now carry a 🍴 Fork button of their own: "✅ Fork loaded" or
411
+ "✅ Branched" where the branch continues (after Accept, `/accept` or 🌱 New
412
+ branch here), and "✅ Forked to …" in the chat it was sent from. Forking the
413
+ same point a second time — to a third bot, or into another branch — used to
414
+ mean scrolling back through the source bot's history to the message the fork
415
+ was first taken from. Each button forks that same point, whatever either
416
+ conversation has done since, so it hands over exactly what that message's
417
+ own button would.
418
+
419
+ - **A fork offer previews the reply it was taken from** — the "Fork received"
420
+ message quoted the source chat's latest reply as the last assistant message,
421
+ so a fork taken from any earlier point arrived introduced by text it doesn't
422
+ contain. The preview is now read out of the cut transcript itself.
423
+
424
+ - **`/resume` says which session each button is** — a session is named
425
+ `project · topic`, which is routinely wider than the single line Telegram
426
+ renders a button on, and the client ellipsises the rest away with no way to
427
+ expand it. Two conversations in the same project therefore arrived as the
428
+ same half-line and you picked between them blind. The picker now writes every
429
+ session out in the message body keyed A/B/C — name and age — and the same
430
+ letter keys its button, the rule `claudegram_ask_user` has followed since
431
+ options moved into the body. Short names still ride on their own buttons
432
+ (`A · telecoder`); the moment one is too wide the whole keyboard drops to
433
+ bare letters, packed four to a row. Both features build that keyboard through
434
+ one function now, so a question and a session list clip at the same place
435
+ instead of each keeping its own threshold.
436
+
437
+ - **The other two pickers that hid text on a button** — the same rule now
438
+ covers the "back to previous" button under `/clear` and `/project`, and the
439
+ `/fork` target list. The back button named its session inside its own label
440
+ and trimmed it at 45 characters, well past what a button renders, so the
441
+ moment a session had a topic you were offered "back to" something you could
442
+ not read. It keeps the name on the button while it fits — `↩️ Back to
443
+ telecoder (2h ago)`, the common case, adding nothing to the chat — and past
444
+ that width puts the name in the message and a fixed label on the button. The
445
+ fork picker listed sibling bots by name only on their buttons, so two bots
446
+ sharing a prefix arrived as the same clipped line; targets are now written
447
+ out A/B/C in the picker message. "New branch here" moved the bot's own name
448
+ off its label, which was single-handedly costing that keyboard its labels.
449
+ Six commands offered the back button with four lines of identical
450
+ keyboard-spreading each; that is one call now.
451
+
452
+ - **`/prompts` reaches further back** — it lists the last 15 prompts by
453
+ default instead of 5, and `/prompts N` goes up to 25 instead of 20. Most
454
+ prompts are a short line, so five used a fraction of the room one message
455
+ has. Across 40 recent sessions, 15 always fit in one message, at
456
+ about two phone screens. 25 fit in all but 5 of them, and in those the
457
+ oldest are dropped to fit, as before, and the header says how many.
458
+
459
+ - **The status line shows your last five prompts** — with "Show last prompt"
460
+ on in `/statusline`, the line after each answer showed only the prompt that
461
+ turn answered, and a turn often starts from an "ok" or a "yeah" that says
462
+ nothing on its own. It now lists the last five, oldest first. They are read
463
+ from the session log, so they reach back past a restart. A `/compact` and
464
+ the notes Claude Code writes in your place, like "[Request interrupted by
465
+ user]", don't take one of the five; a paste shows its text and an upload its
466
+ caption, the way `/tree` labels a branch.
467
+
468
+ - **The live action log says what the turn is for** — in verbose mode the
469
+ action log grows below your prompt until it pushes it off screen, so
470
+ remembering what a long turn was working on meant scrolling back up to
471
+ find it. The log now ends with that prompt, under the status line, as the
472
+ same italic ▸ line the status line uses. A paste shows its text and an
473
+ upload its caption; a skill run with a slash command shows as typed. It
474
+ goes when the turn ends, with the answer posted below the log by then.
475
+
476
+ - **A prompt shows whole, and a long one its start and its end** — the
477
+ status line and the bottom of the live action log cut every prompt at 100
478
+ characters. Across 100 recent sessions that caught a third of the prompts
479
+ written as one paragraph, and a cut that keeps only the start drops what a
480
+ long prompt usually ends on: the question. A prompt now shows whole up to
481
+ 300 characters, enough for 93% of those; past that it shows its start and
482
+ its end with … between, cut between words. Five prompts under an answer
483
+ take a median of 15 rows on a phone instead of 11. `/prompts` and
484
+ `/recap` cut the same way, at the 300 and 500 characters they already
485
+ allowed.
486
+
487
+ - **`/tree` shows each point's prompt, not its first few words** — a line of
488
+ the tree had room for about 23 characters of the prompt a point starts
489
+ from, so on the forked conversations on disk 38 of 44 points showed cut,
490
+ most of them to a few words. The prompt now wraps onto lines of its own
491
+ inside the drawing, with the branches carried on down beside it, and shows
492
+ whole up to 300 characters; past that, its start and its end, the way
493
+ `/prompts` shows one. Those trees take a median of 17 lines now, at most
494
+ 47, where they took a line per point. A tree too big for one message gives
495
+ every prompt the same shorter cut, so the longest give way first. Opening a
496
+ point shows the prompt it ends on the same way, up to 300 characters
497
+ instead of 160, and the list of forked conversations its prompts up to 300
498
+ instead of 80.
499
+
500
+ - **A fork's banner shows your prompt the way `/tree` does** — the banner
501
+ where a fork or a branch starts showed the prompt it picks up after cut at
502
+ 120 characters, keeping only its start, and as the session log has it: a
503
+ paste in its `<pasted_content>` tags, an upload as the note it reached
504
+ Claude in, a reply under the quote it answers. It now shows whole up to
505
+ 300 characters, past that by its start and its end, a paste by its text,
506
+ an upload by its caption and a reply by the words written under the quote,
507
+ the same as the point's view in `/tree`. With the longest reply a banner
508
+ holds, it still fits in one message.
509
+
510
+ - **`/prompts` goes back to any prompt** — the list was something to read and
511
+ nothing more: going back to an earlier point meant scrolling up past every
512
+ reply since to that one's 🍴 Fork button. Each prompt is now keyed A/B/C
513
+ the way `/tree` keys its points, with a button per letter. A letter opens
514
+ the prompt — its reply in a collapsed quote — with 🌱 New branch from
515
+ here, which carries on just after that reply in a new conversation and
516
+ leaves this one in `/resume`: the same banner and the same branch the
517
+ reply's own 🍴 makes. Anything sent after that reply stays out of the
518
+ branch, a `/compact` included. A prompt where a branch already splits off
519
+ is marked 🌿, and 🌳 shows the tree, where that branch can be carried on.
520
+ Prompts read the way `/tree` and the status line show them, a reply under
521
+ a quote by the words written under it. `/prompts` also answers while a
522
+ turn runs, where it used to wait for the turn to finish, and after a
523
+ restart lists where the chat left off, as `/tree` does. Built from the
524
+ transcripts on disk, 180 lists and 494 prompt views fit in a message, the
525
+ longest at 3,325 characters.
526
+
527
+ - **`/prompts` gives the prompt after a `/compact` its own line** — a
528
+ `/compact` leaves three records in the session log: the command, Claude
529
+ Code's record of it, and what it printed. `/prompts` read them as part of
530
+ the next prompt, so that prompt's line opened with some 200 characters of
531
+ `<command-name>…</local-command-stdout>`, terminal escape codes included,
532
+ and only about 85 of its 300 were yours. Each prompt now gets a line of
533
+ its own. Commands and the notes Claude Code writes in your place, like
534
+ "[Request interrupted by user]", are left out and don't count toward N. A
535
+ prompt interrupted before any reply was folded into the next one; it now
536
+ gets its own line, marked ⏳. A paste shows without the `<pasted_content>`
537
+ tags around it, in `/recap` too.
538
+
539
+ - **`/recap` and `/handoff` show only what you sent** — the exchange after a
540
+ `/compact` opened with the command's three records, terminal escape codes
541
+ and all, and an interrupted prompt carried "[Request interrupted by user]"
542
+ into the next one. Both are left out now, there and wherever else
543
+ exchanges are read off the log: a fork's banner, a `/tree` point, and the
544
+ conversation carried over when you switch providers. A command that got a
545
+ reply, like a skill run with a slash command, keeps its exchange.
546
+ `/handoff` also writes a paste without the `<pasted_content>` tags around
547
+ it. Across 312 recent sessions, 26 of 1,430 exchanges had such records in
548
+ the prompt; the replies are unchanged.
549
+
550
+ ### Sharing a bot
551
+
552
+ - **The permission gate runs on the SDK transport and CCR** — it was a hook on
553
+ the PTY CLI only, while the default transport is SDK and CCR always takes it.
554
+ There the curated tool list pre-approves Bash, Write and Edit, so a guest let
555
+ in on a default install ran shell commands with no prompt at all. The SDK
556
+ transport now registers the same check as an in-process PreToolUse hook, in
557
+ every `/mode` and for subagents' tool calls, and a gate that throws denies
558
+ the call. One test table runs through both transports, and `/permissions` no
559
+ longer needs its "this chat's transport has no gate" warning.
560
+
561
+ - **Auto-approve windows** — `/autoapprove 30m` lets the permission gate approve
562
+ instead of asking, for a stated length of time on one chat. A job made of
563
+ guarded commands cost a tap each, and a guardrail people tap without reading
564
+ has stopped being one. Admins and approvers can open a window; it posts every
565
+ command it waves through rather than going quiet, announces itself when it
566
+ lapses, and lives only in memory so a restart closes it. `mkfs`, `dd of=/dev/`,
567
+ `DROP DATABASE`, `terraform destroy` and credential reads keep their prompt —
568
+ the line is whether a wrong call can be walked back, not whether it is
569
+ dangerous. `/autoapprove off` and `/autoapprove status` do what they say.
570
+
571
+ - **An approver tier** — `APPROVER_USER_IDS` names guests who may answer someone
572
+ else's permission prompt without owning the bot. Being able to tap "Allow once"
573
+ and being able to run `/restartbot` or `/method` were one flag, which forced a
574
+ choice between one admin being the bottleneck for every prompt and handing
575
+ guests the switch that turns the gate off. An approver stays a guest in every
576
+ other respect — the charter judge still reads their messages, the gate still
577
+ stops their tool calls — and cannot approve their own request, so the prompt
578
+ still means something. `/users` lists them as their own tier, `/deny` names both
579
+ lists so removing one doesn't strand an id the orphan check refuses to start on,
580
+ and the toast tells an approver why their own request is the one they can't
581
+ answer.
582
+
583
+ - **Admitting people from chat** — `/allow`, `/deny` and `/users`. A stranger who
584
+ posts in the shared group gets an approve card naming them, and someone added
585
+ to the group is asked about the moment they join; one tap makes them a guest,
586
+ with no `.env` edit and no restart. Telegram has no API that resolves a
587
+ `@username`, so the bot matches only handles it has seen go by and `/allow` as
588
+ a reply is the exact form. Ids admitted this way persist in
589
+ `~/.claudegram/user-roster.json`; ids from `ALLOWED_USER_IDS` stay the
590
+ operator's, and `/deny` says so rather than appearing to remove one.
591
+ `hasGuestUsers()` now reads the effective list, so admitting the first guest
592
+ switches on the permission gate, the scope guard and the charter judge.
593
+
594
+ ### Sharing a bot (continued)
595
+
596
+ - **Contributors and spectators in a group** — a group can now hold people who
597
+ read along without being able to prompt the agent, which is the difference
598
+ between a seat in the room and a shell on the host. `GROUP_MEMBERS_DEFAULT`
599
+ decides what membership alone is worth, `/allow` and `/deny` move individuals,
600
+ and `/members` reads back one group the way `/users` reads back the bot.
601
+ `GROUP_REQUIRE_MENTION` keeps human conversation in the group from becoming
602
+ prompts.
603
+
604
+ This landed as a merge of two access models that had been built in parallel,
605
+ and the reconciliation is the substance of it. The roster stayed the door —
606
+ who may use the bot at all — and the group roles became a second gate behind
607
+ it, so admitting someone in a DM makes them a contributor everywhere while a
608
+ grant in a group stays in that group. `/allow` therefore means the nearer
609
+ layer: the room when typed in the room, the bot when typed in a DM.
610
+
611
+ Three things were dropped rather than merged. The branch's `OWNER_USER_IDS`
612
+ computed exactly what `isAdmin()` already did, so it went and `owner` became
613
+ `admin` throughout. Its owner-only command list duplicated the `adminOnly`
614
+ wrapper the handlers already carry — but its judgement was better than main's
615
+ coverage, so `/project`, `/newproject`, `/permissions` and `/teleport` are now
616
+ wrapped too. And its username→id cache was a second answer to a question the
617
+ roster already answers, free to drift from the first.
618
+
619
+ `GROUP_MEMBERS_DEFAULT` ships as `spectator`, not the `contributor` the branch
620
+ defaulted to. That default was right when Telegram membership was the whole
621
+ gate; layered on top of the roster it would have widened who can prompt the
622
+ agent, so the merged default matches what the roster already enforced.
623
+
624
+ ### Reliability
625
+
626
+ - **A long paste reaches Claude as one message again** — Telegram splits a
627
+ paste over 4096 characters into several messages. Since messages started
628
+ queueing behind a busy turn, each part waited for the one before it to be
629
+ answered, so Claude saw the paste one part per turn. The batcher that
630
+ joins them was off unless `MESSAGE_BATCH_TIMEOUT_MS` was set. It's now on by
631
+ default (1500ms), and only a message of 2000 characters or more opens a
632
+ batch, so ordinary messages aren't held up waiting for parts that won't come.
633
+ The parts after the first join it whatever they look like, including a short
634
+ last part or one that starts with a slash because the split landed just
635
+ before a path.
636
+
637
+ - **No more catch-up repeating a reply** — the reply goes out without its
638
+ reasoning summary, but the session log keeps it, and the check that recovers
639
+ prose the relay dropped counted the summary as missing. With summaries on,
640
+ every reply got a "📨 Catch-up — recovered from session log", and one with a
641
+ tool call in it was posted a second time in full. The check now leaves the
642
+ summary out of the log's text as well, and still recovers prose that really
643
+ went missing.
644
+ - **The live action log gives its time and its count at both ends** — the log
645
+ is usually taller than a screen, the count of actions sat only at its top
646
+ and the time it was last drawn only at its bottom, and both change all the
647
+ time, so reading either meant scrolling to the other end. From the top the
648
+ log also looked frozen through a long step, since nothing up there moved
649
+ until the next action came in. A running log now opens and closes with the
650
+ same line, `🕐 Updated 2:11 PM · last 9 of 20 actions`, with the count left
651
+ off while every action is showing.
652
+ - **The live action log says when it last moved** — Telegram shows when a
653
+ message was sent but not when it was last edited, so a live log that had
654
+ stopped moving looked just like one that was still going, and a long quiet
655
+ step left you wondering whether the bot was still alive. The log now ends
656
+ with the time it was last drawn, under the prompt. With the status line on
657
+ it's redrawn every ten seconds, so a time that keeps up with your clock means
658
+ the bot is alive however long the step takes. That time and the one on each
659
+ action now read in your own timezone; they were the server's.
660
+ - **Commands that only read answer during a turn** — every command behind the
661
+ queue waited for the running turn, so `/commands` sat behind a long turn,
662
+ acked as queued, to print a fixed list once Claude was done. `/commands`,
663
+ `/sessions`, `/botstatus`, `/recap`, `/projectcommands` and `/context` now
664
+ answer at once. Commands that change the session or start a turn still wait
665
+ their turn, as a message does.
666
+ - **`/later` sets an idea aside before it's sent** — **Ask me after** is only
667
+ on a message already waiting behind a turn. An idea you had while nothing was
668
+ running had nowhere to go, and one sent as a turn was ending could go out
669
+ before you'd tapped the button. `/later <text>` sets it aside straight away,
670
+ with the same question, **Send** and **Drop** afterwards. Sent while Claude is
671
+ idle, it waits until the next turn has run, and `/later` alone lists what's
672
+ set aside in the chat. A question left unanswered while the conversation moves
673
+ on is now asked again below each new reply, without a second notification,
674
+ instead of staying above them all.
675
+ - **Decide on a follow-up after you've read the answer** — a message sent during
676
+ a turn went out as soon as that turn ended unless you took it back, so you had
677
+ to decide before you'd seen the answer it depended on. The `⏳ Queued` notice
678
+ now also has **Ask me after**. The message won't go out by itself, and nothing
679
+ behind it waits for it. Once nothing is running or waiting, the bot asks below
680
+ the reply whether you still want to send it, with **Send** and **Drop**, and
681
+ that question notifies you, unlike the notice. It stays until you answer it,
682
+ through `/cancel` and restarts. Send puts the message through as if it had just
683
+ arrived, so a voice note is only transcribed then, and it waits its turn if
684
+ another one has started. An edit made while a message waits, set aside or not,
685
+ is now what goes out; Claude used to get the text as first sent.
686
+ - **The subagent panel can't go out as a reply** — when the session log had no
687
+ reply text for a turn, the bot read one off the screen, and with a subagent
688
+ running it could send the panel under the input box instead. A log that holds
689
+ your message but no reply now gives the usual "Done". The screen is only read
690
+ when the log has no record of the message, and it skips the panel, tool calls
691
+ and older replies. Each time the log has no reply text, the bot logs enough to
692
+ show why.
693
+ - **Messages get through while a subagent is running** — the panel under the
694
+ input box shows each running subagent with a live timer and token count, and
695
+ the bot took those updates to mean the screen hadn't settled. Every message
696
+ then failed after a minute with "Claude Code's input box never appeared", for
697
+ as long as the subagent ran, though the box was open the whole time. The bot
698
+ now ignores those rows when it checks whether the screen has settled.
699
+ - **`/allow` and `/deny` apply to the bot you send them to** — all the bots kept
700
+ their guests in one file. A guest let into one bot reached the others at their
701
+ next restart, along with the guardrails a first guest switches on, whatever
702
+ those bots' `.env` said about who could use them. A `/deny` could also come
703
+ undone: the other bots kept allowing the guest until they restarted, and the
704
+ next save from any of them wrote the guest back for everyone. Each bot now has
705
+ its own roster. On its first start it copies the shared one, so nobody loses
706
+ access, which means a guest admitted before this stays on every bot until you
707
+ `/deny` them on each.
708
+
709
+ - **Favorites stay in step across your bots** — each bot read the shared list at
710
+ startup and saved from that copy, so a favorite added on one bot didn't show on
711
+ the others until they restarted, and could vanish, or a removed one come back,
712
+ when another bot saved. Each bot now reads the list whenever it needs it.
713
+
714
+ - **A setting stays with the bot you set it on** — `/tts`, `/terminalui`,
715
+ `/telegraph`, `/suggestions` and `/botname` kept their settings in files all
716
+ the bots shared, and each bot rewrote a file from the copy it loaded at
717
+ startup. A change on one bot could be undone by a save on another, and one
718
+ that survived reached the other bots at their next restart. Each bot now has
719
+ its own files, so changing a setting everywhere means setting it on each bot.
720
+ On its first start a bot copies what the shared files hold, so nothing resets.
721
+
722
+ - **One bot can't undo what another remembers about its name** — the bots shared
723
+ a file of the display name each last sent, and each rewrote it from the copy it
724
+ loaded at startup, putting back the others' old entries. After a restart, a bot
725
+ could take a real rename for no change and keep showing the old project, with
726
+ no notice, until the next switch. The file of Telegram's rate-limit blocks had
727
+ the same flaw, so a bot could forget a block and call again. Each bot now keeps
728
+ its own files. The old shared ones are no longer read, which costs at most one
729
+ extra call per bot the first time it renames.
730
+
731
+ - **`/version` says whether you're on the latest** — the version a restart names
732
+ tells you what came back, but not whether anything newer has landed since. A
733
+ fix you'd committed and never built looked just like one that was live.
734
+ `/version` names the running build, compares it with the code in the checkout
735
+ and the branch it tracks, and says what catches it up: `/restartbot` for a build
736
+ that's done but not loaded, `/rebuildbot` for code changed since, `git pull` for
737
+ commits that aren't here yet. It compares the contents of what a build compiles
738
+ rather than commits, so a docs commit, committing what was already built, or a
739
+ history rewrite doesn't count as falling behind. A check that couldn't run says
740
+ so instead of passing, and it answers during a running turn.
741
+
742
+ - **A message you sent too soon can be taken back** — a message sent while the
743
+ bot was busy got no answer at all, so a bot that was only still working looked
744
+ idle, and you found out when the reply to the last message landed. Deleting it
745
+ didn't help, because Telegram doesn't tell a bot about a delete: Claude got it
746
+ anyway. A message that has to wait now says so within half a second, as
747
+ `⏳ Queued behind the running turn`, with a **Take back** button that drops it
748
+ before it reaches Claude and leaves the turn running. Text, voice notes, photos
749
+ and files are all covered, and a bot command gets the same notice while it
750
+ waits. That includes the turn you can't see, one Claude started itself on a
751
+ background task's result: your message waits for it without a "thinking" bubble
752
+ going up, and that turn's reply still arrives whole. `/cancel` and `/stop` now
753
+ clear the queue. They used to stop the running turn and thereby start the
754
+ message waiting behind it, and now they also reach a turn Claude started
755
+ itself. `CANCEL_ON_NEW_MESSAGE`, which never took effect behind a normal turn,
756
+ now does what `.env.example` says.
757
+
758
+ - **A cancelled message stays cancelled** — a message you stopped with `/cancel`
759
+ before Claude had written anything came back. Claude Code put it back in its
760
+ input box, and it went out stuck to the front of your next message as one
761
+ prompt, while a `/cost` or `/tasks` would have submitted it by itself. The box
762
+ is now emptied before anything else is typed into it, and a `/cancel` that lands
763
+ while a message is still being typed in stops it from being submitted at all.
764
+
765
+ - **A restart says which version came back** — `/rebuildbot` reported a build
766
+ and a restart but never what the bot came back on, so there was no telling
767
+ from the chat whether a fix had gone live. The message a restart ends with now
768
+ names it, as "Version: 63dcf45 feat: end /recap the way a turn ends (built 2m
769
+ ago)", with "plus uncommitted changes" when `src/` had some at build time, and
770
+ `/botstatus` says the same whenever you ask. It comes from a stamp
771
+ `npm run build` leaves in `dist/` rather than from what's checked out, so a
772
+ commit you haven't built yet isn't claimed as running. With
773
+ `AUTO_RESTORE_SESSION` off a restart posts nothing afterwards, so `/botstatus`
774
+ is the place to look there.
775
+
776
+ - **The bypass warning stays accepted** — since Claude Code 2.1.314, every new
777
+ session (after `/clear`, `/model`, a project switch or a restart) opened with
778
+ "WARNING: Claude Code running in Bypass Permissions mode", even though you had
779
+ accepted it, and "Yes, I accept" didn't last past that session. The bot's
780
+ launch leaves your user settings out, which is where that answer is kept, and
781
+ that version stopped reading it there. The bot now passes the answer along
782
+ when your settings already have it. An account that hasn't accepted still
783
+ gets asked, once.
784
+
785
+ - **`/rebuildbot` can wait for each bot to finish** — rebuilding while bots
786
+ were busy on other projects meant waiting for a moment when none of them
787
+ was, or cutting a turn off halfway. The `/rebuildbot` menu now has "All
788
+ instances, each once it is idle" (`/rebuildbot idle` for short): it builds
789
+ once, then restarts each bot the moment it has nothing left to finish — no
790
+ turn running or queued, no message still being handled, no background task
791
+ still going, and no reply still on its way — instead of waiting for the
792
+ busiest. One message in the chat you asked from keeps the tally, saying what
793
+ each bot still waiting is busy with, with buttons to restart the rest now or
794
+ call it off. The launcher has to be running this build before it can take
795
+ the request; until then the message says so and nothing restarts.
796
+
797
+ - **Claude's answer after a background task arrives whole** — when a
798
+ background task finished between your messages, what Claude wrote about it
799
+ went onto the background activity card, under a "📡 Monitor" line, cut at
800
+ 1,200 characters, and the rest was only in `/recap`. That answer is often
801
+ what the background work was for, and in two weeks of session logs 50 of
802
+ the 119 Claude wrote ran past the cut. It now comes as a reply of its own
803
+ once Claude finishes, sent the way any reply is: whole, split over messages
804
+ only where Telegram needs it, and with a phone notification. The card keeps
805
+ the tasks — what's running, what finished. A monitor firing still lands on
806
+ the card at once, and what Claude says about it follows as a reply. If a
807
+ question or a file comes in the middle, what Claude wrote before it goes
808
+ out first, above it.
809
+
810
+ - **A restart stops its Claude Code sessions before the new bot takes over**
811
+ — a restarted bot left every Claude Code session it had open to carry on
812
+ until that session noticed. On 10-27 one wrote another reply into its
813
+ conversation's log a second after the new bot had already resumed that
814
+ conversation in a session of its own, so two processes had one log open.
815
+ Shutting down now hangs each session up and waits for it to exit, which
816
+ takes under a second when it's idle, and kills one still running after
817
+ four seconds. A reply the restart cuts short isn't reported as an error on
818
+ the way out, and a message that arrives mid-shutdown is told to come again.
819
+
820
+ - **A question asked after a background task reports back reaches you** —
821
+ when a background task finished between your messages, Claude Code started
822
+ a turn of its own to deal with it, and TeleCoder had no turn on record to
823
+ run its tools in. A question it asked with buttons failed within a second
824
+ with "MCP error -32602: Invalid tools/call result" and a schema dump, and
825
+ never reached the chat; sending a file, a poll or a schedule failed the
826
+ same way. The two weeks of logs on hand hold seven such calls across two
827
+ bots. Those tools now reach the chat the session belongs to. A question or
828
+ a file posted there seals the background card above it first, so what
829
+ Claude writes after your answer lands below it. A tool with no chat to
830
+ reach now says so in words.
831
+
832
+ - **A question keeps its turn while it waits** — Claude Code 2.1.311 moves
833
+ an MCP call that is still running after two minutes to the background, and
834
+ the turn carries on without it. A question you took longer than that to
835
+ answer ended its turn, and your answer came back later as a background
836
+ task instead of in the reply. TeleCoder's Claude Code sessions now let a
837
+ call run until it would time out, which is past the question's own ten
838
+ minutes.
839
+
840
+ - **The context reading after a `/compact` shows what it left** — under
841
+ "🗜️ Context compacted — 536.4k → 13.7k tokens" the usage footer still read
842
+ 54%, the context from before, and only the next reply brought it down. A
843
+ compaction writes no usage of its own, so the newest figure in the session
844
+ log was the one for the conversation it had just replaced. The reading now
845
+ drops to what the compaction left, 1% there, in the footer, the status line
846
+ and `/context` alike. That figure counts the conversation only, so the next
847
+ reply, which adds the system prompt and tools back, reads a few percent
848
+ higher.
849
+
850
+ - **`/status` reads the context the footer does** — its 📐 Context line added
851
+ up the reply and the input sent fresh, and left out what came from the
852
+ prompt cache, which once a conversation is under way is nearly all of it:
853
+ 0% (322/1.0M) where the footer read 54%. It now counts cache reads too, the
854
+ same sum as the footer.
855
+
856
+ - **Claude Code stays on the screen layout TeleCoder can read** — Claude Code
857
+ 2.1.310 can start in its new fullscreen layout without being asked: a trial,
858
+ a fresh install or a remote feature switch turns it on. Everything TeleCoder
859
+ reads off the screen — the input box, the spinner, the dialogs — is built for
860
+ the classic layout, and in a test run that came up fullscreen, `/mcp`'s tool
861
+ list offered "Enter — select" on a list whose cursor it couldn't see.
862
+ TeleCoder's Claude Code now always starts in the classic layout.
863
+
864
+ - **Closing a menu no longer sends your last answer again** — `/mcp` and the
865
+ other Claude Code menus write no reply of their own. When one closed,
866
+ TeleCoder went looking for the latest reply in the session log, found the one
867
+ before the command, and posted it again as the menu's answer. The chat now
868
+ gets what the command printed — "Reconnected to sjs-dev.", "MCP dialog
869
+ dismissed" — or ✅ Done when it printed nothing.
870
+
871
+ - **Claude Code's menus can be walked from the chat** — picking a server in
872
+ `/mcp` opens that server's own screen, but TeleCoder expected every tap to
873
+ close the dialog it answered. The tap went in, the menu stayed open on the
874
+ server's screen, and the turn ended calling the dialog "still open": the menu
875
+ could be opened from the chat but never used. Each screen a tap leads to now
876
+ comes to the chat in turn — a server's actions, its tool list, the list Esc
877
+ steps back to — until Claude Code is back at its input box. A list too long
878
+ for the screen, like a server's 111 tools, offers every row it shows instead
879
+ of its first seven, with buttons to scroll it, and the `↓ 92 more` under it
880
+ and the group headings between `/mcp`'s servers are no longer offered as
881
+ rows.
882
+
883
+ - **A message that starts with a long link gets through** — Claude Code wraps
884
+ its input box at word boundaries. In a message like "I'm about to submit
885
+ https://…long link…", the link moved down a row, which split the opening
886
+ words TeleCoder looks for to confirm a message landed. Every attempt was
887
+ reported as "didn't take your message", however often you resent it. Worse,
888
+ clearing the box between attempts removed only the bottom row. Copies of the
889
+ opening words piled up three per attempt, and they were sent along with your
890
+ next message. TeleCoder now finds the opening words across a row break, and
891
+ clears every row it filled.
892
+
893
+ - **A command moved to the background is counted while it runs** — Claude
894
+ Code doesn't kill a Bash command that runs into its 10-minute limit: it
895
+ moves it to the background and carries on. TeleCoder only counted commands
896
+ started in the background, so one moved there was missing from the
897
+ "🔄 N tasks running in background" footer, `/tasks` and the background card
898
+ for as long as it ran. It now counts from the moment it moves, and its
899
+ running time starts from when the command did.
900
+
901
+ - **A crashed Claude Code no longer leaves its background tasks counted as
902
+ running** — when Claude Code exits on its own, killed for running out of
903
+ memory say, the tasks it ran in the background end with it. TeleCoder only
904
+ cleared them when it shut Claude Code down itself, so after a crash they
905
+ stayed in the count indefinitely. They're now cleared however Claude Code
906
+ exits.
907
+
908
+ - **A background task that finished mid-turn no longer counts as running** —
909
+ if a background task finished while Claude was in the middle of a turn, the
910
+ "🔄 N tasks running in background" footer, `/tasks` and the background card
911
+ went on counting it as running until the session ended. TeleCoder 4 showed
912
+ two tasks running with nothing running at all. Claude Code folds a
913
+ completion like that into the turn in progress instead of logging it as a
914
+ message of its own, and TeleCoder only looked for the message. It now reads
915
+ the folded-in completion too.
916
+
917
+ - **A running turn no longer keeps "typing…" up** — every turn renewed
918
+ Telegram's "typing…" indicator every four seconds until it ended, and
919
+ Telegram Desktop draws that animation on the CPU for as long as it shows, so
920
+ a long turn kept the client busy the whole time. A turn with the live status
921
+ line (`/terminalui`, on by default) no longer sends it: the status line
922
+ already shows the turn is alive. With the terminal UI off, "typing…" stays,
923
+ since nothing else would. In verbose mode the status line now sits at the
924
+ bottom of the action log, because the log is posted below the status bubble
925
+ and is usually tall enough to push it off screen. That left "typing…" as the
926
+ only live sign you could see. The bubble points down at the log, and the
927
+ log's header starts with ⏳ while the turn runs, so the chat list shows it's
928
+ still going. The waiting-for-your-answer line now points down at the
929
+ question too; it said "above", but the question is posted below it.
930
+
931
+ - **The live action log catches up** — the log was edited at most every ten
932
+ seconds, and an action that arrived sooner was left off until another one
933
+ came in. After a burst of quick reads followed by a long build, the log
934
+ stayed a couple of actions behind for the whole build. It now draws the
935
+ waiting actions once the ten seconds are up, and after a Telegram rate limit
936
+ it draws again instead of dropping the change. Commands and output go out
937
+ as entities rather than MarkdownV2, so they show verbatim and nothing in
938
+ them can break an edit.
939
+
940
+ - **A running command reads as code in the status bubble** — while a Bash
941
+ command ran, the status bubble showed it as plain text under the timer, so
942
+ a long one-liner, such as a loop polling `gh pr checks`, sat there as a raw
943
+ run of pipes, quotes and `$(...)` for as long as it ran. The command is now
944
+ in a `bash` code block, the way the permission prompt shows one, and the
945
+ block's copy button hands back just the command. It goes out as Telegram
946
+ entities rather than MarkdownV2, so nothing in the command can break the
947
+ update.
948
+
949
+ - **A message of several lines is acted on, not held for a confirmation
950
+ tap** — Claude Code now wraps a long paste in `<pasted_content>` tags, and
951
+ its system prompt has the model act on instructions inside one only where
952
+ your own words outside the tags ask it to. TeleCoder delivers every message
953
+ as a paste, so anything over two lines or 800 characters arrived as one
954
+ tagged block with nothing outside it: the model took your request for text
955
+ copied from somewhere else and asked for a button tap before doing what it
956
+ said. The system prompt a PTY session starts with now says what the tags
957
+ mean here — how the message was delivered, not where it came from. Text you
958
+ quote or forward, and pages TeleCoder fetches for you, are still read as
959
+ someone else's. SDK mode never pasted, so it was never affected.
960
+
961
+ - **Claude Code's dialogs arrive laid out for a phone** — a dialog relayed to
962
+ the chat, most often a permission prompt (Claude Code raises some even in
963
+ auto mode, such as a heredoc whose braces and quotes trip its "expansion
964
+ obfuscation" check), came through as its raw terminal render. It was
965
+ hard-wrapped at 120 columns and then rewrapped by the phone, the command sat
966
+ in a `│` gutter, an edit's diff sat between two screen-wide rows of dashes,
967
+ and the rows repeated the buttons behind a `❯` cursor. Blank lines were
968
+ dropped, so title, command, reason and question ran together. Now the title
969
+ and the question are bold, the command or diff is in a code block, prose
970
+ Claude Code wrapped is rejoined, and each choice is written out once in full
971
+ under its button's number, since the button clips it. The last line says
972
+ what a tap does, and a dialog that opens mid-turn no longer promises to
973
+ "deliver your message". Answering the dialog, or letting it time out, keeps
974
+ the formatting. The answered edit also used to strip formatting from the
975
+ bot's own permission prompts; it keeps it now too.
976
+
977
+ - **A relayed permission prompt no longer offers "Tab — amend"** — the
978
+ button pressed Tab, which doesn't answer the prompt: it turns the
979
+ highlighted row into a text field ("Yes, and tell Claude what to do next")
980
+ for a note a button can't type. The dialog stayed open, so the turn failed
981
+ with "Claude Code hasn't returned to its input box". Tab is left out of the
982
+ buttons now, along with the other keys that change a dialog without
983
+ answering it.
984
+
985
+ - **Claude Code asking to fetch a page reaches the chat** — WebFetch's
986
+ permission prompt was never relayed. The dialog reader found a dialog by
987
+ its footer, the "Esc to cancel · …" line under the choices, and this prompt
988
+ has none: it ends on its last choice, with the one key it names written
989
+ into that choice ("No, and tell Claude what to do differently (esc)"). A
990
+ turn that wanted to fetch a page in a mode that asks first sat on the
991
+ dialog, with nobody asked, until the turn's hard ceiling. A numbered list
992
+ with the cursor on it, under the dialog's top rule and reaching the bottom
993
+ of the screen, now counts as the end of a dialog. It gets its choices as
994
+ buttons, and no key buttons, since it names none.
995
+
996
+ - **A dialog left open mid-turn no longer says your message wasn't
997
+ delivered** — when a dialog that opened partway through a turn went
998
+ unanswered, or couldn't be answered from the chat, the turn ended with
999
+ "your message wasn't delivered. Send it again". It had been delivered: the
1000
+ dialog came from the work it started, and resending it only queued a
1001
+ duplicate. Mid-turn it now says the bot stopped waiting on the turn, that
1002
+ Claude Code is still paused on the dialog, and that your next message
1003
+ brings its buttons back. Before a message goes in, the wording is unchanged,
1004
+ since there the message really wasn't typed in.
1005
+
1006
+ - **The last message of a long reply lost its formatting** — when a reply was
1007
+ split across messages at a point inside a code block, the splitter closed
1008
+ the block at the end of one part and reopened it at the top of the next, but
1009
+ then counted that reopening fence as a closer as well. The next part ended
1010
+ with a stray fence Telegram couldn't match ("Can't find end of Pre entity"),
1011
+ so it was rejected and re-sent as plain text, with its bold and code showing
1012
+ as raw `*` and backtick markers. Past two parts, every fence after the first
1013
+ cut was counted the wrong way round. Each part now starts outside a code
1014
+ block, with the reopened fence as part of its own text. The first line of a
1015
+ reopened block also keeps its indentation, which used to be trimmed off.
1016
+
1017
+ - **A quote under a list item no longer costs the message its formatting** —
1018
+ a `>` quote on the line right under a list item came out indented, as that
1019
+ item's continuation. Telegram only reads `>` as a quote at the very start of
1020
+ a line; anywhere else it is a reserved character, so the message was
1021
+ rejected and re-sent as plain text. The same went for a collapsible
1022
+ `<expandable>` quote written on an item's line. Quotes now always start
1023
+ their line, which is the only way Telegram draws them anyway. A `$` in a
1024
+ collapsible quote also stays as written; `$$` used to collapse to `$`.
1025
+
1026
+ - **Long replies stopped being replaced by a 200-character stub** — with
1027
+ Instant View on, any reply past 2500 characters — or one merely containing a
1028
+ markdown table — was swapped in chat for `text.substring(0, 200) + '...'` and
1029
+ a telegra.ph link. The answer never arrived, the stub was cut at a raw
1030
+ character offset mid-word with its markdown stripped out, and the only way
1031
+ back to what the model wrote was `/recap`. Telegraph is additive now: the
1032
+ reply goes out in full, chunked as usual, and the page URL hangs under the
1033
+ last chunk — or takes a chunk of its own when appending would overflow it. A
1034
+ telegra.ph outage costs the link, never the text. The table trigger is gone
1035
+ outright; `convertToTelegramMarkdown` has rewritten pipe tables into bullet
1036
+ lists for a long time, so there was nothing left to compensate for.
1037
+
1038
+ - **Turns started from a voice note, a photo, a text file, a Reddit summary,
1039
+ `/plan` or `/explore` had no catch-up** — `relayCatchUpIfMissed` is the
1040
+ safety net that compares what was relayed against the canonical assistant
1041
+ text in the session log and posts whatever is missing. Text messages,
1042
+ force-reply prompts and scheduled runs called it; these turns never did, in
1043
+ streaming or wait mode, so they also never updated the relayed tracker —
1044
+ leaving `/sync` comparing a fresh log against a stale baseline and offering
1045
+ to re-post an earlier turn's reply. The `/loop` command is deliberately still
1046
+ out: it concatenates several turns, and the single-turn comparison would
1047
+ either no-op or duplicate the last iteration.
1048
+
1049
+ ### Reliability
1050
+
1051
+ - **`/restartbot` no longer kills a systemd-managed bot for good** — the restart
1052
+ ran `botctl recover` as a detached child, but `detached: true` escapes the
1053
+ process group and not the cgroup. Under systemd the helper was reaped along
1054
+ with the bot the moment it exited, before it reached the start half of its
1055
+ job, and the clean exit told `Restart=on-failure` there was nothing to fix.
1056
+ The bot now recognises that systemd is holding it up and exits `75` for
1057
+ systemd to bring it back, instead of trying to start its own successor. It
1058
+ checks the unit's `Restart=` first and refuses — while still running — rather
1059
+ than announcing a restart it cannot come back from. The shipped unit moves to
1060
+ `Restart=always`.
1061
+
1062
+ - **A lost hook could outrank the Stop signal and hang a finished turn** — the
1063
+ end-of-turn check refuses to finish while the hooks say a tool is still open,
1064
+ which is right: `claudegram_ask_user` long-polls for a button tap and the pty
1065
+ is silent for as long as it waits. But that count was checked *before* the
1066
+ Stop hook, on the reasoning that Stop only fires once every tool is done.
1067
+
1068
+ It does — which is exactly why a count that survives Stop cannot be a live
1069
+ tool. The hooks are `curl` calls into a loopback server, fired and forgotten
1070
+ (`>/dev/null 2>&1; exit 0`); a POST that fails takes its decrement with it,
1071
+ nothing retries, and nothing else ever brings the count down. One dropped
1072
+ request then outranked the only authoritative end-of-turn signal there is,
1073
+ and the turn ran to the two-hour ceiling with claude sitting idle at its
1074
+ prompt and its finished answer already written to the session log. A chat
1075
+ waited an hour and seven minutes past "Done" for a reply that never came.
1076
+
1077
+ Stop now wins, the stale count is logged and cleared rather than silently
1078
+ believed, and the count keeps guarding the path where it earns its keep.
1079
+
1080
+ - **Answering a dialog could end the turn and strand the session** — the
1081
+ end-of-turn check infers "claude is finished" from a quiet pty, the input box
1082
+ being back, no spinner, and the session log having moved. Every one of those
1083
+ is true in the moment after a relayed dialog is answered, and none of them
1084
+ mean what they usually do: the box is back because the dialog went away, and
1085
+ the spinner is missing because claude has not resumed yet.
1086
+
1087
+ A turn resolved in that gap does not just finish early, it takes the session
1088
+ down with it. The bot hands back an answer and forgets the turn, while claude
1089
+ carries on working with nobody listening — hooks arriving with no active turn
1090
+ to attach to and being dropped, output going nowhere, and every later message
1091
+ held against a screen that now does say "generating" until the ceiling
1092
+ rejects it. One live session spent 37 minutes unreachable that way, and
1093
+ `/stop` only reaches it while a message happens to be in flight.
1094
+
1095
+ The turn now waits for claude to show itself after a dialog is answered — a
1096
+ spinner, or a tool opening through the hooks — bounded at 15s so a dialog
1097
+ whose answer genuinely did end the turn still resolves. The Stop hook stays
1098
+ authoritative and is never waited past.
1099
+
1100
+ - **The PTY could not find the `claude` binary under systemd** — `CLAUDE_BIN`
1101
+ fell back to the bare name `claude`, which node-pty execs directly against
1102
+ the *service's* PATH. A systemd user unit gets the bare default, without
1103
+ `~/.local/bin`, which is where the native installer puts the CLI. execvp
1104
+ wrote "No such file or directory" into the pty and exited, so the bot saw a
1105
+ session that produced nothing and reported that the input box never appeared.
1106
+
1107
+ `resolveBin()` has searched `~/.local/bin` first on Linux since it was
1108
+ written, for this exact reason — the pty provider just never called it.
1109
+ @code_share1_bot had not completed a single turn since the day it moved to a
1110
+ systemd unit; it went unnoticed because the failure names a symptom two
1111
+ layers above the cause.
1112
+
1113
+ - **A dialog with a status bar under it is still a dialog** — `parseModal` took
1114
+ the last non-empty line and required it to parse as key hints, so anything
1115
+ claude drew beneath the footer (its `⏵⏵ bypass permissions on` status bar, a
1116
+ transcript warning, a welcome notice) made the parser answer null. The
1117
+ readiness loop reads null as "a screen we cannot drive" and falls through to
1118
+ the timeout, so the dialog that should have arrived in the chat as two
1119
+ buttons instead spent its whole ceiling being silent and came back as
1120
+ "Claude Code's input box never appeared".
1121
+
1122
+ This is how @code_share1_bot went quiet after a CLI update began asking about
1123
+ a folder it had been working in for weeks: the trust prompt was on screen,
1124
+ recognisable, and never relayed. The footer is now located as the lowest
1125
+ hint-bearing line rather than assumed to be last, bounded to three lines of
1126
+ chrome so a stale footer scrolled up in the transcript cannot pose as this
1127
+ screen's.
1128
+
1129
+ - **A stuck TUI now says what it is stuck on** — the warning named the symptom
1130
+ ("input box absent") and nothing else, so diagnosing the above meant spawning
1131
+ ptys by hand outside the bot to see a screen the bot had already read. It now
1132
+ logs the last dozen screen lines alongside the verdict.
1133
+
1134
+ ## [1.1.0] — 2026-08-31
1135
+
1136
+ The release that makes a bot shareable. Everything before this assumed one
1137
+ person on one machine; this batch adds the access model, the guardrails and the
1138
+ visibility that a bot with other people in it needs.
1139
+
1140
+ ### Sharing a bot
1141
+
1142
+ - **Admins and guests** (`9470e1d`) — `ADMIN_USER_IDS` names the subset of
1143
+ allowed users who may approve permission prompts and run lifecycle and
1144
+ transport commands. Unset, every allowed user is an admin, so single-user
1145
+ installs are unchanged. Includes a scope guard, a charter read before anything
1146
+ runs, and prompt-hold so a guest's request waits for an admin.
1147
+ - **Its own Unix account** (`e72ee84`) — `scripts/setup-shared-bot-user.sh`
1148
+ provisions the account that decides what is actually *reachable*: no sudo, no
1149
+ docker, its own checkout, and a `--verify` that becomes the account and tries
1150
+ to read the operator's secrets rather than reasoning about file modes.
1151
+ - **Resource ceilings** (`d8efbd9`) — MemoryHigh throttles before MemoryMax
1152
+ kills, CPUQuota leaves cores for everything else, IOWeight yields disk. Disk
1153
+ is reported rather than enforced, since only filesystem quotas would be honest.
1154
+ - **Per-bot model and effort** (`365d134`) — `/model` and `/effort` apply to the
1155
+ bot you ran them in, with an opt-in fan-out to the rest.
1156
+
1157
+ ### Added
1158
+
1159
+ - **`/prompts`** (`680c436`) — lists just the prompts you sent, one line each,
1160
+ without the replies. The fastest way to remember what a conversation was about.
1161
+ - **`/cost`** (`562c205`) — usage limits on a subscription, dollar totals on API
1162
+ billing, plus a running per-conversation total that Claude Code cannot keep
1163
+ because its own counter dies with every turn.
1164
+ - **`CLAUDE_PLUGINS`** (`7cdbf09`) — brings marketplace plugins into the agent.
1165
+ Enabling one in the terminal writes to a settings file neither transport
1166
+ reads, so its skills and commands were silently missing in Telegram.
1167
+ - **Claude Code's own slash commands** (`86d9622`) — `/commands` reports which
1168
+ of them work here.
1169
+ - **`EXTRA_MCP_CONFIG`** (`11dae19`) — load MCP servers you name yourself,
1170
+ without dragging in every server the machine has ever registered.
1171
+
1172
+ ### Fixed
1173
+
1174
+ - **Refuse to start on an unreachable admin** (`2f19ba1`) — an id in
1175
+ `ADMIN_USER_IDS` but not `ALLOWED_USER_IDS` can never act. This replaces a
1176
+ warning that went to a log nobody reads and surfaced days later as an approval
1177
+ sent to the wrong person.
1178
+ - **Truncated replies after a background task** (`6628922`) — a task reporting
1179
+ in mid-turn wrote a user-role record that the transcript reader treated as a
1180
+ turn boundary, dropping everything above it.
1181
+ - **MarkdownV2 code spans** (`11ab6fc`) — added the escaper they need, which has
1182
+ different rules from ordinary text.
1183
+
1184
+ ## 1.0.0
1185
+
1186
+ Everything before this changelog existed. See the git history.