Skip to content

Add tunable verbose output showing Claude's background activity#29

Merged
RichardAtCT merged 6 commits intomainfrom
claude/verbose-bot-output-c7iNz
Feb 18, 2026
Merged

Add tunable verbose output showing Claude's background activity#29
RichardAtCT merged 6 commits intomainfrom
claude/verbose-bot-output-c7iNz

Conversation

@RichardAtCT
Copy link
Copy Markdown
Owner

Introduces a VERBOSE_LEVEL setting (0-2) and /verbose command that lets
users control how much of Claude Code's background work is shown in
real-time via Telegram progress messages:

  • Level 0 (quiet): only "Working..." and final response
  • Level 1 (normal, default): shows tool names as they execute
  • Level 2 (detailed): shows tool names + input summaries (filenames,
    commands, search patterns)

The progress message is updated every 2 seconds during execution with a
running list of tool calls. The stream callback is wired into all three
agentic handlers (text, document, photo). SDK streaming now also extracts
ToolUseBlock data for the callback.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v

Introduces a VERBOSE_LEVEL setting (0-2) and /verbose command that lets
users control how much of Claude Code's background work is shown in
real-time via Telegram progress messages:

- Level 0 (quiet): only "Working..." and final response
- Level 1 (normal, default): shows tool names as they execute
- Level 2 (detailed): shows tool names + input summaries (filenames,
  commands, search patterns)

The progress message is updated every 2 seconds during execution with a
running list of tool calls. The stream callback is wired into all three
agentic handlers (text, document, photo). SDK streaming now also extracts
ToolUseBlock data for the callback.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
Telegram's typing indicator expires after ~5 seconds. Now all three
agentic handlers (text, document, photo) re-send the typing action
every 2 seconds via the stream callback, so the user always sees
the bot is working. This works at all verbose levels including 0.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
The stream callback now captures assistant text content alongside tool
calls. At verbose level 1, the first line of each text block is shown
(truncated to 80 chars). At level 2, up to 120 chars are shown. This
lets users see Claude's reasoning ("I'll check the test file first",
"Let me try a different approach", etc.) interleaved with tool activity
in the progress message.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
The verbose output now shows Claude's intermediate reasoning text
alongside tool calls. Updated CLAUDE.md, settings field description,
and /verbose help text to accurately describe all three levels.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
Add /verbose to the agentic mode commands list, update the demo to
show real-time progress output, add a verbosity levels table, add
VERBOSE_LEVEL to the configuration section, and note the features
in the working features list.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
@FridayOpenClawBot
Copy link
Copy Markdown

PR Review
Reviewed head: cfd4889ee19b93628016a9328b05728495eeeacf

Summary

  • Adds configurable verbosity (VERBOSE_LEVEL, /verbose 0|1|2) and wires streaming callbacks into text/document/photo flows.
  • Surfaces tool activity (and optionally tool-input summaries) in a periodically updated “Working…” message.
  • Extends SDK stream parsing to emit ToolUseBlock metadata for progress rendering.

What looks good

  • Nice separation of concerns: _make_stream_callback, _format_verbose_progress, and _summarize_tool_input keep the orchestration logic readable.
  • Good UX addition with per-user override via context.user_data["verbose_level"] while preserving a global default.
  • Good call extracting ToolUseBlock in src/claude/sdk_integration.py; that unlocks richer progress UI without invasive changes elsewhere.

Issues / questions

  1. [Important] src/bot/orchestrator.py (_summarize_tool_input for Bash) — this currently echoes raw command prefixes into chat (cmd[:80]). That can leak secrets (tokens, passwords, API keys) if users/scripts include them in CLI args. I’d strongly recommend redacting common secret patterns and/or suppressing Bash argument details by default (especially in group chats).
  2. [Important] src/bot/orchestrator.py (_on_stream) — typing refresh is tied to receiving stream events. If the agent is in a long-running step with sparse/no stream updates, typing can drop despite docs claiming a persistent ~2s indicator “at all levels”. Consider a lightweight heartbeat task (start before run_command, cancel in finally) so typing stays alive independently of stream cadence.

Suggested tests (if needed)

  • Unit test for _summarize_tool_input("Bash", ...) ensuring sensitive substrings are redacted or omitted.
  • Async test that verifies typing indicator is still refreshed during a simulated long command with no intermediate stream events.

Verdict

  • ⚠️ Merge after fixes

Two security/reliability fixes for the verbose output system:

1. Secret redaction: _summarize_tool_input now runs Bash command
   previews through _redact_secrets() which strips API keys, tokens,
   passwords, AWS keys, Bearer/Basic auth, and connection string
   credentials before they reach Telegram chat.

2. Typing heartbeat: Replace stream-event-coupled typing indicators
   with an independent asyncio background task that sends "typing"
   every ~2s regardless of stream cadence. This keeps the indicator
   alive during long tool executions with sparse/no intermediate
   output. The heartbeat is cancelled in a finally block.

Includes 15 new tests covering both features.

https://claude.ai/code/session_01RZGrZTQsvypQQM2EP5F24v
@RichardAtCT RichardAtCT merged commit 6861ce5 into main Feb 18, 2026
1 check passed
@RichardAtCT RichardAtCT deleted the claude/verbose-bot-output-c7iNz branch February 18, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants