claude-code - 💡(How to fix) Fix [FEATURE] Monitor tool event notifications should support configurable content length (currently hard-truncated at ~400 chars) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46170Fetched 2026-04-11 06:27:17
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Code Example

# A script that emits a single line longer than 400 characters
python3 -c "print('A' * 500)"
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Problem Statement

The Monitor tool truncates event notifications at approximately 400 characters, appending ...(truncated) to the content. This truncation is applied to what Claude receives in <task-notification> tags — not just the terminal display.

This makes Monitor impractical for streaming structured events (e.g., JSON payloads, log entries, webhook bodies) where the payload regularly exceeds 400 characters. Claude cannot read the full event and must use a secondary tool (like reading a file or re-fetching the data) to get the complete content.

Reproduction

# A script that emits a single line longer than 400 characters
python3 -c "print('A' * 500)"

Start this via Monitor. The notification Claude receives will be truncated at ~400 characters with ...(truncated).

Proposed Solution

  1. Add a parameter to the Monitor tool (e.g., max_event_length) to control the truncation threshold, or remove it entirely for the content delivered to Claude's context.
  2. Increase the default limit — 400 characters is too low for most structured data formats (JSON, log lines, etc.).
  3. At minimum, document the limit so tool authors can design around it.

Alternative Solutions

  • Truncation could be applied only to the human-facing terminal display (similar to how <channel> tags deliver full content to Claude but the TUI truncates for display — see #43987).
  • Monitor could write full events to the output file while truncating notifications, letting Claude Read the file for full content when needed.

Priority

Medium - Impacts specific workflows

Feature Category

Tools / Background tasks

Use Case Example

An agent monitors a WebSocket event stream via a background script. Each event is a single-line JSON object (~500-1000 chars). The agent needs to parse the full JSON to decide how to respond. With the current truncation, the JSON is cut off mid-field, making it unparseable. The agent must then call history or re-fetch the data through another channel, adding latency and complexity to what should be a real-time workflow.

Additional Context

  • Related: #43987 (channel notification display truncation — different layer, same class of problem)
  • Related: #45928 (Monitor tool is undocumented — truncation behavior is not mentioned anywhere)
  • The Monitor tool's schema has no parameter to control this behavior
  • The truncation marker ...(truncated) is not user-configurable

extent analysis

TL;DR

Increase the default truncation limit of the Monitor tool or add a parameter to control the truncation threshold to accommodate larger event notifications.

Guidance

  • Review the proposed solutions, such as adding a max_event_length parameter or increasing the default limit, to determine the best approach for your use case.
  • Consider documenting the current limit to help tool authors design around it, even if a permanent solution is not immediately implemented.
  • Evaluate alternative solutions, like applying truncation only to the terminal display or writing full events to an output file, to find a suitable workaround.

Example

No specific code snippet is provided, as the issue focuses on the behavior of the Monitor tool rather than a specific code implementation.

Notes

The ideal solution may depend on the specific requirements of your workflow and the trade-offs between notification size, performance, and usability. It's essential to weigh the benefits of increasing the truncation limit against potential drawbacks, such as increased latency or display issues.

Recommendation

Apply a workaround, such as writing full events to an output file or using an alternative notification method, until a permanent solution like adding a max_event_length parameter can be implemented. This approach allows for immediate mitigation of the issue while a more robust solution is developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING