Inspect a broken book file and search it manually

When an indexer failed on an uploaded book, Claude used shell commands to identify the file type and search the text directly.

Done with Claude· Intermediate· Aug 2026

What they did
A commenter uploaded a book into Claude’s web chat, but the retrieval indexer crashed on it. Claude then ran Unix commands to figure out how the file was structured, and used grep to scan the book contents by hand.
How it went
That let Claude work around the broken indexer and still search the book. The commenter said the result was surprising. No details were given about how accurate the search was, what the format turned out to be, or how long it took.
Tips
If automated indexing fails, ask the agent to inspect the file’s structure first, then extract searchable text without changing the original. Keep the task read-only until you know the file is safe to process.

Try it yourself with Claude Code

I have a file at [path] that my normal tools cannot read reliably, and I need to search it for [topic or phrase]. First, inspect the file’s structure and identify the format using command-line tools. Then extract any readable text into a separate plain-text file and search that text for the target. Show the matching passages with their locations. Do not alter the original file. Before you do anything irreversible, pause and ask me to approve it.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.