[BUG] View tool mangles XML tags

Resolved 💬 2 comments Opened Apr 24, 2025 by commi Closed Nov 29, 2025

## Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: claude/v1.5.0
  • Operating System: Linux 6.11.7-x64v3-xanmod1
  • Terminal: Bash

## Bug Description
XML tag discrepancy between hex view and text view when working with XML files. The system appears to be replacing certain XML tags when they're displayed in text output.

## Steps to Reproduce

  1. Create or access an XML file with short tag names (e.g., <name> tags)
  2. View the file using the View tool or cat command, which shows <n> tags
  3. Examine the same file with a hex editor (xxd), which reveals the actual content has <name> tags
  4. Create a new file based on what you see in the View tool
  5. The resulting file shows discrepancy between what was intended and what was actually written

## Expected Behavior
Tools should display XML tags exactly as they appear in the file, without any modification or substitution.

## Actual Behavior

  • Text view (using View tool or cat) shows <n> tags
  • Hex view (using xxd) shows <name> tags for the same elements
  • When writing new files based on what's shown in the text view, the system maintains this inconsistency

View original on GitHub ↗

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