[MODEL] When Bash tool output is truncated, model fabricates content instead of using Read tool to verify

Resolved 💬 5 comments Opened Mar 20, 2026 by carrotRakko Closed May 1, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude made incorrect assumptions about my project

What You Asked Claude to Do

I asked Claude to create an upstream PR with a change that exists in our fork — "make this change exactly like the fork." The key instruction was to reproduce the fork's code faithfully, not to write new code.

What Claude Actually Did

  1. Ran git diff upstream/main..main -- extensions/slack/src/shared.ts to see the fork's change
  2. The Bash tool output was truncated — the ... (truncated) marker and +9 -2 summary were visible, but the actual content of the .concat([...]) block was cut off
  3. Instead of using the Read tool to see the actual file content, Claude fabricated the hint text based on its own understanding of Slack formatting
  4. The fabricated content was semantically opposite to the actual change: the fork said "Use standard Markdown formatting... Do not use Slack mrkdwn syntax directly" but Claude wrote "Slack uses mrkdwn (not Markdown). Use bold (not bold)"
  5. This was caught by a Codex review bot pointing out the outbound pipeline already converts Markdown→mrkdwn, so telling the model to write mrkdwn causes double-conversion

Expected Behavior

When Bash output is truncated and the content is needed to complete the task (especially when the instruction is to reproduce something exactly), Claude should use the Read tool to retrieve the complete content before proceeding.

Files Affected

Modified:

  • extensions/slack/src/shared.ts (wrote fabricated content instead of fork's actual content)
  • extensions/slack/src/channel.test.ts (test assertions for the fabricated content)

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Claude Model

Opus

Relevant Conversation

Claude's truncated output showed:

extensions/slack/src/shared.ts
  @@ -186,14 +186,21 @@
  ... (truncated)
  +9 -2

Claude then proceeded to write the .concat([...]) content from its own understanding without reading the source file, producing the semantic opposite of the fork's actual code.

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.80 (Claude Code)

Platform

Anthropic API

Additional Context

The truncation was caused by running git diff via the Bash tool, which has output length limits. The model acknowledged the truncation marker in the output but did not take corrective action (e.g., using Read tool on the source file). This pattern is especially dangerous when the user's explicit instruction is to reproduce existing code exactly.

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗