[FEATURE] Complete Message Output in Interactive Mode for Long-Running Automation Sessions

Resolved 💬 1 comment Opened May 25, 2026 by Vienky Closed Jun 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

In interactive mode, claude's text output is often truncated when it decides to call a tool mid-sentence. The session .jsonl file records incomplete text fragments like:

{"message": {"content": [{"type": "text", "text": "Now I need to check the current status of the deployment. Let me"}]}}
{"message": {"content": [{"type": "tool_use", "id": "...", "name": "mcp__kubernetes__get_pods"}]}}

The text "Let me" is cut off because claude immediately called a tool, leaving the reasoning incomplete.

Proposed Solution

Add a session-level setting or CLI flag to control streaming behavior:

Option A: New CLI flag

claude --complete-messages-before-tools

When enabled, Claude would buffer text output until reaching a natural stopping point (sentence boundary, paragraph break) before calling tools.

Option B: Settings file option

{
  "streaming": {
    "completeMessagesBeforeTools": true,
    "minCompletionDelay": 100
  }
}

Option C: Extend --include-partial-messages to interactive mode

Allow --include-partial-messages to work without -p, and ensure the final complete message is always written to the session .jsonl file.

Option D: Message completion callback

Provide a hook that fires when Claude completes a thought before tool execution, allowing external logging systems to capture the complete reasoning chain.

Alternative Solutions

  1. Accept incomplete output: Not viable for production automation systems that require audit trails
  2. Use -p mode repeatedly: Loses session state, can't use --resume, defeats the purpose of interactive mode
  3. Post-process with LLM: Expensive and unreliable to "guess" what Claude meant to say
  4. Increase polling interval: Doesn't solve the fundamental issue of mid-sentence truncation
  5. Custom logging wrapper: Cannot intercept internal streaming behavior

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

I'm building an infrastructure automation system using Claude Code + MCP servers for multi-hour autonomous sessions. The workflow is:

  1. Start Claude Code with logging: claude --resume <session_id> --debug-file debug.log
  2. Claude monitors and manages infrastructure for hours, making hundreds of decisions
  3. Generate audit reports linking:
  • Claude's reasoning (text output)
  • Tool calls (MCP operations)
  • System state changes (logs, metrics)

Current issue: Claude's reasoning is fragmented and incomplete, making it hard to understand decision chains like:

[10:30:40] Claude: "The pod restart count is increasing. I need to check the logs to"
[10:30:40] Tool: kubectl_logs(pod="api-server-xyz")
[10:30:43] Claude: "Found OOM errors. The memory limit needs to be increased. Let me upd"
[10:30:48] Tool: kubectl_patch(resource="deployment/api-server", patch=...)

Every sentence is cut off mid-thought, making audit logs nearly unreadable.

Additional Context

  • This affects any long-running automation workflow using claude + mcp
  • The issue is more visible when claude makes rapid tool calls (common in automation scenarios)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗