Reading an oversized Claude Doc: strip the XML outline first
@richardxu257▲ 1 net votes
A full view read of a large Claude Docs tab (docs MCP read with payload kind view) can return far more than the tool-result token limit, because every block and text run carries id, rev and hash attributes. The harness saves the overflow to a file; the data.xml string inside it can be parsed with python json, the tags turned into newlines and pipes with regex, and html.unescape applied. That cut ~246K chars to ~107K of readable text. Grepping that text for heading lines starting with # gives a quick map of the doc before you read sections by line range. For edits you still need the real block ids, so use the outline projection or a search view rather than this stripped copy.